* [PATCH v2 00/14] Make btrfs W=1 clean
@ 2021-01-20 10:25 Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 01/14] btrfs: Document modified paramater of add_extent_mapping Nikolay Borisov
` (13 more replies)
0 siblings, 14 replies; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
Here's V2 of the patchset, I have incorporated all the feedback - namely spellin g
fixes as well as David's suggestions for documenting fs_info as well as aligning
description of members. In addition to that I added the last patch which copies
the W=1 checks plus the cmd_checkdoc definition to btrfs' Makefile. Effectively,
this series not only makes btrfs W=1 clean but also unconditionally enables the
checks for all subdirs of fs/btrfs/
Nikolay Borisov (14):
btrfs: Document modified paramater of add_extent_mapping
btrfs: Fix parameter description of btrfs_add_extent_mapping
btrfs: Fix function description format
btrfs: Fix parameter description in delayed-ref.c functions
btrfs: Improve parameter description for __btrfs_write_out_cache
btrfs: Document now parameter of peek_discard_list
btrfs: Document fs_info in btrfs_rmap_block
btrfs: Fix description format of fs_info parameter of
btrfs_wait_on_delayed_iputs
btrfs: Document btrfs_check_shared parameters
btrfs: Fix parameter description of
btrfs_inode_rsv_release/btrfs_delalloc_release_space
btrfs: Fix parameter description in space-info.c
btrfs: Fix parameter description for functions in extent_io.c
lib/zstd: Convert constants to defines
btrfs: Enable W=1 checks for btrfs
fs/btrfs/Makefile | 17 +++++++++++++++++
fs/btrfs/backref.c | 6 ++++++
fs/btrfs/block-group.c | 1 +
fs/btrfs/delalloc-space.c | 7 ++++---
fs/btrfs/delayed-ref.c | 16 +++++++++-------
fs/btrfs/discard.c | 3 ++-
fs/btrfs/extent_io.c | 34 +++++++++++++++++-----------------
fs/btrfs/extent_map.c | 12 +++++++-----
fs/btrfs/file-item.c | 22 ++++++++++++++--------
fs/btrfs/free-space-cache.c | 10 ++++++----
fs/btrfs/inode.c | 2 +-
fs/btrfs/space-info.c | 37 ++++++++++++++++++-------------------
include/linux/zstd.h | 8 ++++----
13 files changed, 106 insertions(+), 69 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v2 01/14] btrfs: Document modified paramater of add_extent_mapping
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
@ 2021-01-20 10:25 ` Nikolay Borisov
2021-01-20 15:54 ` Josef Bacik
2021-01-20 10:25 ` [PATCH v2 02/14] btrfs: Fix parameter description of btrfs_add_extent_mapping Nikolay Borisov
` (12 subsequent siblings)
13 siblings, 1 reply; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
Fixes fs/btrfs/extent_map.c:399: warning: Function parameter or member
'modified' not described in 'add_extent_mapping'
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/extent_map.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index bd6229fb2b6f..aa1ff6f2ade9 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -388,6 +388,8 @@ static void extent_map_device_clear_bits(struct extent_map *em, unsigned bits)
* add_extent_mapping - add new extent map to the extent tree
* @tree: tree to insert new map in
* @em: map to insert
+ * @modified: bool indicating whether the given @em should be added to the
+ * modified list, which indicates the extent needs to be logged
*
* Insert @em into @tree or perform a simple forward/backward merge with
* existing mappings. The extent_map struct passed in will be inserted
--
2.25.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 02/14] btrfs: Fix parameter description of btrfs_add_extent_mapping
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 01/14] btrfs: Document modified paramater of add_extent_mapping Nikolay Borisov
@ 2021-01-20 10:25 ` Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 03/14] btrfs: Fix function description format Nikolay Borisov
` (11 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
This fixes the following compiler warnings:
fs/btrfs/extent_map.c:601: warning: Function parameter or member 'fs_info' not described in 'btrfs_add_extent_mapping'
fs/btrfs/extent_map.c:601: warning: Function parameter or member 'em_tree' not described in 'btrfs_add_extent_mapping'
fs/btrfs/extent_map.c:601: warning: Function parameter or member 'em_in' not described in 'btrfs_add_extent_mapping'
fs/btrfs/extent_map.c:601: warning: Function parameter or member 'start' not described in 'btrfs_add_extent_mapping'
fs/btrfs/extent_map.c:601: warning: Function parameter or member 'len' not described in 'btrfs_add_extent_mapping'
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/extent_map.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index aa1ff6f2ade9..90ae3c31e7fb 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -577,11 +577,11 @@ static noinline int merge_extent_mapping(struct extent_map_tree *em_tree,
/**
* btrfs_add_extent_mapping - add extent mapping into em_tree
- * @fs_info - used for tracepoint
- * @em_tree - the extent tree into which we want to insert the extent mapping
- * @em_in - extent we are inserting
- * @start - start of the logical range btrfs_get_extent() is requesting
- * @len - length of the logical range btrfs_get_extent() is requesting
+ * @fs_info: used for tracepoint
+ * @em_tree: the extent tree into which we want to insert the extent mapping
+ * @em_in: extent we are inserting
+ * @start: start of the logical range btrfs_get_extent() is requesting
+ * @len: length of the logical range btrfs_get_extent() is requesting
*
* Note that @em_in's range may be different from [start, start+len),
* but they must be overlapped.
--
2.25.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 03/14] btrfs: Fix function description format
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 01/14] btrfs: Document modified paramater of add_extent_mapping Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 02/14] btrfs: Fix parameter description of btrfs_add_extent_mapping Nikolay Borisov
@ 2021-01-20 10:25 ` Nikolay Borisov
2021-01-21 16:23 ` David Sterba
2021-01-20 10:25 ` [PATCH v2 04/14] btrfs: Fix parameter description in delayed-ref.c functions Nikolay Borisov
` (10 subsequent siblings)
13 siblings, 1 reply; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
This fixes following W=1 warnings:
fs/btrfs/file-item.c:27: warning: Cannot understand * @inode: the inode we want to update the disk_i_size for
on line 27 - I thought it was a doc line
fs/btrfs/file-item.c:65: warning: Cannot understand * @inode - the inode we're modifying
on line 65 - I thought it was a doc line
fs/btrfs/file-item.c:91: warning: Cannot understand * @inode - the inode we're modifying
on line 91 - I thought it was a doc line
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/file-item.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index 6ccfc019ad90..fedb200c39ca 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -24,8 +24,10 @@
PAGE_SIZE))
/**
- * @inode - the inode we want to update the disk_i_size for
- * @new_i_size - the i_size we want to set to, 0 if we use i_size
+ * btrfs_inode_safe_disk_i_size_write
+ *
+ * @inode: the inode we want to update the disk_i_size for
+ * @new_i_size: the i_size we want to set to, 0 if we use i_size
*
* With NO_HOLES set this simply sets the disk_is_size to whatever i_size_read()
* returns as it is perfectly fine with a file that has holes without hole file
@@ -62,9 +64,11 @@ void btrfs_inode_safe_disk_i_size_write(struct btrfs_inode *inode, u64 new_i_siz
}
/**
- * @inode - the inode we're modifying
- * @start - the start file offset of the file extent we've inserted
- * @len - the logical length of the file extent item
+ * btrfs_inode_set_file_extent_range
+ *
+ * @inode: the inode we're modifying
+ * @start: the start file offset of the file extent we've inserted
+ * @len: the logical length of the file extent item
*
* Call when we are inserting a new file extent where there was none before.
* Does not need to call this in the case where we're replacing an existing file
@@ -88,9 +92,11 @@ int btrfs_inode_set_file_extent_range(struct btrfs_inode *inode, u64 start,
}
/**
- * @inode - the inode we're modifying
- * @start - the start file offset of the file extent we've inserted
- * @len - the logical length of the file extent item
+ * btrfs_inode_clear_file_extent_range
+ *
+ * @inode: the inode we're modifying
+ * @start: the start file offset of the file extent we've inserted
+ * @len: the logical length of the file extent item
*
* Called when we drop a file extent, for example when we truncate. Doesn't
* need to be called for cases where we're replacing a file extent, like when
--
2.25.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 04/14] btrfs: Fix parameter description in delayed-ref.c functions
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
` (2 preceding siblings ...)
2021-01-20 10:25 ` [PATCH v2 03/14] btrfs: Fix function description format Nikolay Borisov
@ 2021-01-20 10:25 ` Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 05/14] btrfs: Improve parameter description for __btrfs_write_out_cache Nikolay Borisov
` (9 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
This fixes the following warnings:
fs/btrfs/delayed-ref.c:80: warning: Function parameter or member 'fs_info' not described in 'btrfs_delayed_refs_rsv_release'
fs/btrfs/delayed-ref.c:80: warning: Function parameter or member 'nr' not described in 'btrfs_delayed_refs_rsv_release'
fs/btrfs/delayed-ref.c:128: warning: Function parameter or member 'fs_info' not described in 'btrfs_migrate_to_delayed_refs_rsv'
fs/btrfs/delayed-ref.c:128: warning: Function parameter or member 'src' not described in 'btrfs_migrate_to_delayed_refs_rsv'
fs/btrfs/delayed-ref.c:128: warning: Function parameter or member 'num_bytes' not described in 'btrfs_migrate_to_delayed_refs_rsv'
fs/btrfs/delayed-ref.c:174: warning: Function parameter or member 'fs_info' not described in 'btrfs_delayed_refs_rsv_refill'
fs/btrfs/delayed-ref.c:174: warning: Function parameter or member 'flush' not described in 'btrfs_delayed_refs_rsv_refill'
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/delayed-ref.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
index 353cc2994d10..aaea0c7b2b86 100644
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -70,8 +70,9 @@ int btrfs_should_throttle_delayed_refs(struct btrfs_trans_handle *trans)
/**
* btrfs_delayed_refs_rsv_release - release a ref head's reservation.
- * @fs_info - the fs_info for our fs.
- * @nr - the number of items to drop.
+ *
+ * @fs_info: the filesystem
+ * @nr: the number of items to drop.
*
* This drops the delayed ref head's count from the delayed refs rsv and frees
* any excess reservation we had.
@@ -115,9 +116,10 @@ void btrfs_update_delayed_refs_rsv(struct btrfs_trans_handle *trans)
/**
* btrfs_migrate_to_delayed_refs_rsv - transfer bytes to our delayed refs rsv.
- * @fs_info - the fs info for our fs.
- * @src - the source block rsv to transfer from.
- * @num_bytes - the number of bytes to transfer.
+ *
+ * @fs_info: the filesystem
+ * @src: the source block rsv to transfer from.
+ * @num_bytes: the number of bytes to transfer.
*
* This transfers up to the num_bytes amount from the src rsv to the
* delayed_refs_rsv. Any extra bytes are returned to the space info.
@@ -163,8 +165,8 @@ void btrfs_migrate_to_delayed_refs_rsv(struct btrfs_fs_info *fs_info,
/**
* btrfs_delayed_refs_rsv_refill - refill based on our delayed refs usage.
- * @fs_info - the fs_info for our fs.
- * @flush - control how we can flush for this reservation.
+ * @fs_info: the filesystem
+ * @flush: control how we can flush for this reservation.
*
* This will refill the delayed block_rsv up to 1 items size worth of space and
* will return -ENOSPC if we can't make the reservation.
--
2.25.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 05/14] btrfs: Improve parameter description for __btrfs_write_out_cache
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
` (3 preceding siblings ...)
2021-01-20 10:25 ` [PATCH v2 04/14] btrfs: Fix parameter description in delayed-ref.c functions Nikolay Borisov
@ 2021-01-20 10:25 ` Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 06/14] btrfs: Document now parameter of peek_discard_list Nikolay Borisov
` (8 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
Fixes following W=1 warnings:
fs/btrfs/free-space-cache.c:1317: warning: Function parameter or member 'root' not described in '__btrfs_write_out_cache'
fs/btrfs/free-space-cache.c:1317: warning: Function parameter or member 'inode' not described in '__btrfs_write_out_cache'
fs/btrfs/free-space-cache.c:1317: warning: Function parameter or member 'ctl' not described in '__btrfs_write_out_cache'
fs/btrfs/free-space-cache.c:1317: warning: Function parameter or member 'block_group' not described in '__btrfs_write_out_cache'
fs/btrfs/free-space-cache.c:1317: warning: Function parameter or member 'io_ctl' not described in '__btrfs_write_out_cache'
fs/btrfs/free-space-cache.c:1317: warning: Function parameter or member 'trans' not described in '__btrfs_write_out_cache'
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/free-space-cache.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index fd6ddd6b8165..c8f42385a302 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -1300,10 +1300,12 @@ int btrfs_wait_cache_io(struct btrfs_trans_handle *trans,
/**
* __btrfs_write_out_cache - write out cached info to an inode
- * @root - the root the inode belongs to
- * @ctl - the free space cache we are going to write out
- * @block_group - the block_group for this cache if it belongs to a block_group
- * @trans - the trans handle
+ * @root: the root the inode belongs to
+ * @inode: freespace inode we are writing out
+ * @ctl: the free space cache we are going to write out
+ * @block_group: the block_group for this cache if it belongs to a block_group
+ * @io_ctl: holds context for the io
+ * @trans: the trans handle
*
* This function writes out a free space cache struct to disk for quick recovery
* on mount. This will return 0 if it was successful in writing the cache out,
--
2.25.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 06/14] btrfs: Document now parameter of peek_discard_list
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
` (4 preceding siblings ...)
2021-01-20 10:25 ` [PATCH v2 05/14] btrfs: Improve parameter description for __btrfs_write_out_cache Nikolay Borisov
@ 2021-01-20 10:25 ` Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 07/14] btrfs: Document fs_info in btrfs_rmap_block Nikolay Borisov
` (7 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
Fixes fs/btrfs/discard.c:203: warning: Function parameter or member 'now' not described in 'peek_discard_list'
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/discard.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/discard.c b/fs/btrfs/discard.c
index 2b8383d41144..0b9f69f6de56 100644
--- a/fs/btrfs/discard.c
+++ b/fs/btrfs/discard.c
@@ -186,9 +186,10 @@ static struct btrfs_block_group *find_next_block_group(
/**
* peek_discard_list - wrap find_next_block_group()
- * @discard_ctl: discard control
+ * @discard_ctl: discard control
* @discard_state: the discard_state of the block_group after state management
* @discard_index: the discard_index of the block_group after state management
+ * @now: time when discard was invoked, in ns
*
* This wraps find_next_block_group() and sets the block_group to be in use.
* discard_state's control flow is managed here. Variables related to
--
2.25.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 07/14] btrfs: Document fs_info in btrfs_rmap_block
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
` (5 preceding siblings ...)
2021-01-20 10:25 ` [PATCH v2 06/14] btrfs: Document now parameter of peek_discard_list Nikolay Borisov
@ 2021-01-20 10:25 ` Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 08/14] btrfs: Fix description format of fs_info parameter of btrfs_wait_on_delayed_iputs Nikolay Borisov
` (6 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
Fixes fs/btrfs/block-group.c:1570: warning: Function parameter or member 'fs_info' not described in 'btrfs_rmap_block'
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/block-group.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index 0886e81e5540..89a8d7de9cf5 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -1554,6 +1554,7 @@ static void set_avail_alloc_bits(struct btrfs_fs_info *fs_info, u64 flags)
/**
* btrfs_rmap_block - Map a physical disk address to a list of logical addresses
+ * @fs_info: the filesystem
* @chunk_start: logical address of block group
* @physical: physical address to map to logical addresses
* @logical: return array of logical addresses which map to @physical
--
2.25.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 08/14] btrfs: Fix description format of fs_info parameter of btrfs_wait_on_delayed_iputs
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
` (6 preceding siblings ...)
2021-01-20 10:25 ` [PATCH v2 07/14] btrfs: Document fs_info in btrfs_rmap_block Nikolay Borisov
@ 2021-01-20 10:25 ` Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 09/14] btrfs: Document btrfs_check_shared parameters Nikolay Borisov
` (5 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
Fixes fs/btrfs/inode.c:3101: warning: Function parameter or member 'fs_info' not described in 'btrfs_wait_on_delayed_iputs'
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 5906b4267204..b6711c207808 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3089,7 +3089,7 @@ void btrfs_run_delayed_iputs(struct btrfs_fs_info *fs_info)
/**
* btrfs_wait_on_delayed_iputs - wait on the delayed iputs to be done running
- * @fs_info - the fs_info for this fs
+ * @fs_info: the fs_info for this fs
* @return - EINTR if we were killed, 0 if nothing's pending
*
* This will wait on any delayed iputs that are currently running with KILLABLE
--
2.25.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 09/14] btrfs: Document btrfs_check_shared parameters
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
` (7 preceding siblings ...)
2021-01-20 10:25 ` [PATCH v2 08/14] btrfs: Fix description format of fs_info parameter of btrfs_wait_on_delayed_iputs Nikolay Borisov
@ 2021-01-20 10:25 ` Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 10/14] btrfs: Fix parameter description of btrfs_inode_rsv_release/btrfs_delalloc_release_space Nikolay Borisov
` (4 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/backref.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index ef71aba5bc15..50334b8cb64d 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -1503,6 +1503,12 @@ int btrfs_find_all_roots(struct btrfs_trans_handle *trans,
/**
* btrfs_check_shared - tell us whether an extent is shared
*
+ * @root: root inode belongs to
+ * @inum: inode number of the inode whose extent we are checking
+ * @bytenr: logical bytenr of the extent we are checking
+ * @roots: list of roots this extent is shared among
+ * @tmp: temporary list used for iteration
+ *
* btrfs_check_shared uses the backref walking code but will short
* circuit as soon as it finds a root or inode that doesn't match the
* one passed in. This provides a significant performance benefit for
--
2.25.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 10/14] btrfs: Fix parameter description of btrfs_inode_rsv_release/btrfs_delalloc_release_space
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
` (8 preceding siblings ...)
2021-01-20 10:25 ` [PATCH v2 09/14] btrfs: Document btrfs_check_shared parameters Nikolay Borisov
@ 2021-01-20 10:25 ` Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 11/14] btrfs: Fix parameter description in space-info.c Nikolay Borisov
` (3 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
Fixes following warnings:
fs/btrfs/delalloc-space.c:205: warning: Function parameter or member 'inode' not described in 'btrfs_inode_rsv_release'
fs/btrfs/delalloc-space.c:205: warning: Function parameter or member 'qgroup_free' not described in 'btrfs_inode_rsv_release'
fs/btrfs/delalloc-space.c:472: warning: Function parameter or member 'reserved' not described in 'btrfs_delalloc_release_space'
fs/btrfs/delalloc-space.c:472: warning: Function parameter or member 'qgroup_free' not described in 'btrfs_delalloc_release_space'
fs/btrfs/delalloc-space.c:472: warning: Excess function parameter 'release_bytes' description in 'btrfs_delalloc_release_space'
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/delalloc-space.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/delalloc-space.c b/fs/btrfs/delalloc-space.c
index bacee09b7bfd..c73e5131a2de 100644
--- a/fs/btrfs/delalloc-space.c
+++ b/fs/btrfs/delalloc-space.c
@@ -192,8 +192,8 @@ void btrfs_free_reserved_data_space(struct btrfs_inode *inode,
/**
* btrfs_inode_rsv_release - release any excessive reservation.
- * @inode - the inode we need to release from.
- * @qgroup_free - free or convert qgroup meta.
+ * @inode: the inode we need to release from.
+ * @qgroup_free: free or convert qgroup meta.
* Unlike normal operation, qgroup meta reservation needs to know if we are
* freeing qgroup reservation or just converting it into per-trans. Normally
* @qgroup_free is true for error handling, and false for normal release.
@@ -457,9 +457,10 @@ int btrfs_delalloc_reserve_space(struct btrfs_inode *inode,
/**
* btrfs_delalloc_release_space - release data and metadata space for delalloc
* @inode: inode we're releasing space for
+ * @reserved: list of changed/reserved ranges
* @start: start position of the space already reserved
* @len: the len of the space already reserved
- * @release_bytes: the len of the space we consumed or didn't use
+ * @qgroup_free: should qgroup reserved-space also be freed
*
* This function will release the metadata space that was not used and will
* decrement ->delalloc_bytes and remove it from the fs_info delalloc_inodes
--
2.25.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 11/14] btrfs: Fix parameter description in space-info.c
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
` (9 preceding siblings ...)
2021-01-20 10:25 ` [PATCH v2 10/14] btrfs: Fix parameter description of btrfs_inode_rsv_release/btrfs_delalloc_release_space Nikolay Borisov
@ 2021-01-20 10:25 ` Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 12/14] btrfs: Fix parameter description for functions in extent_io.c Nikolay Borisov
` (2 subsequent siblings)
13 siblings, 0 replies; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
With these fixes space-info.c is clearn for W=1 warnings, namely the
following ones are fixed:
fs/btrfs/space-info.c:575: warning: Function parameter or member 'fs_info' not described in 'may_commit_transaction'
fs/btrfs/space-info.c:575: warning: Function parameter or member 'space_info' not described in 'may_commit_transaction'
fs/btrfs/space-info.c:1231: warning: Function parameter or member 'fs_info' not described in 'handle_reserve_ticket'
fs/btrfs/space-info.c:1231: warning: Function parameter or member 'space_info' not described in 'handle_reserve_ticket'
fs/btrfs/space-info.c:1231: warning: Function parameter or member 'ticket' not described in 'handle_reserve_ticket'
fs/btrfs/space-info.c:1231: warning: Function parameter or member 'flush' not described in 'handle_reserve_ticket'
fs/btrfs/space-info.c:1315: warning: Function parameter or member 'fs_info' not described in '__reserve_bytes'
fs/btrfs/space-info.c:1315: warning: Function parameter or member 'space_info' not described in '__reserve_bytes'
fs/btrfs/space-info.c:1315: warning: Function parameter or member 'orig_bytes' not described in '__reserve_bytes'
fs/btrfs/space-info.c:1315: warning: Function parameter or member 'flush' not described in '__reserve_bytes'
fs/btrfs/space-info.c:1427: warning: Function parameter or member 'root' not described in 'btrfs_reserve_metadata_bytes'
fs/btrfs/space-info.c:1427: warning: Function parameter or member 'block_rsv' not described in 'btrfs_reserve_metadata_bytes'
fs/btrfs/space-info.c:1427: warning: Function parameter or member 'orig_bytes' not described in 'btrfs_reserve_metadata_bytes'
fs/btrfs/space-info.c:1427: warning: Function parameter or member 'flush' not described in 'btrfs_reserve_metadata_bytes'
fs/btrfs/space-info.c:1462: warning: Function parameter or member 'fs_info' not described in 'btrfs_reserve_data_bytes'
fs/btrfs/space-info.c:1462: warning: Function parameter or member 'bytes' not described in 'btrfs_reserve_data_bytes'
fs/btrfs/space-info.c:1462: warning: Function parameter or member 'flush' not described in 'btrfs_reserve_data_bytes'
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/space-info.c | 37 ++++++++++++++++++-------------------
1 file changed, 18 insertions(+), 19 deletions(-)
diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
index 84fb94e78a8f..0a8055a8bad1 100644
--- a/fs/btrfs/space-info.c
+++ b/fs/btrfs/space-info.c
@@ -562,9 +562,8 @@ static void shrink_delalloc(struct btrfs_fs_info *fs_info,
/**
* maybe_commit_transaction - possibly commit the transaction if its ok to
- * @root - the root we're allocating for
- * @bytes - the number of bytes we want to reserve
- * @force - force the commit
+ * @fs_info: the filesystem
+ * @space_info: space_info we are checking for commit, either data or metadata
*
* This will check to make sure that committing the transaction will actually
* get us somewhere and then commit the transaction if it does. Otherwise it
@@ -1216,10 +1215,10 @@ static void wait_reserve_ticket(struct btrfs_fs_info *fs_info,
/**
* handle_reserve_ticket - do the appropriate flushing and waiting for a ticket
- * @fs_info - the fs
- * @space_info - the space_info for the reservation
- * @ticket - the ticket for the reservation
- * @flush - how much we can flush
+ * @fs_info: the filesystem
+ * @space_info: the space_info for the reservation
+ * @ticket: the ticket for the reservation
+ * @flush: how much we can flush
*
* This does the work of figuring out how to flush for the ticket, waiting for
* the reservation, and returning the appropriate error if there is one.
@@ -1297,10 +1296,10 @@ static inline bool is_normal_flushing(enum btrfs_reserve_flush_enum flush)
/**
* reserve_metadata_bytes - try to reserve bytes from the block_rsv's space
- * @root - the root we're allocating for
- * @space_info - the space info we want to allocate from
- * @orig_bytes - the number of bytes we want
- * @flush - whether or not we can flush to make our reservation
+ * @fs_info: the filesystem
+ * @space_info: the space info we want to allocate from
+ * @orig_bytes: the number of bytes we want
+ * @flush: whether or not we can flush to make our reservation
*
* This will reserve orig_bytes number of bytes from the space info associated
* with the block_rsv. If there is not enough space it will make an attempt to
@@ -1407,11 +1406,11 @@ static int __reserve_bytes(struct btrfs_fs_info *fs_info,
}
/**
- * reserve_metadata_bytes - try to reserve bytes from the block_rsv's space
- * @root - the root we're allocating for
- * @block_rsv - the block_rsv we're allocating for
- * @orig_bytes - the number of bytes we want
- * @flush - whether or not we can flush to make our reservation
+ * btrfs_reserve_metadata_bytes - try to reserve bytes from the block_rsv's space
+ * @root: the root we're allocating for
+ * @block_rsv: the block_rsv we're allocating for
+ * @orig_bytes: the number of bytes we want
+ * @flush: whether or not we can flush to make our reservation
*
* This will reserve orig_bytes number of bytes from the space info associated
* with the block_rsv. If there is not enough space it will make an attempt to
@@ -1450,9 +1449,9 @@ int btrfs_reserve_metadata_bytes(struct btrfs_root *root,
/**
* btrfs_reserve_data_bytes - try to reserve data bytes for an allocation
- * @fs_info - the filesystem
- * @bytes - the number of bytes we need
- * @flush - how we are allowed to flush
+ * @fs_info: the filesystem
+ * @bytes: the number of bytes we need
+ * @flush: how we are allowed to flush
*
* This will reserve bytes from the data space info. If there is not enough
* space then we will attempt to flush space as specified by flush.
--
2.25.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 12/14] btrfs: Fix parameter description for functions in extent_io.c
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
` (10 preceding siblings ...)
2021-01-20 10:25 ` [PATCH v2 11/14] btrfs: Fix parameter description in space-info.c Nikolay Borisov
@ 2021-01-20 10:25 ` Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 13/14] lib/zstd: Convert constants to defines Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 14/14] btrfs: Enable W=1 checks for btrfs Nikolay Borisov
13 siblings, 0 replies; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
This makes the file W=1 clean and fixes the following warnings:
fs/btrfs/extent_io.c:414: warning: Function parameter or member 'tree' not described in '__etree_search'
fs/btrfs/extent_io.c:414: warning: Function parameter or member 'offset' not described in '__etree_search'
fs/btrfs/extent_io.c:414: warning: Function parameter or member 'next_ret' not described in '__etree_search'
fs/btrfs/extent_io.c:414: warning: Function parameter or member 'prev_ret' not described in '__etree_search'
fs/btrfs/extent_io.c:414: warning: Function parameter or member 'p_ret' not described in '__etree_search'
fs/btrfs/extent_io.c:414: warning: Function parameter or member 'parent_ret' not described in '__etree_search'
fs/btrfs/extent_io.c:1607: warning: Function parameter or member 'tree' not described in 'find_contiguous_extent_bit'
fs/btrfs/extent_io.c:1607: warning: Function parameter or member 'start' not described in 'find_contiguous_extent_bit'
fs/btrfs/extent_io.c:1607: warning: Function parameter or member 'start_ret' not described in 'find_contiguous_extent_bit'
fs/btrfs/extent_io.c:1607: warning: Function parameter or member 'end_ret' not described in 'find_contiguous_extent_bit'
fs/btrfs/extent_io.c:1607: warning: Function parameter or member 'bits' not described in 'find_contiguous_extent_bit'
fs/btrfs/extent_io.c:1644: warning: Function parameter or member 'tree' not described in 'find_first_clear_extent_bit'
fs/btrfs/extent_io.c:1644: warning: Function parameter or member 'start' not described in 'find_first_clear_extent_bit'
fs/btrfs/extent_io.c:1644: warning: Function parameter or member 'start_ret' not described in 'find_first_clear_extent_bit'
fs/btrfs/extent_io.c:1644: warning: Function parameter or member 'end_ret' not described in 'find_first_clear_extent_bit'
fs/btrfs/extent_io.c:1644: warning: Function parameter or member 'bits' not described in 'find_first_clear_extent_bit'
fs/btrfs/extent_io.c:4187: warning: Function parameter or member 'epd' not described in 'extent_write_cache_pages'
fs/btrfs/extent_io.c:4187: warning: Excess function parameter 'data' description in 'extent_write_cache_pages'
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/extent_io.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 7f689ad7709c..62f892238149 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -392,13 +392,13 @@ static struct rb_node *tree_insert(struct rb_root *root,
* __etree_search - searche @tree for an entry that contains @offset. Such
* entry would have entry->start <= offset && entry->end >= offset.
*
- * @tree - the tree to search
- * @offset - offset that should fall within an entry in @tree
- * @next_ret - pointer to the first entry whose range ends after @offset
- * @prev - pointer to the first entry whose range begins before @offset
- * @p_ret - pointer where new node should be anchored (used when inserting an
+ * @tree: the tree to search
+ * @offset: offset that should fall within an entry in @tree
+ * @next_ret: pointer to the first entry whose range ends after @offset
+ * @prev_ret: pointer to the first entry whose range begins before @offset
+ * @p_ret: pointer where new node should be anchored (used when inserting an
* entry in the tree)
- * @parent_ret - points to entry which would have been the parent of the entry,
+ * @parent_ret: points to entry which would have been the parent of the entry,
* containing @offset
*
* This function returns a pointer to the entry that contains @offset byte
@@ -1589,11 +1589,11 @@ int find_first_extent_bit(struct extent_io_tree *tree, u64 start,
/**
* find_contiguous_extent_bit: find a contiguous area of bits
- * @tree - io tree to check
- * @start - offset to start the search from
- * @start_ret - the first offset we found with the bits set
- * @end_ret - the final contiguous range of the bits that were set
- * @bits - bits to look for
+ * @tree: io tree to check
+ * @start: offset to start the search from
+ * @start_ret: the first offset we found with the bits set
+ * @end_ret: the final contiguous range of the bits that were set
+ * @bits: bits to look for
*
* set_extent_bit and clear_extent_bit can temporarily split contiguous ranges
* to set bits appropriately, and then merge them again. During this time it
@@ -1628,11 +1628,11 @@ int find_contiguous_extent_bit(struct extent_io_tree *tree, u64 start,
* find_first_clear_extent_bit - find the first range that has @bits not set.
* This range could start before @start.
*
- * @tree - the tree to search
- * @start - the offset at/after which the found extent should start
- * @start_ret - records the beginning of the range
- * @end_ret - records the end of the range (inclusive)
- * @bits - the set of bits which must be unset
+ * @tree: the tree to search
+ * @start: the offset at/after which the found extent should start
+ * @start_ret: records the beginning of the range
+ * @end_ret: records the end of the range (inclusive)
+ * @bits: the set of bits which must be unset
*
* Since unallocated range is also considered one which doesn't have the bits
* set it's possible that @end_ret contains -1, this happens in case the range
@@ -4171,7 +4171,7 @@ int btree_write_cache_pages(struct address_space *mapping,
* write_cache_pages - walk the list of dirty pages of the given address space and write all of them.
* @mapping: address space structure to write
* @wbc: subtract the number of written pages from *@wbc->nr_to_write
- * @data: data passed to __extent_writepage function
+ * @epd: holds context for the write, namely the bio
*
* If a page is already under I/O, write_cache_pages() skips it, even
* if it's dirty. This is desirable behaviour for memory-cleaning writeback,
--
2.25.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 13/14] lib/zstd: Convert constants to defines
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
` (11 preceding siblings ...)
2021-01-20 10:25 ` [PATCH v2 12/14] btrfs: Fix parameter description for functions in extent_io.c Nikolay Borisov
@ 2021-01-20 10:25 ` Nikolay Borisov
2021-01-21 15:54 ` David Sterba
2021-01-20 10:25 ` [PATCH v2 14/14] btrfs: Enable W=1 checks for btrfs Nikolay Borisov
13 siblings, 1 reply; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
Those constants are really used internally by zstd and including
linux/zstd.h into users results in the following warnings:
In file included from fs/btrfs/zstd.c:19:
./include/linux/zstd.h:798:21: warning: ‘ZSTD_skippableHeaderSize’ defined but not used [-Wunused-const-variable=]
798 | static const size_t ZSTD_skippableHeaderSize = 8;
| ^~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/zstd.h:796:21: warning: ‘ZSTD_frameHeaderSize_max’ defined but not used [-Wunused-const-variable=]
796 | static const size_t ZSTD_frameHeaderSize_max = ZSTD_FRAMEHEADERSIZE_MAX;
| ^~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/zstd.h:795:21: warning: ‘ZSTD_frameHeaderSize_min’ defined but not used [-Wunused-const-variable=]
795 | static const size_t ZSTD_frameHeaderSize_min = ZSTD_FRAMEHEADERSIZE_MIN;
| ^~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/zstd.h:794:21: warning: ‘ZSTD_frameHeaderSize_prefix’ defined but not used [-Wunused-const-variable=]
794 | static const size_t ZSTD_frameHeaderSize_prefix = 5;
So fix those warnings by turning the constants into defines.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
include/linux/zstd.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/linux/zstd.h b/include/linux/zstd.h
index 249575e2485f..e87f78c9b19c 100644
--- a/include/linux/zstd.h
+++ b/include/linux/zstd.h
@@ -791,11 +791,11 @@ size_t ZSTD_DStreamOutSize(void);
/* for static allocation */
#define ZSTD_FRAMEHEADERSIZE_MAX 18
#define ZSTD_FRAMEHEADERSIZE_MIN 6
-static const size_t ZSTD_frameHeaderSize_prefix = 5;
-static const size_t ZSTD_frameHeaderSize_min = ZSTD_FRAMEHEADERSIZE_MIN;
-static const size_t ZSTD_frameHeaderSize_max = ZSTD_FRAMEHEADERSIZE_MAX;
+#define ZSTD_frameHeaderSize_prefix 5
+#define ZSTD_frameHeaderSize_min ZSTD_FRAMEHEADERSIZE_MIN
+#define ZSTD_frameHeaderSize_max ZSTD_FRAMEHEADERSIZE_MAX
/* magic number + skippable frame length */
-static const size_t ZSTD_skippableHeaderSize = 8;
+#define ZSTD_skippableHeaderSize 8
/*-*************************************
--
2.25.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v2 14/14] btrfs: Enable W=1 checks for btrfs
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
` (12 preceding siblings ...)
2021-01-20 10:25 ` [PATCH v2 13/14] lib/zstd: Convert constants to defines Nikolay Borisov
@ 2021-01-20 10:25 ` Nikolay Borisov
2021-01-20 15:55 ` Josef Bacik
13 siblings, 1 reply; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-20 10:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: Nikolay Borisov
Now that the btrfs' codebase is clean of W=1 warning let's enable those
checks unconditionally for the entire fs/btrfs/ and its subdirectories.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/btrfs/Makefile | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile
index 9f1b1a88e317..44faee776027 100644
--- a/fs/btrfs/Makefile
+++ b/fs/btrfs/Makefile
@@ -1,5 +1,22 @@
# SPDX-License-Identifier: GPL-2.0
+subdir-ccflags-y += -Wextra -Wunused -Wno-unused-parameter
+subdir-ccflags-y += -Wmissing-declarations
+subdir-ccflags-y += -Wmissing-format-attribute
+subdir-ccflags-y += -Wmissing-prototypes
+subdir-ccflags-y += -Wold-style-definition
+subdir-ccflags-y += -Wmissing-include-dirs
+subdir-ccflags-y += $(call cc-option, -Wunused-but-set-variable)
+subdir-ccflags-y += $(call cc-option, -Wunused-const-variable)
+subdir-ccflags-y += $(call cc-option, -Wpacked-not-aligned)
+subdir-ccflags-y += $(call cc-option, -Wstringop-truncation)
+# The following turn off the warnings enabled by -Wextra
+subdir-ccflags-y += -Wno-missing-field-initializers
+subdir-ccflags-y += -Wno-sign-compare
+subdir-ccflags-y += -Wno-type-limits
+
+cmd_checkdoc = $(srctree)/scripts/kernel-doc -none $<
+
obj-$(CONFIG_BTRFS_FS) := btrfs.o
btrfs-y += super.o ctree.o extent-tree.o print-tree.o root-tree.o dir-item.o \
--
2.25.1
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH v2 01/14] btrfs: Document modified paramater of add_extent_mapping
2021-01-20 10:25 ` [PATCH v2 01/14] btrfs: Document modified paramater of add_extent_mapping Nikolay Borisov
@ 2021-01-20 15:54 ` Josef Bacik
0 siblings, 0 replies; 21+ messages in thread
From: Josef Bacik @ 2021-01-20 15:54 UTC (permalink / raw)
To: Nikolay Borisov, linux-btrfs
On 1/20/21 5:25 AM, Nikolay Borisov wrote:
> Fixes fs/btrfs/extent_map.c:399: warning: Function parameter or member
> 'modified' not described in 'add_extent_mapping'
>
You missed the 'paramater' misspelling in the subject for this one, gotta use
those git hooks. Thanks,
Josef
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 14/14] btrfs: Enable W=1 checks for btrfs
2021-01-20 10:25 ` [PATCH v2 14/14] btrfs: Enable W=1 checks for btrfs Nikolay Borisov
@ 2021-01-20 15:55 ` Josef Bacik
2021-01-21 7:31 ` Nikolay Borisov
0 siblings, 1 reply; 21+ messages in thread
From: Josef Bacik @ 2021-01-20 15:55 UTC (permalink / raw)
To: Nikolay Borisov, linux-btrfs
On 1/20/21 5:25 AM, Nikolay Borisov wrote:
> Now that the btrfs' codebase is clean of W=1 warning let's enable those
> checks unconditionally for the entire fs/btrfs/ and its subdirectories.
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Once this is enabled I get
fs/btrfs/zoned.c: In function ‘btrfs_sb_log_location_bdev’:
fs/btrfs/zoned.c:491:6: warning: variable ‘zone_size’ set but not used
[-Wunused-but-set-variable]
491 | u64 zone_size;
| ^~~~~~~~~
on misc-next. Thanks,
Josef
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 14/14] btrfs: Enable W=1 checks for btrfs
2021-01-20 15:55 ` Josef Bacik
@ 2021-01-21 7:31 ` Nikolay Borisov
2021-01-24 13:23 ` David Sterba
0 siblings, 1 reply; 21+ messages in thread
From: Nikolay Borisov @ 2021-01-21 7:31 UTC (permalink / raw)
To: Josef Bacik, linux-btrfs
On 20.01.21 г. 17:55 ч., Josef Bacik wrote:
> On 1/20/21 5:25 AM, Nikolay Borisov wrote:
>> Now that the btrfs' codebase is clean of W=1 warning let's enable those
>> checks unconditionally for the entire fs/btrfs/ and its subdirectories.
>>
>> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
>
> Once this is enabled I get
>
> fs/btrfs/zoned.c: In function ‘btrfs_sb_log_location_bdev’:
> fs/btrfs/zoned.c:491:6: warning: variable ‘zone_size’ set but not used
> [-Wunused-but-set-variable]
> 491 | u64 zone_size;
> | ^~~~~~~~~
>
> on misc-next. Thanks,
>
I know, I intentionally haven't fixed it since:
a) David might be intending to merge other patches which will utilize
this member
b) It shows a genuine problem that this patchset has uncovered ( I even
mentioned this in the initial cover letter)
> Josef
>
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 13/14] lib/zstd: Convert constants to defines
2021-01-20 10:25 ` [PATCH v2 13/14] lib/zstd: Convert constants to defines Nikolay Borisov
@ 2021-01-21 15:54 ` David Sterba
0 siblings, 0 replies; 21+ messages in thread
From: David Sterba @ 2021-01-21 15:54 UTC (permalink / raw)
To: Nikolay Borisov; +Cc: linux-btrfs
On Wed, Jan 20, 2021 at 12:25:25PM +0200, Nikolay Borisov wrote:
> Those constants are really used internally by zstd and including
> linux/zstd.h into users results in the following warnings:
>
> In file included from fs/btrfs/zstd.c:19:
> ./include/linux/zstd.h:798:21: warning: ‘ZSTD_skippableHeaderSize’ defined but not used [-Wunused-const-variable=]
> 798 | static const size_t ZSTD_skippableHeaderSize = 8;
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/zstd.h:796:21: warning: ‘ZSTD_frameHeaderSize_max’ defined but not used [-Wunused-const-variable=]
> 796 | static const size_t ZSTD_frameHeaderSize_max = ZSTD_FRAMEHEADERSIZE_MAX;
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/zstd.h:795:21: warning: ‘ZSTD_frameHeaderSize_min’ defined but not used [-Wunused-const-variable=]
> 795 | static const size_t ZSTD_frameHeaderSize_min = ZSTD_FRAMEHEADERSIZE_MIN;
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> ./include/linux/zstd.h:794:21: warning: ‘ZSTD_frameHeaderSize_prefix’ defined but not used [-Wunused-const-variable=]
> 794 | static const size_t ZSTD_frameHeaderSize_prefix = 5;
>
> So fix those warnings by turning the constants into defines.
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
> include/linux/zstd.h | 8 ++++----
That's not our file and you haven't CCed the maintainer, we can't modify
that code without an ack.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 03/14] btrfs: Fix function description format
2021-01-20 10:25 ` [PATCH v2 03/14] btrfs: Fix function description format Nikolay Borisov
@ 2021-01-21 16:23 ` David Sterba
0 siblings, 0 replies; 21+ messages in thread
From: David Sterba @ 2021-01-21 16:23 UTC (permalink / raw)
To: Nikolay Borisov; +Cc: linux-btrfs
On Wed, Jan 20, 2021 at 12:25:15PM +0200, Nikolay Borisov wrote:
> This fixes following W=1 warnings:
>
> fs/btrfs/file-item.c:27: warning: Cannot understand * @inode: the inode we want to update the disk_i_size for
> on line 27 - I thought it was a doc line
> fs/btrfs/file-item.c:65: warning: Cannot understand * @inode - the inode we're modifying
> on line 65 - I thought it was a doc line
> fs/btrfs/file-item.c:91: warning: Cannot understand * @inode - the inode we're modifying
> on line 91 - I thought it was a doc line
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
> fs/btrfs/file-item.c | 22 ++++++++++++++--------
> 1 file changed, 14 insertions(+), 8 deletions(-)
>
> diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
> index 6ccfc019ad90..fedb200c39ca 100644
> --- a/fs/btrfs/file-item.c
> +++ b/fs/btrfs/file-item.c
> @@ -24,8 +24,10 @@
> PAGE_SIZE))
>
> /**
> - * @inode - the inode we want to update the disk_i_size for
> - * @new_i_size - the i_size we want to set to, 0 if we use i_size
> + * btrfs_inode_safe_disk_i_size_write
Have you not read
https://lore.kernel.org/linux-btrfs/20210119224353.GU6430@twin.jikos.cz/
?
Updating the whole comment is fine in one patch even if there are more
types of changes, no point to do that in separate patches like for code.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v2 14/14] btrfs: Enable W=1 checks for btrfs
2021-01-21 7:31 ` Nikolay Borisov
@ 2021-01-24 13:23 ` David Sterba
0 siblings, 0 replies; 21+ messages in thread
From: David Sterba @ 2021-01-24 13:23 UTC (permalink / raw)
To: Nikolay Borisov; +Cc: Josef Bacik, linux-btrfs
On Thu, Jan 21, 2021 at 09:31:34AM +0200, Nikolay Borisov wrote:
> On 20.01.21 г. 17:55 ч., Josef Bacik wrote:
> > On 1/20/21 5:25 AM, Nikolay Borisov wrote:
> >> Now that the btrfs' codebase is clean of W=1 warning let's enable those
> >> checks unconditionally for the entire fs/btrfs/ and its subdirectories.
> >>
> >> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> >
> > Once this is enabled I get
> >
> > fs/btrfs/zoned.c: In function ‘btrfs_sb_log_location_bdev’:
> > fs/btrfs/zoned.c:491:6: warning: variable ‘zone_size’ set but not used
> > [-Wunused-but-set-variable]
> > 491 | u64 zone_size;
> > | ^~~~~~~~~
> >
> > on misc-next. Thanks,
> >
>
> I know, I intentionally haven't fixed it since:
>
> a) David might be intending to merge other patches which will utilize
> this member
That's one possibility, but would show the warning until the zoned
patches get merged. I'd rather have a clean build once the W=1 build is
on.
I can insert a patch removing the variable, the zoned patches get still
rebased so that's fixable. Let me know if you want to send the patch as
it's from your series, or I can do that too.
> b) It shows a genuine problem that this patchset has uncovered ( I even
> mentioned this in the initial cover letter)
This should have been mentioned in the v2+ cover letter as well, along
with the version-to-version changelog.
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2021-01-24 13:25 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 10:25 [PATCH v2 00/14] Make btrfs W=1 clean Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 01/14] btrfs: Document modified paramater of add_extent_mapping Nikolay Borisov
2021-01-20 15:54 ` Josef Bacik
2021-01-20 10:25 ` [PATCH v2 02/14] btrfs: Fix parameter description of btrfs_add_extent_mapping Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 03/14] btrfs: Fix function description format Nikolay Borisov
2021-01-21 16:23 ` David Sterba
2021-01-20 10:25 ` [PATCH v2 04/14] btrfs: Fix parameter description in delayed-ref.c functions Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 05/14] btrfs: Improve parameter description for __btrfs_write_out_cache Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 06/14] btrfs: Document now parameter of peek_discard_list Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 07/14] btrfs: Document fs_info in btrfs_rmap_block Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 08/14] btrfs: Fix description format of fs_info parameter of btrfs_wait_on_delayed_iputs Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 09/14] btrfs: Document btrfs_check_shared parameters Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 10/14] btrfs: Fix parameter description of btrfs_inode_rsv_release/btrfs_delalloc_release_space Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 11/14] btrfs: Fix parameter description in space-info.c Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 12/14] btrfs: Fix parameter description for functions in extent_io.c Nikolay Borisov
2021-01-20 10:25 ` [PATCH v2 13/14] lib/zstd: Convert constants to defines Nikolay Borisov
2021-01-21 15:54 ` David Sterba
2021-01-20 10:25 ` [PATCH v2 14/14] btrfs: Enable W=1 checks for btrfs Nikolay Borisov
2021-01-20 15:55 ` Josef Bacik
2021-01-21 7:31 ` Nikolay Borisov
2021-01-24 13:23 ` David Sterba
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.