[1/8] ceph: remove ceph_get_cap_mds and __ceph_get_cap_mds
diff mbox series

Message ID 20190725111746.10393-2-jlayton@kernel.org
State New
Headers show
Series
  • ceph: minor cleanup patches for v5.4
Related show

Commit Message

Jeff Layton July 25, 2019, 11:17 a.m. UTC
Nothing calls these routines.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ceph/caps.c  | 31 -------------------------------
 fs/ceph/super.h |  1 -
 2 files changed, 32 deletions(-)

Patch
diff mbox series

diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index d17bde5d4f9a..4615f2501e15 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -457,37 +457,6 @@  struct ceph_cap *ceph_get_cap_for_mds(struct ceph_inode_info *ci, int mds)
 	return cap;
 }
 
-/*
- * Return id of any MDS with a cap, preferably FILE_WR|BUFFER|EXCL, else -1.
- */
-static int __ceph_get_cap_mds(struct ceph_inode_info *ci)
-{
-	struct ceph_cap *cap;
-	int mds = -1;
-	struct rb_node *p;
-
-	/* prefer mds with WR|BUFFER|EXCL caps */
-	for (p = rb_first(&ci->i_caps); p; p = rb_next(p)) {
-		cap = rb_entry(p, struct ceph_cap, ci_node);
-		mds = cap->mds;
-		if (cap->issued & (CEPH_CAP_FILE_WR |
-				   CEPH_CAP_FILE_BUFFER |
-				   CEPH_CAP_FILE_EXCL))
-			break;
-	}
-	return mds;
-}
-
-int ceph_get_cap_mds(struct inode *inode)
-{
-	struct ceph_inode_info *ci = ceph_inode(inode);
-	int mds;
-	spin_lock(&ci->i_ceph_lock);
-	mds = __ceph_get_cap_mds(ceph_inode(inode));
-	spin_unlock(&ci->i_ceph_lock);
-	return mds;
-}
-
 /*
  * Called under i_ceph_lock.
  */
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 358559c17c41..817bab741267 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -1052,7 +1052,6 @@  extern void ceph_kick_flushing_caps(struct ceph_mds_client *mdsc,
 				    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 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_wrbuffer_cap_refs(struct ceph_inode_info *ci, int nr,