Skip to contentSkip to conversation

ceph: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

PATCH In review [email protected] 3 participants 4 messages Dec 21, 2021 – Jan 3, 2022 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: replace DEFINE_SIMPLE_ATTRIBUTE with DEFINE_DEBUGFS_ATTRIBUTE

From: Changcheng Deng <[email protected]>

Fix the following coccicheck warning:
./fs/ceph/debugfs.c: 390: 0-23: WARNING: congestion_kb_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE

Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for debugfs files.

---
 fs/ceph/debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ceph/debugfs.c +2 -2
index 3cf7c9c1085b..64c4158c17c8 100644
@@ -387,8 +387,8 @@ static int congestion_kb_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
-			congestion_kb_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
+			 congestion_kb_set, "%llu\n");
 
 
 void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
Signature · 1 line
2.25.1
#1 lore raw
Quoted 20 lines · On Tue, 2021-12-21 at 14:36 +0000, [email protected] wrote:

From: Changcheng Deng <[email protected]>

Fix the following coccicheck warning:
./fs/ceph/debugfs.c: 390: 0-23: WARNING: congestion_kb_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE

Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for debugfs files.

---
 fs/ceph/debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ceph/debugfs.c +0 -0
index 3cf7c9c1085b..64c4158c17c8 100644

fs/ceph/debugfs.c static int congestion_kb_get(void *data, u64 *val) · line 394

Quoted 10 lines
fs/ceph/debugfs.c +2 -2
@@ -387,8 +387,8 @@ static int congestion_kb_get(void *data, u64 *val)
 	return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
-			congestion_kb_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
+			 congestion_kb_set, "%llu\n");
 
 
 void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)

Thanks, merged into our testing branch. This should make v5.17.

Cheers,

Signature · 1 line
Jeff Layton <[email protected]>
maintainer
#2 lore raw
Quoted 31 lines · Jeff Layton
Quoted 29 lines · On Tue, 2021-12-21 at 14:36 +0000, [email protected] wrote:

From: Changcheng Deng <[email protected]>

Fix the following coccicheck warning:
./fs/ceph/debugfs.c: 390: 0-23: WARNING: congestion_kb_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE

Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for debugfs files.

---
 fs/ceph/debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ceph/debugfs.c +2 -2
index 3cf7c9c1085b..64c4158c17c8 100644
@@ -387,8 +387,8 @@ static int congestion_kb_get(void *data, u64 *val)
      return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
-                     congestion_kb_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
+                      congestion_kb_set, "%llu\n");
 
 
Quoted 3 lines

fs/ceph/debugfs.c static int congestion_kb_get(void *data, u64 *val) · line 394

Quoted 1 line
fs/ceph/debugfs.c +0 -0
 void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)

Thanks, merged into our testing branch. This should make v5.17.

Hi Jeff,

This came up last year, has anything changed?

https://www.spinics.net/lists/ceph-devel/msg50492.html

Thanks,

Ilya

#3 lore raw
Quoted 36 lines · Ilya Dryomov
Quoted 31 lines · Jeff Layton
Quoted 29 lines · On Tue, 2021-12-21 at 14:36 +0000, [email protected] wrote:

From: Changcheng Deng <[email protected]>

Fix the following coccicheck warning:
./fs/ceph/debugfs.c: 390: 0-23: WARNING: congestion_kb_fops should be defined with DEFINE_DEBUGFS_ATTRIBUTE

Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for debugfs files.

---
 fs/ceph/debugfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ceph/debugfs.c +2 -2
index 3cf7c9c1085b..64c4158c17c8 100644
@@ -387,8 +387,8 @@ static int congestion_kb_get(void *data, u64 *val)
      return 0;
 }
 
-DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
-                     congestion_kb_set, "%llu\n");
+DEFINE_DEBUGFS_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
+                      congestion_kb_set, "%llu\n");
 
 
Quoted 3 lines

fs/ceph/debugfs.c static int congestion_kb_get(void *data, u64 *val) · line 394

Quoted 1 line
fs/ceph/debugfs.c +0 -0
 void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)

Thanks, merged into our testing branch. This should make v5.17.

Quoted 6 lines

Hi Jeff,

This came up last year, has anything changed?

https://www.spinics.net/lists/ceph-devel/msg50492.html

Good point, that discussion had totally slipped my mind. Dropping this patch again for now until the rationale is clearer.

Jiapeng, could you clarify why you didn't do the other part of that conversion?

Thanks,

Signature · 1 line
Jeff Layton <[email protected]>