diff mbox

btrfs: use enum instead of constant value

Message ID 1512470130-7240-1-git-send-email-gujx@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gu Jinxiang Dec. 5, 2017, 10:35 a.m. UTC
Use enum READA_BACK instead of value 1 to keep source robust.

Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>
---
 fs/btrfs/free-space-tree.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Sterba Dec. 5, 2017, 5:35 p.m. UTC | #1
On Tue, Dec 05, 2017 at 06:35:30PM +0800, Gu Jinxiang wrote:
> Use enum READA_BACK instead of value 1 to keep source robust.

Are you sure that READA_BACK is the right one? It corresponds to the
value 1, but the actual readahead direction semantics should be
considered. It is not obvious and needs some explanation in the changelog.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/free-space-tree.c b/fs/btrfs/free-space-tree.c
index a5e34de..a105629 100644
--- a/fs/btrfs/free-space-tree.c
+++ b/fs/btrfs/free-space-tree.c
@@ -1071,7 +1071,7 @@  static int populate_free_space_tree(struct btrfs_trans_handle *trans,
 	path = btrfs_alloc_path();
 	if (!path)
 		return -ENOMEM;
-	path->reada = 1;
+	path->reada = READA_BACK;
 
 	path2 = btrfs_alloc_path();
 	if (!path2) {
@@ -1577,7 +1577,7 @@  int load_free_space_tree(struct btrfs_caching_control *caching_ctl)
 	 */
 	path->skip_locking = 1;
 	path->search_commit_root = 1;
-	path->reada = 1;
+	path->reada = READA_BACK;
 
 	info = search_free_space_info(NULL, fs_info, block_group, path, 0);
 	if (IS_ERR(info)) {