summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-05-24 18:48:38 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2018-06-01 17:28:35 -0400
commitdd7bc9a192aa39270d9a0a82c3424ed950fd202a (patch)
tree4cf4b2da9aa08f1ccdb5ff07027e1959d2c8fbe4
parent0c1830d1805ff20bee3b4bae1a168b9b63bd57f2 (diff)
bcachefs: fcollapse works on block granularity, not page
-rw-r--r--fs/bcachefs/fs-io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c
index 43a3154ee5ba..15d356f16908 100644
--- a/fs/bcachefs/fs-io.c
+++ b/fs/bcachefs/fs-io.c
@@ -2292,7 +2292,7 @@ static long bch2_fcollapse(struct bch_inode_info *inode,
loff_t new_size;
int ret;
- if ((offset | len) & (PAGE_SIZE - 1))
+ if ((offset | len) & (block_bytes(c) - 1))
return -EINVAL;
bch2_btree_iter_init(&dst, c, BTREE_ID_EXTENTS,
@@ -2383,7 +2383,7 @@ btree_iter_err:
bch2_btree_iter_unlock(&dst);
ret = bch2_inode_truncate(c, inode->v.i_ino,
- round_up(new_size, PAGE_SIZE) >> 9,
+ round_up(new_size, block_bytes(c)) >> 9,
&i_sectors_hook.hook,
&inode->ei_journal_seq);
if (ret)