Skip to contentSkip to conversation

Fix typo in RWH_WRITE_LIFE_NOT_SET constant name

PATCH Applied Eugene Syromiatnikov 3 participants 9 messages Sep 20, 2019 – Oct 25, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v3 cover Fix typo in RWH_WRITE_LIFE_NOT_SET constant name

Hello.

This is a small fix of a typo (or, more specifically, some remnant of the old patch version spelling) in RWH_WRITE_LIFE_NOT_SET constant, which is named as RWF_WRITE_LIFE_NOT_SET currently. Since the name with "H" is used in man page and everywhere else, it's probably worth to make the name used in the fcntl.h UAPI header in line with it. The two follow-up patches update usage sites of this constant in kernel to use the new spelling.

The old name is retained as it is part of UAPI now.

Changes since v2[1]:
* Updated RWF_WRITE_LIFE_NOT_SET constant usage
in drivers/md/raid5-ppl.c:ppl_init_log().

Changes since v1[2]:
* Changed format of the commit ID in the commit message of the first patch.
* Removed bogus Signed-off-by that snuck into the resend of the series.

[1] https://lkml.org/lkml/2018/10/30/34
[2] https://lkml.org/lkml/2018/10/26/88

Eugene Syromiatnikov (3):
fcntl: fix typo in RWH_WRITE_LIFE_NOT_SET r/w hint name drivers/md/raid5.c: use the new spelling of RWH_WRITE_LIFE_NOT_SET drivers/md/raid5-ppl.c: use the new spelling of RWH_WRITE_LIFE_NOT_SET

 drivers/md/raid5-ppl.c           | 2 +-
 drivers/md/raid5.c               | 4 ++--
 fs/fcntl.c                       | 2 +-
 include/uapi/linux/fcntl.h       | 9 ++++++++-
 tools/include/uapi/linux/fcntl.h | 9 ++++++++-
 5 files changed, 20 insertions(+), 6 deletions(-)
Signature · 1 line
2.1.4
#1 lore raw

PATCH v3 1/3 fcntl: fix typo in RWH_WRITE_LIFE_NOT_SET r/w hint name

