aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-18 11:17:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-18 11:17:20 -0400
commit06a60deca87dba8e2c186ea7f12ea87d6785188e (patch)
tree2a6c8de6a7b110d13a1c1e3fc07cdc9065dfd749
parentd6a24d0640d609138a4e40a4ce9fd9fe7859e24c (diff)
parent10027551ccf5459cc771c31ac8bc8e5cc8db45f8 (diff)
Merge tag 'for-f2fs-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs
Pull f2fs updates from Jaegeuk Kim: "New features: - in-memory extent_cache - fs_shutdown to test power-off-recovery - use inline_data to store symlink path - show f2fs as a non-misc filesystem Major fixes: - avoid CPU stalls on sync_dirty_dir_inodes - fix some power-off-recovery procedure - fix handling of broken symlink correctly - fix missing dot and dotdot made by sudden power cuts - handle wrong data index during roll-forward recovery - preallocate data blocks for direct_io ... and a bunch of minor bug fixes and cleanups" * tag 'for-f2fs-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (71 commits) f2fs: pass checkpoint reason on roll-forward recovery f2fs: avoid abnormal behavior on broken symlink f2fs: flush symlink path to avoid broken symlink after POR f2fs: change 0 to false for bool type f2fs: do not recover wrong data index f2fs: do not increase link count during recovery f2fs: assign parent's i_mode for empty dir f2fs: add F2FS_INLINE_DOTS to recover missing dot dentries f2fs: fix mismatching lock and unlock pages for roll-forward recovery f2fs: fix sparse warnings f2fs: limit b_size of mapped bh in f2fs_map_bh f2fs: persist system.advise into on-disk inode f2fs: avoid NULL pointer dereference in f2fs_xattr_advise_get f2fs: preallocate fallocated blocks for direct IO f2fs: enable inline data by default f2fs: preserve extent info for extent cache f2fs: initialize extent tree with on-disk extent info of inode f2fs: introduce __{find,grab}_extent_tree f2fs: split set_data_blkaddr from f2fs_update_extent_cache f2fs: enable fast symlink by utilizing inline data ...
-rw-r--r--Documentation/filesystems/f2fs.txt6
-rw-r--r--fs/Kconfig2
-rw-r--r--fs/f2fs/Kconfig2
-rw-r--r--fs/f2fs/acl.c14
-rw-r--r--fs/f2fs/checkpoint.c38
-rw-r--r--fs/f2fs/data.c742
-rw-r--r--fs/f2fs/debug.c22
-rw-r--r--fs/f2fs/dir.c93
-rw-r--r--fs/f2fs/f2fs.h174
-rw-r--r--fs/f2fs/file.c64
-rw-r--r--fs/f2fs/gc.c6
-rw-r--r--fs/f2fs/inline.c69
-rw-r--r--fs/f2fs/inode.c25
-rw-r--r--fs/f2fs/namei.c81
-rw-r--r--fs/f2fs/node.c18
-rw-r--r--fs/f2fs/node.h1
-rw-r--r--fs/f2fs/recovery.c76
-rw-r--r--fs/f2fs/segment.c17
-rw-r--r--fs/f2fs/segment.h3
-rw-r--r--fs/f2fs/super.c40
-rw-r--r--fs/f2fs/xattr.c4
-rw-r--r--include/linux/f2fs_fs.h3
-rw-r--r--include/trace/events/f2fs.h162
23 files changed, 1399 insertions, 263 deletions
diff --git a/Documentation/filesystems/f2fs.txt b/Documentation/filesystems/f2fs.txt
index dac11d7fef27..e9e750e59efc 100644
--- a/Documentation/filesystems/f2fs.txt
+++ b/Documentation/filesystems/f2fs.txt
@@ -140,6 +140,12 @@ nobarrier This option can be used if underlying storage guarantees
140fastboot This option is used when a system wants to reduce mount 140fastboot This option is used when a system wants to reduce mount
141 time as much as possible, even though normal performance 141 time as much as possible, even though normal performance
142 can be sacrificed. 142 can be sacrificed.
143extent_cache Enable an extent cache based on rb-tree, it can cache
144 as many as extent which map between contiguous logical
145 address and physical address per inode, resulting in
146 increasing the cache hit ratio.
147noinline_data Disable the inline data feature, inline data feature is
148 enabled by default.
143 149
144================================================================================ 150================================================================================
145DEBUGFS ENTRIES 151DEBUGFS ENTRIES
diff --git a/fs/Kconfig b/fs/Kconfig
index ec35851e5b71..011f43365d7b 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -32,6 +32,7 @@ source "fs/gfs2/Kconfig"
32source "fs/ocfs2/Kconfig" 32source "fs/ocfs2/Kconfig"
33source "fs/btrfs/Kconfig" 33source "fs/btrfs/Kconfig"
34source "fs/nilfs2/Kconfig" 34source "fs/nilfs2/Kconfig"
35source "fs/f2fs/Kconfig"
35 36
36config FS_DAX 37config FS_DAX
37 bool "Direct Access (DAX) support" 38 bool "Direct Access (DAX) support"
@@ -217,7 +218,6 @@ source "fs/pstore/Kconfig"
217source "fs/sysv/Kconfig" 218source "fs/sysv/Kconfig"
218source "fs/ufs/Kconfig" 219source "fs/ufs/Kconfig"
219source "fs/exofs/Kconfig" 220source "fs/exofs/Kconfig"
220source "fs/f2fs/Kconfig"
221 221
222endif # MISC_FILESYSTEMS 222endif # MISC_FILESYSTEMS
223 223
diff --git a/fs/f2fs/Kconfig b/fs/f2fs/Kconfig
index 94e2d2ffabe1..05f0f663f14c 100644
--- a/fs/f2fs/Kconfig
+++ b/fs/f2fs/Kconfig
@@ -1,5 +1,5 @@
1config F2FS_FS 1config F2FS_FS
2 tristate "F2FS filesystem support (EXPERIMENTAL)" 2 tristate "F2FS filesystem support"
3 depends on BLOCK 3 depends on BLOCK
4 help 4 help
5 F2FS is based on Log-structured File System (LFS), which supports 5 F2FS is based on Log-structured File System (LFS), which supports
diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c
index 742202779bd5..4320ffab3495 100644
--- a/fs/f2fs/acl.c
+++ b/fs/f2fs/acl.c
@@ -351,13 +351,11 @@ static int f2fs_acl_create(struct inode *dir, umode_t *mode,
351 351
352 *acl = f2fs_acl_clone(p, GFP_NOFS); 352 *acl = f2fs_acl_clone(p, GFP_NOFS);
353 if (!*acl) 353 if (!*acl)
354 return -ENOMEM; 354 goto no_mem;
355 355
356 ret = f2fs_acl_create_masq(*acl, mode); 356 ret = f2fs_acl_create_masq(*acl, mode);
357 if (ret < 0) { 357 if (ret < 0)
358 posix_acl_release(*acl); 358 goto no_mem_clone;
359 return -ENOMEM;
360 }
361 359
362 if (ret == 0) { 360 if (ret == 0) {
363 posix_acl_release(*acl); 361 posix_acl_release(*acl);
@@ -378,6 +376,12 @@ no_acl:
378 *default_acl = NULL; 376 *default_acl = NULL;
379 *acl = NULL; 377 *acl = NULL;
380 return 0; 378 return 0;
379
380no_mem_clone:
381 posix_acl_release(*acl);
382no_mem:
383 posix_acl_release(p);
384 return -ENOMEM;
381} 385}
382 386
383int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage, 387int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage,
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 7f794b72b3b7..a5e17a2a0781 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -276,7 +276,7 @@ continue_unlock:
276 if (!clear_page_dirty_for_io(page)) 276 if (!clear_page_dirty_for_io(page))
277 goto continue_unlock; 277 goto continue_unlock;
278 278
279 if (f2fs_write_meta_page(page, &wbc)) { 279 if (mapping->a_ops->writepage(page, &wbc)) {
280 unlock_page(page); 280 unlock_page(page);
281 break; 281 break;
282 } 282 }
@@ -464,20 +464,19 @@ static void recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino)
464 464
465void recover_orphan_inodes(struct f2fs_sb_info *sbi) 465void recover_orphan_inodes(struct f2fs_sb_info *sbi)
466{ 466{
467 block_t start_blk, orphan_blkaddr, i, j; 467 block_t start_blk, orphan_blocks, i, j;
468 468
469 if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG)) 469 if (!is_set_ckpt_flags(F2FS_CKPT(sbi), CP_ORPHAN_PRESENT_FLAG))
470 return; 470 return;
471 471
472 set_sbi_flag(sbi, SBI_POR_DOING); 472 set_sbi_flag(sbi, SBI_POR_DOING);
473 473
474 start_blk = __start_cp_addr(sbi) + 1 + 474 start_blk = __start_cp_addr(sbi) + 1 + __cp_payload(sbi);
475 le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_payload); 475 orphan_blocks = __start_sum_addr(sbi) - 1 - __cp_payload(sbi);
476 orphan_blkaddr = __start_sum_addr(sbi) - 1;
477 476
478 ra_meta_pages(sbi, start_blk, orphan_blkaddr, META_CP); 477 ra_meta_pages(sbi, start_blk, orphan_blocks, META_CP);
479 478
480 for (i = 0; i < orphan_blkaddr; i++) { 479 for (i = 0; i < orphan_blocks; i++) {
481 struct page *page = get_meta_page(sbi, start_blk + i); 480 struct page *page = get_meta_page(sbi, start_blk + i);
482 struct f2fs_orphan_block *orphan_blk; 481 struct f2fs_orphan_block *orphan_blk;
483 482
@@ -615,7 +614,7 @@ int get_valid_checkpoint(struct f2fs_sb_info *sbi)
615 unsigned long blk_size = sbi->blocksize; 614 unsigned long blk_size = sbi->blocksize;
616 unsigned long long cp1_version = 0, cp2_version = 0; 615 unsigned long long cp1_version = 0, cp2_version = 0;
617 unsigned long long cp_start_blk_no; 616 unsigned long long cp_start_blk_no;
618 unsigned int cp_blks = 1 + le32_to_cpu(F2FS_RAW_SUPER(sbi)->cp_payload); 617 unsigned int cp_blks = 1 + __cp_payload(sbi);
619 block_t cp_blk_no; 618 block_t cp_blk_no;
620 int i; 619 int i;
621 620
@@ -796,6 +795,7 @@ retry:
796 * wribacking dentry pages in the freeing inode. 795 * wribacking dentry pages in the freeing inode.
797 */ 796 */
798 f2fs_submit_merged_bio(sbi, DATA, WRITE); 797 f2fs_submit_merged_bio(sbi, DATA, WRITE);
798 cond_resched();
799 } 799 }
800 goto retry; 800 goto retry;
801} 801}
@@ -884,7 +884,7 @@ static void do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
884 __u32 crc32 = 0; 884 __u32 crc32 = 0;
885 void *kaddr; 885