diff options
author | Yanhu Cao <gmayyyha@gmail.com> | 2020-08-28 09:28:44 +0800 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2021-04-27 23:52:23 +0200 |
commit | e7f72952508ac4354f9bec0607ac8a200d050e65 (patch) | |
tree | 085cc7df14c74d854b97ae98712ec14f5509e221 /fs/ceph/mds_client.c | |
parent | e72968e15b297a51dcefe93a95e875dcefe6c4aa (diff) | |
download | lwn-e7f72952508ac4354f9bec0607ac8a200d050e65.tar.gz lwn-e7f72952508ac4354f9bec0607ac8a200d050e65.zip |
ceph: support getting ceph.dir.rsnaps vxattr
Add support for grabbing the rsnaps value out of the inode info in
traces, and exposing that via ceph.dir.rsnaps xattr.
Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r-- | fs/ceph/mds_client.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 73ecb7d128c9..5c50f7986404 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -176,6 +176,13 @@ static int parse_reply_info_in(void **p, void *end, memset(&info->snap_btime, 0, sizeof(info->snap_btime)); } + /* snapshot count, remains zero for v<=3 */ + if (struct_v >= 4) { + ceph_decode_64_safe(p, end, info->rsnaps, bad); + } else { + info->rsnaps = 0; + } + *p = end; } else { if (features & CEPH_FEATURE_MDS_INLINE_DATA) { @@ -214,7 +221,7 @@ static int parse_reply_info_in(void **p, void *end, } info->dir_pin = -ENODATA; - /* info->snap_btime remains zero */ + /* info->snap_btime and info->rsnaps remain zero */ } return 0; bad: |