diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2016-02-10 04:50:51 -0900 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2016-08-28 19:16:15 -0800 |
commit | c278f32ecef59798c207955e8a18b2702158779f (patch) | |
tree | 61ff3af7e48ffd41ff7b19d3e1cca9c19ed6b40f | |
parent | 8f534ebc0afa00e78ae2cb902aec4cad58e5e2ce (diff) |
XXX blocksize
-rw-r--r-- | fs/bcachefs/fs.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index fbaad0c35c4d..ee449b0f53bd 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -627,7 +627,8 @@ static int bch_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) return 0; } -static int bch_fill_extent(struct fiemap_extent_info *info, +static int bch_fill_extent(struct cache_set *c, + struct fiemap_extent_info *info, const struct bkey_i *k, unsigned flags) { if (bkey_extent_is_data(&k->k)) { @@ -644,11 +645,15 @@ static int bch_fill_extent(struct fiemap_extent_info *info, flags2 |= FIEMAP_EXTENT_ENCODED; else offset += crc_to_64(crc).offset; - +#if 1 if ((offset & (PAGE_SECTORS - 1)) || (e.k->size & (PAGE_SECTORS - 1))) flags2 |= FIEMAP_EXTENT_NOT_ALIGNED; - +#else + if ((offset & (c->sb.block_size - 1)) || + (e.k->size & (c->sb.block_size - 1))) + flags2 |= FIEMAP_EXTENT_NOT_ALIGNED; +#endif ret = fiemap_fill_next_extent(info, bkey_start_offset(e.k) << 9, offset << 9, @@ -692,7 +697,7 @@ static int bch_fiemap(struct inode *inode, struct fiemap_extent_info *info, break; if (have_extent) { - ret = bch_fill_extent(info, &tmp.k, 0); + ret = bch_fill_extent(c, info, &tmp.k, 0); if (ret) goto out; } @@ -702,7 +707,7 @@ static int bch_fiemap(struct inode *inode, struct fiemap_extent_info *info, } if (have_extent) - ret = bch_fill_extent(info, &tmp.k, FIEMAP_EXTENT_LAST); + ret = bch_fill_extent(c, info, &tmp.k, FIEMAP_EXTENT_LAST); out: bch_btree_iter_unlock(&iter); return ret < 0 ? ret : 0; @@ -1412,8 +1417,13 @@ static struct dentry *bch_mount(struct file_system_type *fs_type, } /* XXX: blocksize */ +#if 1 sb->s_blocksize = PAGE_SIZE; sb->s_blocksize_bits = PAGE_SHIFT; +#else + sb->s_blocksize = c->sb.block_size; + sb->s_blocksize_bits = c->block_bits; +#endif sb->s_maxbytes = MAX_LFS_FILESIZE; sb->s_op = &bch_super_operations; sb->s_export_op = &bch_export_ops; |