Skip to contentSkip to conversation

ceph: remove unused CEPH_MDS_LEASE_RELEASE related code

PATCH Superseded [email protected] 2 participants 3 messages Mar 28, 2022 Ceph client

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: remove unused CEPH_MDS_LEASE_RELEASE related code

From: Xiubo Li <[email protected]>

The ceph_mdsc_lease_release() has been removed by commit(8aa152c77890) and the CEPH_MDS_LEASE_RELEASE will never be used.

---
 fs/ceph/mds_client.c | 6 ------
 1 file changed, 6 deletions(-)
fs/ceph/mds_client.c +0 -6
index 459c6f23915f..a89ee866ebbb 100644
@@ -4424,12 +4424,6 @@ void ceph_mdsc_lease_send_msg(struct ceph_mds_session *session,
 	memcpy((void *)(lease + 1) + 4,
 	       dentry->d_name.name, dentry->d_name.len);
 	spin_unlock(&dentry->d_lock);
-	/*
-	 * if this is a preemptive lease RELEASE, no need to
-	 * flush request stream, since the actual request will
-	 * soon follow.
-	 */
-	msg->more_to_follow = (action == CEPH_MDS_LEASE_RELEASE);
 
 	ceph_con_send(&session->s_con, msg);
 }
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · On Mon, 2022-03-28 at 10:25 +0800, [email protected] wrote:

From: Xiubo Li <[email protected]>

The ceph_mdsc_lease_release() has been removed by commit(8aa152c77890) and the CEPH_MDS_LEASE_RELEASE will never be used.

Like it says in Documentation/process/5.Posting.rst:

"...and please provide both the commit ID and the title when citing commits"

You might want to reword this with something like:

"ceph_mdsc_lease_release was removed by commit 8aa152c77890 (ceph:
remove ceph_mdsc_lease_release). ceph_mdsc_lease_send_msg will never call this function with CEPH_MDS_LEASE_RELEASE."

Quoted 12 lines
---
 fs/ceph/mds_client.c | 6 ------
 1 file changed, 6 deletions(-)
fs/ceph/mds_client.c +0 -0
index 459c6f23915f..a89ee866ebbb 100644
@@ -4424,12 +4424,6 @@ void ceph_mdsc_lease_send_msg(struct ceph_mds_session *session,
 	memcpy((void *)(lease + 1) + 4,
 	       dentry->d_name.name, dentry->d_name.len);

fs/ceph/mds_client.c void ceph_mdsc_lease_send_msg(struct ceph_mds_session *session, · line 4429

Quoted 10 lines
fs/ceph/mds_client.c +0 -6
 	spin_unlock(&dentry->d_lock);
-	/*
-	 * if this is a preemptive lease RELEASE, no need to
-	 * flush request stream, since the actual request will
-	 * soon follow.
-	 */
-	msg->more_to_follow = (action == CEPH_MDS_LEASE_RELEASE);
 
 	ceph_con_send(&session->s_con, msg);
 }

It might be possible to trim this function back further. There's only one caller and it always calls this with the same "action" value. Still, this looks fine...

author
#2 lore raw
Quoted 8 lines · Jeff Layton
Quoted 5 lines · On Mon, 2022-03-28 at 10:25 +0800, [email protected] wrote:

From: Xiubo Li <[email protected]>

The ceph_mdsc_lease_release() has been removed by commit(8aa152c77890) and the CEPH_MDS_LEASE_RELEASE will never be used.

Like it says in Documentation/process/5.Posting.rst:

Quoted 8 lines

"...and please provide both the commit ID and the title when citing commits"

You might want to reword this with something like:

"ceph_mdsc_lease_release was removed by commit 8aa152c77890 (ceph:
remove ceph_mdsc_lease_release). ceph_mdsc_lease_send_msg will never call this function with CEPH_MDS_LEASE_RELEASE."

Sure, will fix it.

Quoted 20 lines
Quoted 20 lines
---
  fs/ceph/mds_client.c | 6 ------
  1 file changed, 6 deletions(-)
fs/ceph/mds_client.c +0 -6
index 459c6f23915f..a89ee866ebbb 100644
@@ -4424,12 +4424,6 @@ void ceph_mdsc_lease_send_msg(struct ceph_mds_session *session,
  	memcpy((void *)(lease + 1) + 4,
  	       dentry->d_name.name, dentry->d_name.len);
  	spin_unlock(&dentry->d_lock);
-	/*
-	 * if this is a preemptive lease RELEASE, no need to
-	 * flush request stream, since the actual request will
-	 * soon follow.
-	 */
-	msg->more_to_follow = (action == CEPH_MDS_LEASE_RELEASE);
 
Quoted 5 lines

fs/ceph/mds_client.c void ceph_mdsc_lease_send_msg(struct ceph_mds_session *session, · line 4429

Quoted 2 lines
fs/ceph/mds_client.c +0 -0
  	ceph_con_send(&session->s_con, msg);
  }

It might be possible to trim this function back further. There's only one caller and it always calls this with the same "action" value. Still, this looks fine...

Yeah, I checked the commit history in both kernel and ceph, it seems never used since this was introduced. Maybe I missed something.

The user space clients is use the CEPH_MDS_LEASE_RELEASE as the lease revoke ack. In kernel we are using the CEPH_MDS_LEASE_REVOKE_ACK instead.

Thanks.

Quoted 3 lines