From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 2/3] btrfs: switch btrfs_block_rsv::failfast to bool
Date: Fri, 24 Jun 2022 16:01:38 +0200 [thread overview]
Message-ID: <bf8fa9adf15bb078e3fc70d088d658c98a2b601b.1656079178.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1656079178.git.dsterba@suse.com>
Use simple bool type for the block reserve failfast status, there's
short to save space as there used to be int but there's no reason for
that.
Signed-off-by: David Sterba <dsterba@suse.com>
---
fs/btrfs/block-rsv.h | 2 +-
fs/btrfs/file.c | 2 +-
fs/btrfs/inode.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/block-rsv.h b/fs/btrfs/block-rsv.h
index 99c491ef128e..0702d4087ff6 100644
--- a/fs/btrfs/block-rsv.h
+++ b/fs/btrfs/block-rsv.h
@@ -26,8 +26,8 @@ struct btrfs_block_rsv {
struct btrfs_space_info *space_info;
spinlock_t lock;
bool full;
+ bool failfast;
unsigned short type;
- unsigned short failfast;
/*
* Qgroup equivalent for @size @reserved
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 89c6d7ff1987..3e7f89d50db9 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -2734,7 +2734,7 @@ int btrfs_replace_file_extents(struct btrfs_inode *inode,
goto out;
}
rsv->size = btrfs_calc_insert_metadata_size(fs_info, 1);
- rsv->failfast = 1;
+ rsv->failfast = true;
/*
* 1 - update the inode
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 07b3fb90b621..1b2df600681b 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -5432,7 +5432,7 @@ void btrfs_evict_inode(struct inode *inode)
if (!rsv)
goto no_delete;
rsv->size = btrfs_calc_metadata_size(fs_info, 1);
- rsv->failfast = 1;
+ rsv->failfast = true;
btrfs_i_size_write(BTRFS_I(inode), 0);
@@ -8676,7 +8676,7 @@ static int btrfs_truncate(struct inode *inode, bool skip_writeback)
if (!rsv)
return -ENOMEM;
rsv->size = min_size;
- rsv->failfast = 1;
+ rsv->failfast = true;
/*
* 1 for the truncate slack space
--
2.36.1
next prev parent reply other threads:[~2022-06-24 14:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 14:01 [PATCH 0/3] Cleanup short int types in block group reserve David Sterba
2022-06-24 14:01 ` [PATCH 1/3] btrfs: switch btrfs_block_rsv::full to bool David Sterba
2022-06-24 17:12 ` Antonio Pérez
2022-07-07 18:46 ` David Sterba
2022-06-24 14:01 ` David Sterba [this message]
2022-06-27 6:48 ` [PATCH 2/3] btrfs: switch btrfs_block_rsv::failfast " Johannes Thumshirn
2022-06-24 14:01 ` [PATCH 3/3] btrfs: use u8 type for btrfs_block_rsv::type David Sterba
2022-06-27 6:51 ` Johannes Thumshirn
2022-06-27 16:40 ` David Sterba
2022-06-28 7:15 ` Johannes Thumshirn
2022-07-07 18:52 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bf8fa9adf15bb078e3fc70d088d658c98a2b601b.1656079178.git.dsterba@suse.com \
--to=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).