diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 00:54:31 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 00:54:31 -0400 |
| commit | 81280572ca6f54009edfa4deee563e8678784218 (patch) | |
| tree | 4fac10bcb71261823d261e5f8551fdb16ab653ba | |
| parent | b83db1deb29eb4eea9bf5992431d26978e039ce6 (diff) | |
| parent | a107e5a3a473a2ea62bd5af24e11b84adf1486ff (diff) | |
Merge branch 'upstream-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
* 'upstream-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (50 commits)
ext4,jbd2: convert tracepoints to use major/minor numbers
ext4: optimize orphan_list handling for ext4_setattr
ext4: fix unbalanced mutex unlock in error path of ext4_li_request_new
ext4: fix compile error in ext4_fallocate()
ext4: move ext4_mb_{get,put}_buddy_cache_lock and make them static
ext4: rename mark_bitmap_end() to ext4_mark_bitmap_end()
ext4: move flush_completed_IO to fs/ext4/fsync.c and make it static
ext4: rename {ext,idx}_pblock and inline small extent functions
ext4: make various ext4 functions be static
ext4: rename {exit,init}_ext4_*() to ext4_{exit,init}_*()
ext4: fix kernel oops if the journal superblock has a non-zero j_errno
ext4: update writeback_index based on last page scanned
ext4: implement writeback livelock avoidance using page tagging
ext4: tidy up a void argument in inode.c
ext4: add batched_discard into ext4 feature list
ext4: Add batched discard support for ext4
fs: Add FITRIM ioctl
ext4: Use return value from sb_issue_discard()
ext4: Check return value of sb_getblk() and friends
ext4: use bio layer instead of buffer layer in mpage_da_submit_io
...
33 files changed, 2510 insertions, 1131 deletions
diff --git a/Documentation/filesystems/ext4.txt b/Documentation/filesystems/ext4.txt index e1def1786e50..6ab9442d7eeb 100644 --- a/Documentation/filesystems/ext4.txt +++ b/Documentation/filesystems/ext4.txt | |||
| @@ -353,6 +353,20 @@ noauto_da_alloc replacing existing files via patterns such as | |||
| 353 | system crashes before the delayed allocation | 353 | system crashes before the delayed allocation |
| 354 | blocks are forced to disk. | 354 | blocks are forced to disk. |
| 355 | 355 | ||
| 356 | noinit_itable Do not initialize any uninitialized inode table | ||
| 357 | blocks in the background. This feature may be | ||
| 358 | used by installation CD's so that the install | ||
| 359 | process can complete as quickly as possible; the | ||
| 360 | inode table initialization process would then be | ||
| 361 | deferred until the next time the file system | ||
| 362 | is unmounted. | ||
| 363 | |||
| 364 | init_itable=n The lazy itable init code will wait n times the | ||
| 365 | number of milliseconds it took to zero out the | ||
| 366 | previous block group's inode table. This | ||
| 367 | minimizes the impact on the systme performance | ||
| 368 | while file system's inode table is being initialized. | ||
| 369 | |||
| 356 | discard Controls whether ext4 should issue discard/TRIM | 370 | discard Controls whether ext4 should issue discard/TRIM |
| 357 | nodiscard(*) commands to the underlying block device when | 371 | nodiscard(*) commands to the underlying block device when |
| 358 | blocks are freed. This is useful for SSD devices | 372 | blocks are freed. This is useful for SSD devices |
diff --git a/fs/ext4/Makefile b/fs/ext4/Makefile index 8867b2a1e5fe..c947e36eda6c 100644 --- a/fs/ext4/Makefile +++ b/fs/ext4/Makefile | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | obj-$(CONFIG_EXT4_FS) += ext4.o | 5 | obj-$(CONFIG_EXT4_FS) += ext4.o |
| 6 | 6 | ||
| 7 | ext4-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o \ | 7 | ext4-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o page-io.o \ |
| 8 | ioctl.o namei.o super.o symlink.o hash.o resize.o extents.o \ | 8 | ioctl.o namei.o super.o symlink.o hash.o resize.o extents.o \ |
| 9 | ext4_jbd2.o migrate.o mballoc.o block_validity.o move_extent.o | 9 | ext4_jbd2.o migrate.o mballoc.o block_validity.o move_extent.o |
| 10 | 10 | ||
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index bd30799a43ed..14c3af26c671 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c | |||
| @@ -171,7 +171,8 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh, | |||
| 171 | * less than the blocksize * 8 ( which is the size | 171 | * less than the blocksize * 8 ( which is the size |
| 172 | * of bitmap ), set rest of the block bitmap to 1 | 172 | * of bitmap ), set rest of the block bitmap to 1 |
| 173 | */ | 173 | */ |
| 174 | mark_bitmap_end(group_blocks, sb->s_blocksize * 8, bh->b_data); | 174 | ext4_mark_bitmap_end(group_blocks, sb->s_blocksize * 8, |
| 175 | bh->b_data); | ||
| 175 | } | 176 | } |
| 176 | return free_blocks - ext4_group_used_meta_blocks(sb, block_group, gdp); | 177 | return free_blocks - ext4_group_used_meta_blocks(sb, block_group, gdp); |
| 177 | } | 178 | } |
| @@ -489,7 +490,7 @@ error_return: | |||
| 489 | * Check if filesystem has nblocks free & available for allocation. | 490 | * Check if filesystem has nblocks free & available for allocation. |
| 490 | * On success return 1, return 0 on failure. | 491 | * On success return 1, return 0 on failure. |
| 491 | */ | 492 | */ |
| 492 | int ext4_has_free_blocks(struct ext4_sb_info *sbi, s64 nblocks) | 493 | static int ext4_has_free_blocks(struct ext4_sb_info *sbi, s64 nblocks) |
| 493 | { | 494 | { |
| 494 | s64 free_blocks, dirty_blocks, root_blocks; | 495 | s64 free_blocks, dirty_blocks, root_blocks; |
| 495 | struct percpu_counter *fbc = &sbi->s_freeblocks_counter; | 496 | struct percpu_counter *fbc = &sbi->s_freeblocks_counter; |
diff --git a/fs/ext4/block_validity.c b/fs/ext4/block_validity.c index 3db5084db9bd..fac90f3fba80 100644 --- a/fs/ext4/block_validity.c +++ b/fs/ext4/block_validity.c | |||
| @@ -29,16 +29,15 @@ struct ext4_system_zone { | |||
| 29 | 29 | ||
| 30 | static struct kmem_cache *ext4_system_zone_cachep; | 30 | static struct kmem_cache *ext4_system_zone_cachep; |
| 31 | 31 | ||
| 32 | int __init init_ext4_system_zone(void) | 32 | int __init ext4_init_system_zone(void) |
| 33 | { | 33 | { |
| 34 | ext4_system_zone_cachep = KMEM_CACHE(ext4_system_zone, | 34 | ext4_system_zone_cachep = KMEM_CACHE(ext4_system_zone, 0); |
| 35 | SLAB_RECLAIM_ACCOUNT); | ||
| 36 | if (ext4_system_zone_cachep == NULL) | 35 | if (ext4_system_zone_cachep == NULL) |
| 37 | return -ENOMEM; | 36 | return -ENOMEM; |
| 38 | return 0; | 37 | return 0; |
| 39 | } | 38 | } |
| 40 | 39 | ||
| 41 | void exit_ext4_system_zone(void) | 40 | void ext4_exit_system_zone(void) |
| 42 | { | 41 | { |
| 43 | kmem_cache_destroy(ext4_system_zone_cachep); | 42 | kmem_cache_destroy(ext4_system_zone_cachep); |
| 44 | } | 43 | } |
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index 374510f72baa..ece76fb6a40c 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c | |||
| @@ -39,7 +39,7 @@ static int ext4_release_dir(struct inode *inode, | |||
| 39 | struct file *filp); | 39 | struct file *filp); |
| 40 | 40 | ||
| 41 | const struct file_operations ext4_dir_operations = { | 41 | const struct file_operations ext4_dir_operations = { |
| 42 | .llseek = generic_file_llseek, | 42 | .llseek = ext4_llseek, |
| 43 | .read = generic_read_dir, | 43 | .read = generic_read_dir, |
| 44 | .readdir = ext4_readdir, /* we take BKL. needed?*/ | 44 | .readdir = ext4_readdir, /* we take BKL. needed?*/ |
| 45 | .unlocked_ioctl = ext4_ioctl, | 45 | .unlocked_ioctl = ext4_ioctl, |
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 889ec9d5e6ad..8b5dd6369f82 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
| @@ -168,7 +168,20 @@ struct mpage_da_data { | |||
| 168 | int pages_written; | 168 | int pages_written; |
| 169 | int retval; | 169 | int retval; |
| 170 | }; | 170 | }; |
| 171 | #define EXT4_IO_UNWRITTEN 0x1 | 171 | |
| 172 | /* | ||
| 173 | * Flags for ext4_io_end->flags | ||
| 174 | */ | ||
| 175 | #define EXT4_IO_END_UNWRITTEN 0x0001 | ||
| 176 | #define EXT4_IO_END_ERROR 0x0002 | ||
| 177 | |||
| 178 | struct ext4_io_page { | ||
| 179 | struct page *p_page; | ||
| 180 | int p_count; | ||
| 181 | }; | ||
| 182 | |||
| 183 | #define MAX_IO_PAGES 128 | ||
| 184 | |||
| 172 | typedef struct ext4_io_end { | 185 | typedef struct ext4_io_end { |
| 173 | struct list_head list; /* per-file finished IO list */ | 186 | struct list_head list; /* per-file finished IO list */ |
| 174 | struct inode *inode; /* file being written to */ | 187 | struct inode *inode; /* file being written to */ |
| @@ -179,8 +192,18 @@ typedef struct ext4_io_end { | |||
| 179 | struct work_struct work; /* data work queue */ | 192 | struct work_struct work; /* data work queue */ |
| 180 | struct kiocb *iocb; /* iocb struct for AIO */ | 193 | struct kiocb *iocb; /* iocb struct for AIO */ |
| 181 | int result; /* error value for AIO */ | 194 | int result; /* error value for AIO */ |
| 195 | int num_io_pages; | ||
| 196 | struct ext4_io_page *pages[MAX_IO_PAGES]; | ||
