diff options
author | Yan, Zheng <zyan@redhat.com> | 2015-05-01 11:57:16 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-06-25 11:49:28 +0300 |
commit | 860560904962d08fd38666207c910065fe53e074 (patch) | |
tree | 88a9532f9652a11bb393a4496130c532705282b9 /fs/ceph/super.h | |
parent | 5dda377cf0a6bd43f64a3c1efb670d7c668e7b29 (diff) | |
download | linux-860560904962d08fd38666207c910065fe53e074.tar.xz |
ceph: avoid sending unnessesary FLUSHSNAP message
when a snap notification contains no new snapshot, we can avoid
sending FLUSHSNAP message to MDS. But we still need to create
cap_snap in some case because it's required by write path and
page writeback path
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r-- | fs/ceph/super.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index b182fd7499d9..4ef1ae92c2a6 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -164,6 +164,7 @@ struct ceph_cap_snap { int writing; /* a sync write is still in progress */ int dirty_pages; /* dirty pages awaiting writeback */ bool inline_data; + bool need_flush; }; static inline void ceph_put_cap_snap(struct ceph_cap_snap *capsnap) @@ -719,8 +720,8 @@ extern void ceph_snap_exit(void); static inline bool __ceph_have_pending_cap_snap(struct ceph_inode_info *ci) { return !list_empty(&ci->i_cap_snaps) && - list_entry(ci->i_cap_snaps.prev, struct ceph_cap_snap, - ci_item)->writing; + list_last_entry(&ci->i_cap_snaps, struct ceph_cap_snap, + ci_item)->writing; } /* inode.c */ |