diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-01-29 16:03:38 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:00 -0400 |
commit | 6f568d35a045dbb8a13fe71bfc32e85e39a986cb (patch) | |
tree | df5cb5826dfb46a2514bfba34f8473dc65ea7081 /fs | |
parent | 291d673e6a22d9c6834e939f66c7cfef90669021 (diff) |
Btrfs: mount -o max_inline=size to control the maximum inline extent size
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/ctree.h | 1 | ||||
-rw-r--r-- | fs/btrfs/disk-io.c | 1 | ||||
-rw-r--r-- | fs/btrfs/extent_io.c | 1 | ||||
-rw-r--r-- | fs/btrfs/file.c | 3 | ||||
-rw-r--r-- | fs/btrfs/super.c | 19 |
5 files changed, 22 insertions, 3 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 127c86f795d0..8f93e066bf8b 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -325,6 +325,7 @@ struct btrfs_fs_info { | |||
325 | u64 last_trans_committed; | 325 | u64 last_trans_committed; |
326 | unsigned long mount_opt; | 326 | unsigned long mount_opt; |
327 | u64 max_extent; | 327 | u64 max_extent; |
328 | u64 max_inline; | ||
328 | u64 alloc_start; | 329 | u64 alloc_start; |
329 | struct btrfs_transaction *running_transaction; | 330 | struct btrfs_transaction *running_transaction; |
330 | struct btrfs_super_block super_copy; | 331 | struct btrfs_super_block super_copy; |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index e29a0716f6a9..6647b90ef745 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -659,6 +659,7 @@ struct btrfs_root *open_ctree(struct super_block *sb) | |||
659 | fs_info->throttles = 0; | 659 | fs_info->throttles = 0; |
660 | fs_info->mount_opt = 0; | 660 | fs_info->mount_opt = 0; |
661 | fs_info->max_extent = (u64)-1; | 661 | fs_info->max_extent = (u64)-1; |
662 | fs_info->max_inline = 8192 * 1024; | ||
662 | fs_info->delalloc_bytes = 0; | 663 | fs_info->delalloc_bytes = 0; |
663 | fs_info->btree_inode = new_inode(sb); | 664 | fs_info->btree_inode = new_inode(sb); |
664 | fs_info->btree_inode->i_ino = 1; | 665 | fs_info->btree_inode->i_ino = 1; |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index e81b35b06187..6999b819db62 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -2451,7 +2451,6 @@ sector_t extent_bmap(struct address_space *mapping, sector_t iblock, | |||
2451 | goto out; | 2451 | goto out; |
2452 | 2452 | ||
2453 | sector = (em->block_start + start - em->start) >> inode->i_blkbits; | 2453 | sector = (em->block_start + start - em->start) >> inode->i_blkbits; |
2454 | printk("bmap finds %Lu %Lu block %Lu\n", em->start, em->len, em->block_start); | ||
2455 | out: | 2454 | out: |
2456 | free_extent_map(em); | 2455 | free_extent_map(em); |
2457 | return sector; | 2456 | return sector; |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 8e210616d702..7c10a90362ff 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -301,7 +301,8 @@ static int noinline dirty_and_release_pages(struct btrfs_trans_handle *trans, | |||
301 | */ | 301 | */ |
302 | inline_size = end_pos; | 302 | inline_size = end_pos; |
303 | if (isize >= BTRFS_MAX_INLINE_DATA_SIZE(root) || | 303 | if (isize >= BTRFS_MAX_INLINE_DATA_SIZE(root) || |
304 | inline_size > 8192 || | 304 | inline_size > root->fs_info->max_inline || |
305 | (inline_size & (root->sectorsize -1)) == 0 || | ||
305 | inline_size >= BTRFS_MAX_INLINE_DATA_SIZE(root)) { | 306 | inline_size >= BTRFS_MAX_INLINE_DATA_SIZE(root)) { |
306 | u64 last_end; | 307 | u64 last_end; |
307 | u64 existing_delalloc = 0; | 308 | u64 existing_delalloc = 0; |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index f8a1016600b1..a46300c4753a 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -64,7 +64,7 @@ static void btrfs_put_super (struct super_block * sb) | |||
64 | 64 | ||
65 | enum { | 65 | enum { |
66 | Opt_subvol, Opt_nodatasum, Opt_nodatacow, Opt_max_extent, | 66 | Opt_subvol, Opt_nodatasum, Opt_nodatacow, Opt_max_extent, |
67 | Opt_alloc_start, Opt_nobarrier, Opt_ssd, Opt_err, | 67 | Opt_max_inline, Opt_alloc_start, Opt_nobarrier, Opt_ssd, Opt_err, |
68 | }; | 68 | }; |
69 | 69 | ||
70 | static match_table_t tokens = { | 70 | static match_table_t tokens = { |
@@ -73,6 +73,7 @@ static match_table_t tokens = { | |||
73 | {Opt_nodatacow, "nodatacow"}, | 73 | {Opt_nodatacow, "nodatacow"}, |
74 | {Opt_nobarrier, "nobarrier"}, | 74 | {Opt_nobarrier, "nobarrier"}, |
75 | {Opt_max_extent, "max_extent=%s"}, | 75 | {Opt_max_extent, "max_extent=%s"}, |
76 | {Opt_max_inline, "max_inline=%s"}, | ||
76 | {Opt_alloc_start, "alloc_start=%s"}, | 77 | {Opt_alloc_start, "alloc_start=%s"}, |
77 | {Opt_ssd, "ssd"}, | 78 | {Opt_ssd, "ssd"}, |
78 | {Opt_err, NULL} | 79 | {Opt_err, NULL} |
@@ -178,6 +179,22 @@ static int parse_options (char * options, | |||
178 | } | 179 | } |
179 | } | 180 | } |
180 | break; | 181 | break; |
182 | case Opt_max_inline: | ||
183 | if (info) { | ||
184 | char *num = match_strdup(&args[0]); | ||
185 | if (num) { | ||
186 | info->max_inline = | ||
187 | btrfs_parse_size(num); | ||
188 | kfree(num); | ||
189 | |||
190 | info->max_inline = max_t(u64, | ||
191 | info->max_inline, | ||
192 | root->sectorsize); | ||
193 | printk("btrfs: max_inline at %Lu\n", | ||
194 | info->max_inline); | ||
195 | } | ||
196 | } | ||
197 | break; | ||
181 | case Opt_alloc_start: | 198 | case Opt_alloc_start: |
182 | if (info) { | 199 | if (info) { |
183 | char *num = match_strdup(&args[0]); | 200 | char *num = match_strdup(&args[0]); |