aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/caps.c
diff options
context:
space:
mode:
authorGreg Farnum <gregf@hq.newdream.net>2010-06-30 15:44:34 -0400
committerSage Weil <sage@newdream.net>2010-08-01 23:11:41 -0400
commit2bc50259fa0aa1868f8b2ba1d374406cb3c57f72 (patch)
tree0c8d510478866b4fdeafeb7953395226f0b8fb25 /fs/ceph/caps.c
parent154f42c2c3c3b66a7a63dad5648e8a9860a32af9 (diff)
ceph: add ceph_get_cap_for_mds function.
Signed-off-by: Greg Farnum <gregf@hq.newdream.net> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r--fs/ceph/caps.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 52befa65fbf7..e3b848d7698d 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -327,6 +327,16 @@ static struct ceph_cap *__get_cap_for_mds(struct ceph_inode_info *ci, int mds)
327 return NULL; 327 return NULL;
328} 328}
329 329
330struct ceph_cap *ceph_get_cap_for_mds(struct ceph_inode_info *ci, int mds)
331{
332 struct ceph_cap *cap;
333
334 spin_lock(&ci->vfs_inode.i_lock);
335 cap = __get_cap_for_mds(ci, mds);
336 spin_unlock(&ci->vfs_inode.i_lock);
337 return cap;
338}
339
330/* 340/*
331 * Return id of any MDS with a cap, preferably FILE_WR|BUFFER|EXCL, else -1. 341 * Return id of any MDS with a cap, preferably FILE_WR|BUFFER|EXCL, else -1.
332 */ 342 */