All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size
@ 2017-01-12  2:42 Damien Le Moal
  2017-01-12  2:42 ` [PATCH 1/2] block: " Damien Le Moal
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Damien Le Moal @ 2017-01-12  2:42 UTC (permalink / raw)
  To: Jens Axboe, Jaegeuk Kim
  Cc: linux-block, Shaun Tancheff, Hannes Reinecke, Damien Le Moal

All block device data fields and functions returning a number of 512B
sectors are by convention named xxx_sectors while names in the form
of xxx_size are generally used for a number of bytes. The blk_queue_zone_size
and bdev_zone_size functions were not following this convention so rename
them.

This is a style fix and no functional change is introduced by this patch.

Damien Le Moal (2):
  block: Rename blk_queue_zone_size and bdev_zone_size
  f2fs: Rename bdev_zone_size to bdev_zone_sectors

 block/blk-zoned.c         |  4 ++--
 block/partition-generic.c | 14 +++++++-------
 fs/f2fs/segment.c         |  4 ++--
 fs/f2fs/super.c           |  6 +++---
 include/linux/blkdev.h    |  6 +++---
 5 files changed, 17 insertions(+), 17 deletions(-)

-- 
2.9.3

Western Digital Corporation (and its subsidiaries) E-mail Confidentiality Notice & Disclaimer:

This e-mail and any files transmitted with it may contain confidential or legally privileged information of WDC and/or its affiliates, and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited. If you have received this e-mail in error, please notify the sender immediately and delete the e-mail in its entirety from your system.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/2] block: Rename blk_queue_zone_size and bdev_zone_size
  2017-01-12  2:42 [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size Damien Le Moal
@ 2017-01-12  2:42 ` Damien Le Moal
  2017-01-12  2:42 ` [PATCH 2/2] f2fs: Rename bdev_zone_size to bdev_zone_sectors Damien Le Moal
  2017-01-12  3:52 ` [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size Jens Axboe
  2 siblings, 0 replies; 9+ messages in thread
From: Damien Le Moal @ 2017-01-12  2:42 UTC (permalink / raw)
  To: Jens Axboe, Jaegeuk Kim
  Cc: linux-block, Shaun Tancheff, Hannes Reinecke, Damien Le Moal

All block device data fields and functions returning a number of 512B
sectors are by convention named xxx_sectors while names in the form
xxx_size are generally used for a number of bytes. The blk_queue_zone_size
and bdev_zone_size functions were not following this convention so rename
them.

No functional change is introduced by this patch.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 block/blk-zoned.c         |  4 ++--
 block/partition-generic.c | 14 +++++++-------
 include/linux/blkdev.h    |  6 +++---
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 472211f..3bd15d8 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -16,7 +16,7 @@
 static inline sector_t blk_zone_start(struct request_queue *q,
 				      sector_t sector)
 {
-	sector_t zone_mask = blk_queue_zone_size(q) - 1;
+	sector_t zone_mask = blk_queue_zone_sectors(q) - 1;
 
 	return sector & ~zone_mask;
 }
@@ -222,7 +222,7 @@ int blkdev_reset_zones(struct block_device *bdev,
 		return -EINVAL;
 
 	/* Check alignment (handle eventual smaller last zone) */
-	zone_sectors = blk_queue_zone_size(q);
+	zone_sectors = blk_queue_zone_sectors(q);
 	if (sector & (zone_sectors - 1))
 		return -EINVAL;
 
diff --git a/block/partition-generic.c b/block/partition-generic.c
index d7beb6b..7afb990 100644
--- a/block/partition-generic.c
+++ b/block/partition-generic.c
@@ -434,7 +434,7 @@ static bool part_zone_aligned(struct gendisk *disk,
 			      struct block_device *bdev,
 			      sector_t from, sector_t size)
 {
-	unsigned int zone_size = bdev_zone_size(bdev);
+	unsigned int zone_sectors = bdev_zone_sectors(bdev);
 
 	/*
 	 * If this function is called, then the disk is a zoned block device
@@ -446,7 +446,7 @@ static bool part_zone_aligned(struct gendisk *disk,
 	 * regular block devices (no zone operation) and their zone size will
 	 * be reported as 0. Allow this case.
 	 */
-	if (!zone_size)
+	if (!zone_sectors)
 		return true;
 
 	/*
@@ -455,24 +455,24 @@ static bool part_zone_aligned(struct gendisk *disk,
 	 * use it. Check the zone size too: it should be a power of 2 number
 	 * of sectors.
 	 */
-	if (WARN_ON_ONCE(!is_power_of_2(zone_size))) {
+	if (WARN_ON_ONCE(!is_power_of_2(zone_sectors))) {
 		u32 rem;
 
-		div_u64_rem(from, zone_size, &rem);
+		div_u64_rem(from, zone_sectors, &rem);
 		if (rem)
 			return false;
 		if ((from + size) < get_capacity(disk)) {
-			div_u64_rem(size, zone_size, &rem);
+			div_u64_rem(size, zone_sectors, &rem);
 			if (rem)
 				return false;
 		}
 
 	} else {
 
-		if (from & (zone_size - 1))
+		if (from & (zone_sectors - 1))
 			return false;
 		if ((from + size) < get_capacity(disk) &&
-		    (size & (zone_size - 1)))
+		    (size & (zone_sectors - 1)))
 			return false;
 
 	}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 8369564..ff3d774 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -739,7 +739,7 @@ static inline bool blk_queue_is_zoned(struct request_queue *q)
 	}
 }
 
-static inline unsigned int blk_queue_zone_size(struct request_queue *q)
+static inline unsigned int blk_queue_zone_sectors(struct request_queue *q)
 {
 	return blk_queue_is_zoned(q) ? q->limits.chunk_sectors : 0;
 }
@@ -1536,12 +1536,12 @@ static inline bool bdev_is_zoned(struct block_device *bdev)
 	return false;
 }
 
