diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2013-02-18 00:43:43 -0500 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:14:31 -0400 |
commit | d40ee0dcc1b27792b9b2f3905a5eaf4da061dbd5 (patch) | |
tree | 6f0b0d510311f809ebe69f3d3806be48e8d8ce68 /fs/ceph | |
parent | 8a034497005491dc91ed7bfd660b04923d35d0e6 (diff) |
ceph: queue cap release when trimming cap
So the client will later send cap release message to MDS
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/caps.c | 6 | ||||
-rw-r--r-- | fs/ceph/mds_client.c | 2 | ||||
-rw-r--r-- | fs/ceph/super.h | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 78e2f575247d..0d54368490db 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -997,9 +997,9 @@ static int send_cap_msg(struct ceph_mds_session *session, | |||
997 | return 0; | 997 | return 0; |
998 | } | 998 | } |
999 | 999 | ||
1000 | static void __queue_cap_release(struct ceph_mds_session *session, | 1000 | void __queue_cap_release(struct ceph_mds_session *session, |
1001 | u64 ino, u64 cap_id, u32 migrate_seq, | 1001 | u64 ino, u64 cap_id, u32 migrate_seq, |
1002 | u32 issue_seq) | 1002 | u32 issue_seq) |
1003 | { | 1003 | { |
1004 | struct ceph_msg *msg; | 1004 | struct ceph_msg *msg; |
1005 | struct ceph_mds_cap_release *head; | 1005 | struct ceph_mds_cap_release *head; |
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 6e67a3501673..fb7cb05d8aba 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -1197,6 +1197,8 @@ static int trim_caps_cb(struct inode *inode, struct ceph_cap *cap, void *arg) | |||
1197 | session->s_trim_caps--; | 1197 | session->s_trim_caps--; |
1198 | if (oissued) { | 1198 | if (oissued) { |
1199 | /* we aren't the only cap.. just remove us */ | 1199 | /* we aren't the only cap.. just remove us */ |
1200 | __queue_cap_release(session, ceph_ino(inode), cap->cap_id, | ||
1201 | cap->mseq, cap->issue_seq); | ||
1200 | __ceph_remove_cap(cap); | 1202 | __ceph_remove_cap(cap); |
1201 | } else { | 1203 | } else { |
1202 | /* try to drop referring dentries */ | 1204 | /* try to drop referring dentries */ |
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index c7b309723dcc..86810b6d973b 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h | |||
@@ -755,6 +755,8 @@ static inline void ceph_remove_cap(struct ceph_cap *cap) | |||
755 | extern void ceph_put_cap(struct ceph_mds_client *mdsc, | 755 | extern void ceph_put_cap(struct ceph_mds_client *mdsc, |
756 | struct ceph_cap *cap); | 756 | struct ceph_cap *cap); |
757 | 757 | ||
758 | extern void __queue_cap_release(struct ceph_mds_session *session, u64 ino, | ||
759 | u64 cap_id, u32 migrate_seq, u32 issue_seq); | ||
758 | extern void ceph_queue_caps_release(struct inode *inode); | 760 | extern void ceph_queue_caps_release(struct inode *inode); |
759 | extern int ceph_write_inode(struct inode *inode, struct writeback_control *wbc); | 761 | extern int ceph_write_inode(struct inode *inode, struct writeback_control *wbc); |
760 | extern int ceph_fsync(struct file *file, loff_t start, loff_t end, | 762 | extern int ceph_fsync(struct file *file, loff_t start, loff_t end, |