提交 2bc50259 编写于 作者: G Greg Farnum 提交者: Sage Weil

ceph: add ceph_get_cap_for_mds function.

Signed-off-by: NGreg Farnum <gregf@hq.newdream.net>
Signed-off-by: NSage Weil <sage@newdream.net>
上级 154f42c2
...@@ -327,6 +327,16 @@ static struct ceph_cap *__get_cap_for_mds(struct ceph_inode_info *ci, int mds) ...@@ -327,6 +327,16 @@ static struct ceph_cap *__get_cap_for_mds(struct ceph_inode_info *ci, int mds)
return NULL; return NULL;
} }
struct ceph_cap *ceph_get_cap_for_mds(struct ceph_inode_info *ci, int mds)
{
struct ceph_cap *cap;
spin_lock(&ci->vfs_inode.i_lock);
cap = __get_cap_for_mds(ci, mds);
spin_unlock(&ci->vfs_inode.i_lock);
return cap;
}
/* /*
* Return id of any MDS with a cap, preferably FILE_WR|BUFFER|EXCL, else -1. * Return id of any MDS with a cap, preferably FILE_WR|BUFFER|EXCL, else -1.
*/ */
......
...@@ -816,6 +816,8 @@ extern int ceph_write_inode(struct inode *inode, struct writeback_control *wbc); ...@@ -816,6 +816,8 @@ extern int ceph_write_inode(struct inode *inode, struct writeback_control *wbc);
extern int ceph_fsync(struct file *file, int datasync); extern int ceph_fsync(struct file *file, int datasync);
extern void ceph_kick_flushing_caps(struct ceph_mds_client *mdsc, extern void ceph_kick_flushing_caps(struct ceph_mds_client *mdsc,
struct ceph_mds_session *session); struct ceph_mds_session *session);
extern struct ceph_cap *ceph_get_cap_for_mds(struct ceph_inode_info *ci,
int mds);
extern int ceph_get_cap_mds(struct inode *inode); extern int ceph_get_cap_mds(struct inode *inode);
extern void ceph_get_cap_refs(struct ceph_inode_info *ci, int caps); extern void ceph_get_cap_refs(struct ceph_inode_info *ci, int caps);
extern void ceph_put_cap_refs(struct ceph_inode_info *ci, int had); extern void ceph_put_cap_refs(struct ceph_inode_info *ci, int had);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册