-static inline unsigned int bdev_zone_size(struct block_device *bdev)
+static inline unsigned int bdev_zone_sectors(struct block_device *bdev)
 {
 	struct request_queue *q = bdev_get_queue(bdev);
 
 	if (q)
-		return blk_queue_zone_size(q);
+		return blk_queue_zone_sectors(q);
 
 	return 0;
 }
-- 
2.9.3

Western Digital Corporation (and its subsidiaries) E-mail Confidentiality Notice & Disclaimer:

This e-mail and any files transmitted with it may contain confidential or legally privileged information of WDC and/or its affiliates, and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited. If you have received this e-mail in error, please notify the sender immediately and delete the e-mail in its entirety from your system.

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] f2fs: Rename bdev_zone_size to bdev_zone_sectors
  2017-01-12  2:42 [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size Damien Le Moal
  2017-01-12  2:42 ` [PATCH 1/2] block: " Damien Le Moal
@ 2017-01-12  2:42 ` Damien Le Moal
  2017-01-12  3:52 ` [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size Jens Axboe
  2 siblings, 0 replies; 9+ messages in thread
From: Damien Le Moal @ 2017-01-12  2:42 UTC (permalink / raw)
  To: Jens Axboe, Jaegeuk Kim
  Cc: linux-block, Shaun Tancheff, Hannes Reinecke, Damien Le Moal

No functional change is introduced by this patch.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 fs/f2fs/segment.c | 4 ++--
 fs/f2fs/super.c   | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 0738f48..0d88024 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -713,8 +713,8 @@ static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi,
 	}
 	sector = SECTOR_FROM_BLOCK(blkstart);
 
-	if (sector & (bdev_zone_size(bdev) - 1) ||
-				nr_sects != bdev_zone_size(bdev)) {
+	if (sector & (bdev_zone_sectors(bdev) - 1) ||
+	    nr_sects != bdev_zone_sectors(bdev)) {
 		f2fs_msg(sbi->sb, KERN_INFO,
 			"(%d) %s: Unaligned discard attempted (block %x + %x)",
 			devi, sbi->s_ndevs ? FDEV(devi).path: "",
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 702638e..46fd30d 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1553,16 +1553,16 @@ static int init_blkz_info(struct f2fs_sb_info *sbi, int devi)
 		return 0;
 
 	if (sbi->blocks_per_blkz && sbi->blocks_per_blkz !=
-				SECTOR_TO_BLOCK(bdev_zone_size(bdev)))
+				SECTOR_TO_BLOCK(bdev_zone_sectors(bdev)))
 		return -EINVAL;
-	sbi->blocks_per_blkz = SECTOR_TO_BLOCK(bdev_zone_size(bdev));
+	sbi->blocks_per_blkz = SECTOR_TO_BLOCK(bdev_zone_sectors(bdev));
 	if (sbi->log_blocks_per_blkz && sbi->log_blocks_per_blkz !=
 				__ilog2_u32(sbi->blocks_per_blkz))
 		return -EINVAL;
 	sbi->log_blocks_per_blkz = __ilog2_u32(sbi->blocks_per_blkz);
 	FDEV(devi).nr_blkz = SECTOR_TO_BLOCK(nr_sectors) >>
 					sbi->log_blocks_per_blkz;
-	if (nr_sectors & (bdev_zone_size(bdev) - 1))
+	if (nr_sectors & (bdev_zone_sectors(bdev) - 1))
 		FDEV(devi).nr_blkz++;
 
 	FDEV(devi).blkz_type = kmalloc(FDEV(devi).nr_blkz, GFP_KERNEL);
-- 
2.9.3

Western Digital Corporation (and its subsidiaries) E-mail Confidentiality Notice & Disclaimer:

This e-mail and any files transmitted with it may contain confidential or legally privileged information of WDC and/or its affiliates, and are intended solely for the use of the individual or entity to which they are addressed. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited. If you have received this e-mail in error, please notify the sender immediately and delete the e-mail in its entirety from your system.

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size
  2017-01-12  2:42 [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size Damien Le Moal
  2017-01-12  2:42 ` [PATCH 1/2] block: " Damien Le Moal
  2017-01-12  2:42 ` [PATCH 2/2] f2fs: Rename bdev_zone_size to bdev_zone_sectors Damien Le Moal
@ 2017-01-12  3:52 ` Jens Axboe
  2017-01-12  4:36   ` Damien Le Moal
  2 siblings, 1 reply; 9+ messages in thread
From: Jens Axboe @ 2017-01-12  3:52 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: Jaegeuk Kim, linux-block, Shaun Tancheff, Hannes Reinecke

On Thu, Jan 12 2017, Damien Le Moal wrote:
> All block device data fields and functions returning a number of 512B
> sectors are by convention named xxx_sectors while names in the form
> of xxx_size are generally used for a number of bytes. The blk_queue_zone_size
> and bdev_zone_size functions were not following this convention so rename
> them.
> 
> This is a style fix and no functional change is introduced by this patch.

I agree, this cleans it up. Applied.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size
  2017-01-12  3:52 ` [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size Jens Axboe
@ 2017-01-12  4:36   ` Damien Le Moal
  2017-01-12  4:38     ` Jens Axboe
  0 siblings, 1 reply; 9+ messages in thread
From: Damien Le Moal @ 2017-01-12  4:36 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Jaegeuk Kim, linux-block, Shaun Tancheff, Hannes Reinecke

Jens,

On 1/12/17 12:52, Jens Axboe wrote:
> On Thu, Jan 12 2017, Damien Le Moal wrote:
>> All block device data fields and functions returning a number of 512B
>> sectors are by convention named xxx_sectors while names in the form
>> of xxx_size are generally used for a number of bytes. The blk_queue_zone=
_size
>> and bdev_zone_size functions were not following this convention so rename
>> them.
>>
>> This is a style fix and no functional change is introduced by this patch.
> =

> I agree, this cleans it up. Applied.

Thank you. I saw that you applied to for-4.11/block. Could we get these
in applied to 4.10-rc so that the zoned block device API is cleaner from
the first stable release of that API?

Best regards.

-- =

Damien Le Moal, Ph.D.
Sr. Manager, System Software Research Group,
Western Digital Corporation
Damien.LeMoal@wdc.com
(+81) 0466-98-3593 (ext. 513593)
1 kirihara-cho, Fujisawa,
Kanagawa, 252-0888 Japan
www.wdc.com, www.hgst.com
Western Digital Corporation (and its subsidiaries) E-mail Confidentiality N=
otice & Disclaimer:

This e-mail and any files transmitted with it may contain confidential or l=
egally privileged information of WDC and/or its affiliates, and are intende=
d solely for the use of the individual or entity to which they are addresse=
d. If you are not the intended recipient, any disclosure, copying, distribu=
tion or any action taken or omitted to be taken in reliance on it, is prohi=
bited. If you have received this e-mail in error, please notify the sender =
immediately and delete the e-mail in its entirety from your system.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size
  2017-01-12  4:36   ` Damien Le Moal
@ 2017-01-12  4:38     ` Jens Axboe
  2017-01-12  4:43       ` Damien Le Moal
  2017-01-12 20:49       ` Jens Axboe
  0 siblings, 2 replies; 9+ messages in thread
From: Jens Axboe @ 2017-01-12  4:38 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: Jaegeuk Kim, linux-block, Shaun Tancheff, Hannes Reinecke

On 01/11/2017 09:36 PM, Damien Le Moal wrote:
> Jens,
> 
> On 1/12/17 12:52, Jens Axboe wrote:
>> On Thu, Jan 12 2017, Damien Le Moal wrote:
>>> All block device data fields and functions returning a number of 512B
>>> sectors are by convention named xxx_sectors while names in the form
>>> of xxx_size are generally used for a number of bytes. The blk_queue_zone_size
>>> and bdev_zone_size functions were not following this convention so rename
>>> them.
>>>
>>> This is a style fix and no functional change is introduced by this patch.
>>
>> I agree, this cleans it up. Applied.
> 
> Thank you. I saw that you applied to for-4.11/block. Could we get these
> in applied to 4.10-rc so that the zoned block device API is cleaner from
> the first stable release of that API?

Sure, I did consider that as well. Since I just pushed out the 4.11
branch, I'll rebase and yank these into the 4.10 branch instead.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size
  2017-01-12  4:38     ` Jens Axboe
@ 2017-01-12  4:43       ` Damien Le Moal
  2017-01-12 20:49       ` Jens Axboe
  1 sibling, 0 replies; 9+ messages in thread
From: Damien Le Moal @ 2017-01-12  4:43 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Jaegeuk Kim, linux-block, Shaun Tancheff, Hannes Reinecke


On 1/12/17 13:38, Jens Axboe wrote:
> On 01/11/2017 09:36 PM, Damien Le Moal wrote:
>> Jens,
>>
>> On 1/12/17 12:52, Jens Axboe wrote:
>>> On Thu, Jan 12 2017, Damien Le Moal wrote:
>>>> All block device data fields and functions returning a number of 512B
>>>> sectors are by convention named xxx_sectors while names in the form
>>>> of xxx_size are generally used for a number of bytes. The blk_queue_zo=
ne_size
>>>> and bdev_zone_size functions were not following this convention so ren=
ame
>>>> them.
>>>>
>>>> This is a style fix and no functional change is introduced by this pat=
ch.
>>>
>>> I agree, this cleans it up. Applied.
>>
>> Thank you. I saw that you applied to for-4.11/block. Could we get these
>> in applied to 4.10-rc so that the zoned block device API is cleaner from
>> the first stable release of that API?
> =

> Sure, I did consider that as well. Since I just pushed out the 4.11
> branch, I'll rebase and yank these into the 4.10 branch instead.

Thanks !

-- =

Damien Le Moal, Ph.D.
Sr. Manager, System Software Research Group,
Western Digital Corporation
Damien.LeMoal@wdc.com
(+81) 0466-98-3593 (ext. 513593)
1 kirihara-cho, Fujisawa,
Kanagawa, 252-0888 Japan
www.wdc.com, www.hgst.com
Western Digital Corporation (and its subsidiaries) E-mail Confidentiality N=
otice & Disclaimer:

This e-mail and any files transmitted with it may contain confidential or l=
egally privileged information of WDC and/or its affiliates, and are intende=
d solely for the use of the individual or entity to which they are addresse=
d. If you are not the intended recipient, any disclosure, copying, distribu=
tion or any action taken or omitted to be taken in reliance on it, is prohi=
bited. If you have received this e-mail in error, please notify the sender =
immediately and delete the e-mail in its entirety from your system.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size
  2017-01-12  4:38     ` Jens Axboe
  2017-01-12  4:43       ` Damien Le Moal
@ 2017-01-12 20:49       ` Jens Axboe
  2017-01-13  0:10         ` Damien Le Moal
  1 sibling, 1 reply; 9+ messages in thread
From: Jens Axboe @ 2017-01-12 20:49 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: Jaegeuk Kim, linux-block, Shaun Tancheff, Hannes Reinecke

On 01/11/2017 09:38 PM, Jens Axboe wrote:
> On 01/11/2017 09:36 PM, Damien Le Moal wrote:
>> Jens,
>>
>> On 1/12/17 12:52, Jens Axboe wrote:
>>> On Thu, Jan 12 2017, Damien Le Moal wrote:
>>>> All block device data fields and functions returning a number of 512B
>>>> sectors are by convention named xxx_sectors while names in the form
>>>> of xxx_size are generally used for a number of bytes. The blk_queue_zone_size
>>>> and bdev_zone_size functions were not following this convention so rename
>>>> them.
>>>>
>>>> This is a style fix and no functional change is introduced by this patch.
>>>
>>> I agree, this cleans it up. Applied.
>>
>> Thank you. I saw that you applied to for-4.11/block. Could we get these
>> in applied to 4.10-rc so that the zoned block device API is cleaner from
>> the first stable release of that API?
> 
> Sure, I did consider that as well. Since I just pushed out the 4.11
> branch, I'll rebase and yank these into the 4.10 branch instead.

Just in case you missed it, I had to fold your two patches. Looking at
it again, what is going on? You rename a function, and then patch #2
renames the use of that function in a different spot? How did that ever
pass your testing? For something intended for the current series, please
be more careful than that, that's just sloppy.

-- 
Jens Axboe

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size
  2017-01-12 20:49       ` Jens Axboe
@ 2017-01-13  0:10         ` Damien Le Moal
  0 siblings, 0 replies; 9+ messages in thread
From: Damien Le Moal @ 2017-01-13  0:10 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Jaegeuk Kim, linux-block, Shaun Tancheff, Hannes Reinecke


Jens,

On 1/13/17 05:49, Jens Axboe wrote:
> Just in case you missed it, I had to fold your two patches. Looking at
> it again, what is going on? You rename a function, and then patch #2
> renames the use of that function in a different spot? How did that ever
> pass your testing? For something intended for the current series, please
> be more careful than that, that's just sloppy.

I created two patches, one for each component/maintainer involved:
block/you and f2fs/Jaegeuk. That was indeed a very stupid idea as the 2
patches must always go together (and that is how I tested). A single
patch was the right way to do things. My apologies for this mistake and
thank you very much for fixing it. I will be more careful in the future.

Best regards.

-- =

Damien Le Moal, Ph.D.
Sr. Manager, System Software Research Group,
Western Digital Corporation
Damien.LeMoal@wdc.com
(+81) 0466-98-3593 (ext. 513593)
1 kirihara-cho, Fujisawa,
Kanagawa, 252-0888 Japan
www.wdc.com, www.hgst.com
Western Digital Corporation (and its subsidiaries) E-mail Confidentiality N=
otice & Disclaimer:

This e-mail and any files transmitted with it may contain confidential or l=
egally privileged information of WDC and/or its affiliates, and are intende=
d solely for the use of the individual or entity to which they are addresse=
d. If you are not the intended recipient, any disclosure, copying, distribu=
tion or any action taken or omitted to be taken in reliance on it, is prohi=
bited. If you have received this e-mail in error, please notify the sender =
immediately and delete the e-mail in its entirety from your system.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-01-13  0:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-12  2:42 [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size Damien Le Moal
2017-01-12  2:42 ` [PATCH 1/2] block: " Damien Le Moal
2017-01-12  2:42 ` [PATCH 2/2] f2fs: Rename bdev_zone_size to bdev_zone_sectors Damien Le Moal
2017-01-12  3:52 ` [PATCH 0/2] Rename blk_queue_zone_size and bdev_zone_size Jens Axboe
2017-01-12  4:36   ` Damien Le Moal
2017-01-12  4:38     ` Jens Axboe
2017-01-12  4:43       ` Damien Le Moal
2017-01-12 20:49       ` Jens Axboe
2017-01-13  0:10         ` Damien Le Moal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.