summaryrefslogtreecommitdiffstats
path: root/fs/ceph/caps.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2017-07-24 17:59:39 +0800
committerIlya Dryomov <idryomov@gmail.com>2017-09-06 19:56:44 +0200
commit95569713afc0b53ded1bba67834e0be24529a8c9 (patch)
tree213f9d7dc7f6420161906cc7c6c8ca18be19e9dc /fs/ceph/caps.c
parent3fb99d483e614bc3834784c7a686572c7970bb92 (diff)
downloadlinux-95569713afc0b53ded1bba67834e0be24529a8c9.tar.gz
linux-95569713afc0b53ded1bba67834e0be24529a8c9.tar.bz2
linux-95569713afc0b53ded1bba67834e0be24529a8c9.zip
ceph: new cap message flags indicate if there is pending capsnap
These flags tell mds if there is pending capsnap explicitly. Without this explicit notification, mds can only conclude if client has pending capsnap. The method mds use is inefficient and error-prone. Signed-off-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r--fs/ceph/caps.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 7007ae2a5ad2..b675c004f6a7 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -1248,7 +1248,10 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap,
arg.mode = inode->i_mode;
arg.inline_data = ci->i_inline_version != CEPH_INLINE_NONE;
- arg.flags = 0;
+ if (list_empty(&ci->i_cap_snaps))
+ arg.flags = CEPH_CLIENT_CAPS_NO_CAPSNAP;
+ else
+ arg.flags = CEPH_CLIENT_CAPS_PENDING_CAPSNAP;
if (sync)
arg.flags |= CEPH_CLIENT_CAPS_SYNC;