diff mbox series

[v2] btrfs:zoned: fix comment description for sb_write_pointer logic

Message ID 20220517184532.76400-1-p.raghav@samsung.com (mailing list archive)
State New, archived
Headers show
Series [v2] btrfs:zoned: fix comment description for sb_write_pointer logic | expand

Commit Message

Pankaj Raghav May 17, 2022, 6:45 p.m. UTC
- Empty[0] && In use[1] should be an invalid state instead of returning
  zone 0 wp
- Empty[0] && Full[1] should be returning zone 0 wp instead of zone 1 wp
- In use[0] && Empty[1] should be returning zone 0 wp instead of being an
  invalid state
- In use[0] && Full[1] should be returning zone 0 wp instead of returning
  zone 1 wp
- Full[0] && Empty[1] should be returning zone 1 wp instead of returning
  zone 0 wp
- Full[0] && In use[1] should be returning zone 1 wp instead of returning
  zone 0 wp

Fix the comments to represent the actual logic used for sb_write_pointer
as indicated above.

Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
Changes since v1:
- Explain the changes in commit log(David)

 fs/btrfs/zoned.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Pankaj Raghav May 20, 2022, 9:49 a.m. UTC | #1
ping....
On 5/17/22 20:45, Pankaj Raghav wrote:
> - Empty[0] && In use[1] should be an invalid state instead of returning
>   zone 0 wp
> - Empty[0] && Full[1] should be returning zone 0 wp instead of zone 1 wp
> - In use[0] && Empty[1] should be returning zone 0 wp instead of being an
>   invalid state
> - In use[0] && Full[1] should be returning zone 0 wp instead of returning
>   zone 1 wp
> - Full[0] && Empty[1] should be returning zone 1 wp instead of returning
>   zone 0 wp
> - Full[0] && In use[1] should be returning zone 1 wp instead of returning
>   zone 0 wp
> 
> Fix the comments to represent the actual logic used for sb_write_pointer
> as indicated above.
> 
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
> Changes since v1:
> - Explain the changes in commit log(David)
> 
>  fs/btrfs/zoned.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
> index 057babaa3e05..c09b1b0208c4 100644
> --- a/fs/btrfs/zoned.c
> +++ b/fs/btrfs/zoned.c
> @@ -94,9 +94,9 @@ static int sb_write_pointer(struct block_device *bdev, struct blk_zone *zones,
>  	 * Possible states of log buffer zones
>  	 *
>  	 *           Empty[0]  In use[0]  Full[0]
> -	 * Empty[1]         *          x        0
> -	 * In use[1]        0          x        0
> -	 * Full[1]          1          1        C
> +	 * Empty[1]         *          0        1
> +	 * In use[1]        x          x        1
> +	 * Full[1]          0          0        C
>  	 *
>  	 * Log position:
>  	 *   *: Special case, no superblock is written
David Sterba May 25, 2022, 2:41 p.m. UTC | #2
On Tue, May 17, 2022 at 08:45:32PM +0200, Pankaj Raghav wrote:
> - Empty[0] && In use[1] should be an invalid state instead of returning
>   zone 0 wp
> - Empty[0] && Full[1] should be returning zone 0 wp instead of zone 1 wp
> - In use[0] && Empty[1] should be returning zone 0 wp instead of being an
>   invalid state
> - In use[0] && Full[1] should be returning zone 0 wp instead of returning
>   zone 1 wp
> - Full[0] && Empty[1] should be returning zone 1 wp instead of returning
>   zone 0 wp
> - Full[0] && In use[1] should be returning zone 1 wp instead of returning
>   zone 0 wp
> 
> Fix the comments to represent the actual logic used for sb_write_pointer
> as indicated above.
> 
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Added to misc-next, thanks.
diff mbox series

Patch

diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 057babaa3e05..c09b1b0208c4 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -94,9 +94,9 @@  static int sb_write_pointer(struct block_device *bdev, struct blk_zone *zones,
 	 * Possible states of log buffer zones
 	 *
 	 *           Empty[0]  In use[0]  Full[0]
-	 * Empty[1]         *          x        0
-	 * In use[1]        0          x        0
-	 * Full[1]          1          1        C
+	 * Empty[1]         *          0        1
+	 * In use[1]        x          x        1
+	 * Full[1]          0          0        C
 	 *
 	 * Log position:
 	 *   *: Special case, no superblock is written