cephfs: add AtStatxDontSync and deprecate AtNoAttrSync

This change follows the upstream deprecation of AT_NO_ATTR_SYNC in
favor of the standard AT_STATX_DONT_SYNC.

Fixes: #741

Signed-off-by: Sven Anderson <sven@redhat.com>
This commit is contained in:
Sven Anderson 2022-07-28 15:44:10 +09:00 committed by mergify[bot]
parent f605c4713d
commit fde1e1b66b
1 changed files with 10 additions and 1 deletions

View File

@ -4,6 +4,10 @@ package cephfs
#cgo LDFLAGS: -lcephfs #cgo LDFLAGS: -lcephfs
#cgo CPPFLAGS: -D_FILE_OFFSET_BITS=64 #cgo CPPFLAGS: -D_FILE_OFFSET_BITS=64
#include <cephfs/libcephfs.h> #include <cephfs/libcephfs.h>
#ifndef AT_STATX_DONT_SYNC
// for versions earlier than Pacific
#define AT_STATX_DONT_SYNC AT_NO_ATTR_SYNC
#endif
*/ */
import "C" import "C"
@ -53,9 +57,14 @@ const (
type AtFlags uint type AtFlags uint
const ( const (
// AtStatxDontSync requests that the stat call only fetch locally-cached
// values if possible, avoiding round trips to a back-end server.
AtStatxDontSync = AtFlags(C.AT_STATX_DONT_SYNC)
// AtNoAttrSync requests that the stat call only fetch locally-cached // AtNoAttrSync requests that the stat call only fetch locally-cached
// values if possible, avoiding round trips to a back-end server. // values if possible, avoiding round trips to a back-end server.
AtNoAttrSync = AtFlags(C.AT_NO_ATTR_SYNC) //
// Deprecated: replaced by AtStatxDontSync
AtNoAttrSync = AtStatxDontSync
// AtSymlinkNofollow indicates the call should not follow symlinks // AtSymlinkNofollow indicates the call should not follow symlinks
// but operate on the symlink itself. // but operate on the symlink itself.
AtSymlinkNofollow = AtFlags(C.AT_SYMLINK_NOFOLLOW) AtSymlinkNofollow = AtFlags(C.AT_SYMLINK_NOFOLLOW)