summaryrefslogtreecommitdiffstats
path: root/src/libcephfs.cc
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2016-08-29 13:16:38 +0200
committerJeff Layton <jlayton@redhat.com>2016-08-29 13:16:38 +0200
commitf7c885e1f9cefc359f8b6fe7e51e212387432529 (patch)
tree270decc1653a547dec5bd550401cd8ab99da5ee6 /src/libcephfs.cc
parentclient: move the device bitshift handling macros to Client.h (diff)
downloadceph-f7c885e1f9cefc359f8b6fe7e51e212387432529.tar.xz
ceph-f7c885e1f9cefc359f8b6fe7e51e212387432529.zip
libcephfs: add a ceph_ll_getattrx and ceph_statx
New interfaces for fetching extended (and selective) stat information. Additionally, applications can specify AT_NO_ATTR_SYNC in the flags to indicate that they want to do a "lazy" statx that just hands out the inode info from the cache, or AT_SYMLINK_NOFOLLOW to avoid following symlinks when walking the path. Signed-off-by: Jeff Layton <jlayton@redhat.com>
Diffstat (limited to 'src/libcephfs.cc')
-rw-r--r--src/libcephfs.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libcephfs.cc b/src/libcephfs.cc
index 75653610fde..c01255e5906 100644
--- a/src/libcephfs.cc
+++ b/src/libcephfs.cc
@@ -610,6 +610,14 @@ extern "C" int ceph_stat(struct ceph_mount_info *cmount, const char *path,
return cmount->get_client()->stat(path, stbuf);
}
+extern "C" int ceph_statx(struct ceph_mount_info *cmount, const char *path,
+ struct ceph_statx *stx, unsigned int want, unsigned int flags)
+{
+ if (!cmount->is_mounted())
+ return -ENOTCONN;
+ return cmount->get_client()->statx(path, stx, want, flags);
+}
+
extern "C" int ceph_lstat(struct ceph_mount_info *cmount, const char *path,
struct stat *stbuf)
{
@@ -1406,6 +1414,14 @@ extern "C" int ceph_ll_getattr(class ceph_mount_info *cmount,
return (cmount->get_client()->ll_getattr(in, attr, uid, gid));
}
+extern "C" int ceph_ll_getattrx(class ceph_mount_info *cmount,
+ Inode *in, struct ceph_statx *stx,
+ unsigned int want, unsigned int flags,
+ int uid, int gid)
+{
+ return (cmount->get_client()->ll_getattrx(in, stx, want, flags, uid, gid));
+}
+
extern "C" int ceph_ll_setattr(class ceph_mount_info *cmount,
Inode *in, struct stat *st,
int mask, int uid, int gid)