aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/super.h
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2015-05-01 16:57:16 +0800
committerIlya Dryomov <idryomov@gmail.com>2015-06-25 11:49:28 +0300
commit860560904962d08fd38666207c910065fe53e074 (patch)
tree88a9532f9652a11bb393a4496130c532705282b9 /fs/ceph/super.h
parentceph: set i_head_snapc when getting CEPH_CAP_FILE_WR reference (diff)
downloadlinux-dev-860560904962d08fd38666207c910065fe53e074.tar.xz
linux-dev-860560904962d08fd38666207c910065fe53e074.zip
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.h5
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 */