According to commit message in the original commit c75b1d9421f8 ("fs:
add fcntl() interface for setting/getting write life time hints"), as well as userspace library[1] and man page update[2], R/W hint constants are intended to have RWH_* prefix. However, RWF_WRITE_LIFE_NOT_SET retained "RWF_*" prefix used in the early versions of the proposed patch set[3]. Rename it and provide the old name as a synonym for the new one for backward compatibility.

[1] https://github.com/axboe/fio/commit/bd553af6c849
[2] https://github.com/mkerrisk/man-pages/commit/580082a186fd
[3] https://www.mail-archive.com/[email protected]/msg09638.html

Fixes c75b1d9421f8 ("fs: add fcntl() interface for setting/getting write life time hints")
---
 fs/fcntl.c                       | 2 +-
 include/uapi/linux/fcntl.h       | 9 ++++++++-
 tools/include/uapi/linux/fcntl.h | 9 ++++++++-
 3 files changed, 17 insertions(+), 3 deletions(-)
fs/fcntl.c +1 -1
index 3d40771..41b6438 100644
@@ -261,7 +261,7 @@ static int f_getowner_uids(struct file *filp, unsigned long arg)
 static bool rw_hint_valid(enum rw_hint hint)
 {
 	switch (hint) {
-	case RWF_WRITE_LIFE_NOT_SET:
+	case RWH_WRITE_LIFE_NOT_SET:
 	case RWH_WRITE_LIFE_NONE:
 	case RWH_WRITE_LIFE_SHORT:
 	case RWH_WRITE_LIFE_MEDIUM:
include/uapi/linux/fcntl.h +8 -1
index 1d33835..1f97b33 100644
@@ -58,7 +58,7 @@
  * Valid hint values for F_{GET,SET}_RW_HINT. 0 is "not set", or can be
  * used to clear any hints previously set.
  */
-#define RWF_WRITE_LIFE_NOT_SET	0
+#define RWH_WRITE_LIFE_NOT_SET	0
 #define RWH_WRITE_LIFE_NONE	1
 #define RWH_WRITE_LIFE_SHORT	2
 #define RWH_WRITE_LIFE_MEDIUM	3
@@ -66,6 +66,13 @@
 #define RWH_WRITE_LIFE_EXTREME	5
 
 /*
+ * The originally introduced spelling is remained from the first
+ * versions of the patch set that introduced the feature, see commit
+ * v4.13-rc1~212^2~51.
+ */
+#define RWF_WRITE_LIFE_NOT_SET	RWH_WRITE_LIFE_NOT_SET
+
+/*
  * Types of directory notifications that may be requested.
  */
 #define DN_ACCESS	0x00000001	/* File accessed */
tools/include/uapi/linux/fcntl.h +8 -1
index 1d33835..1f97b33 100644
@@ -58,7 +58,7 @@
  * Valid hint values for F_{GET,SET}_RW_HINT. 0 is "not set", or can be
  * used to clear any hints previously set.
  */
-#define RWF_WRITE_LIFE_NOT_SET	0
+#define RWH_WRITE_LIFE_NOT_SET	0
 #define RWH_WRITE_LIFE_NONE	1
 #define RWH_WRITE_LIFE_SHORT	2
 #define RWH_WRITE_LIFE_MEDIUM	3
@@ -66,6 +66,13 @@
 #define RWH_WRITE_LIFE_EXTREME	5
 
 /*
+ * The originally introduced spelling is remained from the first
+ * versions of the patch set that introduced the feature, see commit
+ * v4.13-rc1~212^2~51.
+ */
+#define RWF_WRITE_LIFE_NOT_SET	RWH_WRITE_LIFE_NOT_SET
+
+/*
  * Types of directory notifications that may be requested.
  */
 #define DN_ACCESS	0x00000001	/* File accessed */
Signature · 1 line
2.1.4
#2 lore raw

PATCH v3 2/3 drivers/md/raid5.c: use the new spelling of RWH_WRITE_LIFE_NOT_SET

In reply to Eugene Syromiatnikov

As it is consistent with prefixes of other write life time hints.

---
 drivers/md/raid5.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/raid5.c +2 -2
index 223e97a..2f71f6f 100644
@@ -1134,7 +1134,7 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
 			bi->bi_iter.bi_size = STRIPE_SIZE;
 			bi->bi_write_hint = sh->dev[i].write_hint;
 			if (!rrdev)
-				sh->dev[i].write_hint = RWF_WRITE_LIFE_NOT_SET;
+				sh->dev[i].write_hint = RWH_WRITE_LIFE_NOT_SET;
 			/*
 			 * If this is discard request, set bi_vcnt 0. We don't
 			 * want to confuse SCSI because SCSI will replace payload
@@ -1187,7 +1187,7 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s)
 			rbi->bi_io_vec[0].bv_offset = 0;
 			rbi->bi_iter.bi_size = STRIPE_SIZE;
 			rbi->bi_write_hint = sh->dev[i].write_hint;
-			sh->dev[i].write_hint = RWF_WRITE_LIFE_NOT_SET;
+			sh->dev[i].write_hint = RWH_WRITE_LIFE_NOT_SET;
 			/*
 			 * If this is discard request, set bi_vcnt 0. We don't
 			 * want to confuse SCSI because SCSI will replace payload
Signature · 1 line
2.1.4
#3 lore raw

PATCH v3 3/3 drivers/md/raid5-ppl.c: use the new spelling of RWH_WRITE_LIFE_NOT_SET

In reply to Eugene Syromiatnikov

As it is consistent with prefixes of other write life time hints.

---
 drivers/md/raid5-ppl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/raid5-ppl.c +1 -1
index 18a4064..cab5b13 100644
@@ -1404,7 +1404,7 @@ int ppl_init_log(struct r5conf *conf)
 	atomic64_set(&ppl_conf->seq, 0);
 	INIT_LIST_HEAD(&ppl_conf->no_mem_stripes);
 	spin_lock_init(&ppl_conf->no_mem_stripes_lock);
-	ppl_conf->write_hint = RWF_WRITE_LIFE_NOT_SET;
+	ppl_conf->write_hint = RWH_WRITE_LIFE_NOT_SET;
 
 	if (!mddev->external) {
 		ppl_conf->signature = ~crc32c_le(~0, mddev->uuid, sizeof(mddev->uuid));
Signature · 1 line
2.1.4
Applied
#4 lore raw
In reply to Eugene Syromiatnikov
Quoted 13 lines · Eugene Syromiatnikov

Hello.

This is a small fix of a typo (or, more specifically, some remnant of the old patch version spelling) in RWH_WRITE_LIFE_NOT_SET constant, which is named as RWF_WRITE_LIFE_NOT_SET currently. Since the name with "H" is used in man page and everywhere else, it's probably worth to make the name used in the fcntl.h UAPI header in line with it. The two follow-up patches update usage sites of this constant in kernel to use the new spelling.

The old name is retained as it is part of UAPI now.

Quoted 7 lines

Changes since v2[1]:
* Updated RWF_WRITE_LIFE_NOT_SET constant usage
in drivers/md/raid5-ppl.c:ppl_init_log().

Changes since v1[2]:
* Changed format of the commit ID in the commit message of the first patch.
* Removed bogus Signed-off-by that snuck into the resend of the series.

Applied to md-next.

Thanks,
Song

#5 lore raw
Quoted 18 lines · Song Liu
Quoted 17 lines · Eugene Syromiatnikov

Hello.

This is a small fix of a typo (or, more specifically, some remnant of the old patch version spelling) in RWH_WRITE_LIFE_NOT_SET constant, which is named as RWF_WRITE_LIFE_NOT_SET currently. Since the name with "H" is used in man page and everywhere else, it's probably worth to make the name used in the fcntl.h UAPI header in line with it. The two follow-up patches update usage sites of this constant in kernel to use the new spelling.

The old name is retained as it is part of UAPI now.

Changes since v2[1]:
* Updated RWF_WRITE_LIFE_NOT_SET constant usage

    in drivers/md/raid5-ppl.c:ppl_init_log().
Quoted 5 lines
Quoted 3 lines

Changes since v1[2]:
* Changed format of the commit ID in the commit message of the first patch.
* Removed bogus Signed-off-by that snuck into the resend of the series.

Applied to md-next.

I think the core fs change should core in through a core tree, then the md bits can go in at will after that.

Signature · 1 line
Jens Axboe
#6 lore raw
Quoted 20 lines · Jens Axboe
Quoted 18 lines · Song Liu
Quoted 17 lines · Eugene Syromiatnikov

Hello.

This is a small fix of a typo (or, more specifically, some remnant of the old patch version spelling) in RWH_WRITE_LIFE_NOT_SET constant, which is named as RWF_WRITE_LIFE_NOT_SET currently. Since the name with "H" is used in man page and everywhere else, it's probably worth to make the name used in the fcntl.h UAPI header in line with it. The two follow-up patches update usage sites of this constant in kernel to use the new spelling.

The old name is retained as it is part of UAPI now.

Changes since v2[1]:
* Updated RWF_WRITE_LIFE_NOT_SET constant usage

    in drivers/md/raid5-ppl.c:ppl_init_log().
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Changes since v1[2]:
* Changed format of the commit ID in the commit message of the first patch.
* Removed bogus Signed-off-by that snuck into the resend of the series.

Applied to md-next.

I think the core fs change should core in through a core tree, then the md bits can go in at will after that.

Good point. I guess I will wait until it shows up in for-5.5/block?

Song

Acked-by
#7 lore raw

Hi Jeff and J. Bruce,

Quoted 22 lines · Song Liu
Quoted 20 lines · Jens Axboe
Quoted 18 lines · Song Liu
Quoted 17 lines · Eugene Syromiatnikov

Hello.

This is a small fix of a typo (or, more specifically, some remnant of the old patch version spelling) in RWH_WRITE_LIFE_NOT_SET constant, which is named as RWF_WRITE_LIFE_NOT_SET currently. Since the name with "H" is used in man page and everywhere else, it's probably worth to make the name used in the fcntl.h UAPI header in line with it. The two follow-up patches update usage sites of this constant in kernel to use the new spelling.

The old name is retained as it is part of UAPI now.

Changes since v2[1]:
* Updated RWF_WRITE_LIFE_NOT_SET constant usage

    in drivers/md/raid5-ppl.c:ppl_init_log().
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Changes since v1[2]:
* Changed format of the commit ID in the commit message of the first patch.
* Removed bogus Signed-off-by that snuck into the resend of the series.

Applied to md-next.

I think the core fs change should core in through a core tree, then the md bits can go in at will after that.

As Jens suggested, we should route core fs patches through core tree. Could you please apply these patches? Since the change is small, probably you can also apply md patches?

Thanks,
Song

PS: for the series:

Applied
#8 lore raw
Quoted 38 lines · Song Liu

Hi Jeff and J. Bruce,

Quoted 22 lines · Song Liu
Quoted 20 lines · Jens Axboe
Quoted 18 lines · Song Liu
Quoted 17 lines · Eugene Syromiatnikov

Hello.

This is a small fix of a typo (or, more specifically, some remnant of the old patch version spelling) in RWH_WRITE_LIFE_NOT_SET constant, which is named as RWF_WRITE_LIFE_NOT_SET currently. Since the name with "H" is used in man page and everywhere else, it's probably worth to make the name used in the fcntl.h UAPI header in line with it. The two follow-up patches update usage sites of this constant in kernel to use the new spelling.

The old name is retained as it is part of UAPI now.

Changes since v2[1]:
* Updated RWF_WRITE_LIFE_NOT_SET constant usage

     in drivers/md/raid5-ppl.c:ppl_init_log().
Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Changes since v1[2]:
* Changed format of the commit ID in the commit message of the first patch.
* Removed bogus Signed-off-by that snuck into the resend of the series.

Applied to md-next.

I think the core fs change should core in through a core tree, then the md bits can go in at will after that.

As Jens suggested, we should route core fs patches through core tree. Could you please apply these patches? Since the change is small, probably you can also apply md patches?

Quoted 6 lines

Thanks,
Song

PS: for the series:

I applied 1/3 to the for-5.5/block core branch.

Signature · 1 line
Jens Axboe