diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-12-14 14:24:41 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:19 -0400 |
commit | 8244f3209b5b49a6bde9921d7825af9f57161b23 (patch) | |
tree | 344a619bee4976ff0983bf0bb6bba7b81e532a71 /fs/bcachefs/io.c | |
parent | d05117e36a7290cbfa8ebcc05c6facb60a5bcefb (diff) |
bcachefs: Option improvements
This adds flags for options that must be a power of two (block size and
btree node size), and options that are stored in the superblock as a
power of two (encoded extent max).
Also: options are now stored in memory in the same units they're
displayed in (bytes): we now convert when getting and setting from the
superblock.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/io.c')
-rw-r--r-- | fs/bcachefs/io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c index 814984ec608c..1cfe433ded33 100644 --- a/fs/bcachefs/io.c +++ b/fs/bcachefs/io.c @@ -1357,7 +1357,7 @@ void bch2_write(struct closure *cl) bch2_keylist_init(&op->insert_keys, op->inline_keys); wbio_init(bio)->put_bio = false; - if (bio_sectors(bio) & (c->opts.block_size - 1)) { + if (bio->bi_iter.bi_size & (c->opts.block_size - 1)) { bch_err_inum_ratelimited(c, op->pos.inode, "misaligned write"); op->error = -EIO; @@ -2437,7 +2437,7 @@ int bch2_fs_io_init(struct bch_fs *c) BIOSET_NEED_BVECS) || mempool_init_page_pool(&c->bio_bounce_pages, max_t(unsigned, - c->opts.btree_node_size, + btree_sectors(c), c->sb.encoded_extent_max) / PAGE_SECTORS, 0) || rhashtable_init(&c->promote_table, &bch_promote_params)) |