1. 11 4月, 2015 5 次提交
    • J
      f2fs: enhance multi-threads performance · 78373b73
      Jaegeuk Kim 提交于
      Previously, f2fs_write_data_pages has a mutex, sbi->writepages, to serialize
      data writes to maximize write bandwidth, while sacrificing multi-threads
      performance.
      Practically, however, multi-threads environment is much more important for
      users. So this patch tries to remove the mutex.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      78373b73
    • C
      f2fs: fix to truncate inline data past EOF · 0bfcfcca
      Chao Yu 提交于
      Previously if inode is with inline data, we will try to invalid partial inline
      data in page #0 when we truncate size of inode in truncate_partial_data_page().
      And then we set page #0 to dirty, after this we can synchronize inode page with
      page #0 at ->writepage().
      
      But sometimes we will fail to operate page #0 in truncate_partial_data_page()
      due to below reason:
      a) if offset is zero, we will skip setting page #0 to dirty.
      b) if page #0 is not uptodate, we will fail to update it as it has no mapping
      data.
      
      So with following operations, we will meet recent data which should be
      truncated.
      
      1.write inline data to file
      2.sync first data page to inode page
      3.truncate file size to 0
      4.truncate file size to max_inline_size
      5.echo 1 > /proc/sys/vm/drop_caches
      6.read file --> meet original inline data which is remained in inode page.
      
      This patch renames truncate_inline_data() to truncate_inline_inode() for code
      readability, then use truncate_inline_inode() to truncate inline data in inode
      page in truncate_blocks() and truncate page #0 in truncate_partial_data_page()
      for fixing.
      
      v2:
       o truncate partially #0 page in truncate_partial_data_page to avoid keeping
         old data in #0 page.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      0bfcfcca
    • C
      f2fs: add stat info for moved blocks by background gc · e1235983
      Changman Lee 提交于
      This patch is for looking into gc performance of f2fs in detail.
      Signed-off-by: NChangman Lee <cm224.lee@samsung.com>
      [Jaegeuk Kim: fix build errors]
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      e1235983
    • W
      f2fs: introduce macro __cp_payload · 55141486
      Wanpeng Li 提交于
      This patch introduce macro __cp_payload.
      Signed-off-by: NWanpeng Li <wanpeng.li@linux.intel.com>
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      55141486
    • J
      f2fs: support fs shutdown · 1abff93d
      Jaegeuk Kim 提交于
      This patch introduces a generic ioctl for fs shutdown, which was used by xfs.
      
      If this shutdown is triggered, filesystem stops any further IOs according to the
      following options.
      
      1. FS_GOING_DOWN_FULLSYNC
       : this will flush all the data and dentry blocks, and do checkpoint before
         shutdown.
      
      2. FS_GOING_DOWN_METASYNC
       : this will do checkpoint before shutdown.
      
      3. FS_GOING_DOWN_NOSYNC
       : this will trigger shutdown as is.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      1abff93d
  2. 04 3月, 2015 10 次提交
  3. 12 2月, 2015 10 次提交
    • J
      f2fs: fix sparse warnings · 29e7043f
      Jaegeuk Kim 提交于
      This patch resolves the following warnings.
      
      include/trace/events/f2fs.h:150:1: warning: expression using sizeof bool
      include/trace/events/f2fs.h:180:1: warning: expression using sizeof bool
      include/trace/events/f2fs.h:990:1: warning: expression using sizeof bool
      include/trace/events/f2fs.h:990:1: warning: expression using sizeof bool
      include/trace/events/f2fs.h:150:1: warning: odd constant _Bool cast (ffffffffffffffff becomes 1)
      include/trace/events/f2fs.h:180:1: warning: odd constant _Bool cast (ffffffffffffffff becomes 1)
      include/trace/events/f2fs.h:990:1: warning: odd constant _Bool cast (ffffffffffffffff becomes 1)
      include/trace/events/f2fs.h:990:1: warning: odd constant _Bool cast (ffffffffffffffff becomes 1)
      
      fs/f2fs/checkpoint.c:27:19: warning: symbol 'inode_entry_slab' was not declared. Should it be static?
      fs/f2fs/checkpoint.c:577:15: warning: cast to restricted __le32
      fs/f2fs/checkpoint.c:592:15: warning: cast to restricted __le32
      
      fs/f2fs/trace.c:19:1: warning: symbol 'pids' was not declared. Should it be static?
      fs/f2fs/trace.c:21:21: warning: symbol 'last_io' was not declared. Should it be static?
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      29e7043f
    • J
      f2fs: introduce a batched trim · bba681cb
      Jaegeuk Kim 提交于
      This patch introduces a batched trimming feature, which submits split discard
      commands.
      
      This is to avoid long latency due to huge trim commands.
      If fstrim was triggered ranging from 0 to the end of device, we should lock
      all the checkpoint-related mutexes, resulting in very long latency.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      bba681cb
    • C
      f2fs: merge {invalidate,release}page for meta/node/data pages · 487261f3
      Chao Yu 提交于
      This patch merges ->{invalidate,release}page function for meta/node/data pages.
      
      After this, duplication of codes could be removed.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      487261f3
    • J
      f2fs: show the number of writeback pages in stat · d24bdcbf
      Jaegeuk Kim 提交于
      This patch adds the # of writeback pages in stat info.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      d24bdcbf
    • J
      f2fs: split UMOUNT and FASTBOOT flags · 119ee914
      Jaegeuk Kim 提交于
      This patch adds FASTBOOT flag into checkpoint as follows.
      
       - CP_UMOUNT_FLAG is set when system is umounted.
       - CP_FASTBOOT_FLAG is set when intermediate checkpoint having node summaries
         was done.
      
      So, if you get CP_UMOUNT_FLAG from checkpoint, the system was umounted cleanly.
      Instead, if there was sudden-power-off, you can get CP_FASTBOOT_FLAG or nothing.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      119ee914
    • C
      f2fs: merge flags in struct f2fs_sb_info · caf0047e
      Chao Yu 提交于
      Currently, there are several variables with Boolean type as below:
      
      struct f2fs_sb_info {
      ...
      	int s_dirty;
      	bool need_fsck;
      	bool s_closing;
      ...
      	bool por_doing;
      ...
      }
      
      For this there are some issues:
      1. there are some space of f2fs_sb_info is wasted due to aligning after Boolean
         type variables by compiler.
      2. if we continuously add new flag into f2fs_sb_info, structure will be messed
         up.
      
      So in this patch, we try to:
      1. switch s_dirty to Boolean type variable since it has two status 0/1.
      2. merge s_dirty/need_fsck/s_closing/por_doing variables into s_flag.
      3. introduce an enum type which can indicate different states of sbi.
      4. use new introduced universal interfaces is_sbi_flag_set/{set,clear}_sbi_flag
         to operate flags for sbi.
      
      After that, above issues will be fixed.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      caf0047e
    • C
      f2fs: make truncate_inline_date static · feeb0deb
      Chao Yu 提交于
      1. make truncate_inline_date static;
      2. remove parameter @from of truncate_inline_date as callers only pass zero.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      feeb0deb
    • C
      f2fs: add F2FS_IOC_GETVERSION support · d49f3e89
      Chao Yu 提交于
      In this patch we add the FS_IOC_GETVERSION ioctl for getting i_generation from
      inode, after that, users can list file's generation number by using "lsattr -v".
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      d49f3e89
    • J
      f2fs: trigger correct checkpoint during umount · 30a5537f
      Jaegeuk Kim 提交于
      This patch fixes to trigger checkpoint with umount flag when kill_sb was called.
      In kill_sb, f2fs_sync_fs was finally called, but at this time, f2fs can't do
      checkpoint with CP_UMOUNT.
      After then, f2fs_put_super is not doing checkpoint, since it is not dirty.
      
      So, this patch adds a flag to indicate f2fs_sync_fs is called during umount.
      Reviewed-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      30a5537f
    • J
      f2fs: update memory footprint information · 6f0aacbc
      Jaegeuk Kim 提交于
      This patch adds missing memory usages, and splits them in detail.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      6f0aacbc
  4. 10 1月, 2015 9 次提交
  5. 09 12月, 2014 4 次提交
  6. 04 12月, 2014 1 次提交
    • J
      f2fs: use rw_semaphore for nat entry lock · 8b26ef98
      Jaegeuk Kim 提交于
      Previoulsy, we used rwlock for nat_entry lock.
      But, now we have a lot of complex operations in set_node_addr.
      (e.g., allocating kernel memories, handling radix_trees, and so on)
      
      So, this patches tries to change spinlock to rw_semaphore to give CPUs to other
      threads.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      8b26ef98
  7. 24 11月, 2014 1 次提交