1. 12 Jun, 2015 1 commit
    • Chao Yu's avatar
      f2fs: do not trim preallocated blocks when truncating after i_size · 3c454145
      Chao Yu authored
      When we perform generic/092 in xfstests, output is like below:
      
           XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
           0: [0..10239]: data
           0: [0..10239]: data
          -1: [10240..20479]: unwritten
          +1: [10240..14335]: unwritten
      
      This is because with this testcase, we redefine the regulation for
      truncate in perallocated space past i_size as below:
      
      "There was some confused about what the fs was supposed to do when you
      truncate at i_size with preallocated space past i_size. We decided on the
      following things.
      
      1) truncate(i_size) will trim all blocks past i_size.
      2) truncate(x) where x > i_size will not trim all blocks past i_size.
      "
      
      This method is used in xfs, and then ext4/btrfs will follow the rule.
      
      This patch fixes to follow the new rule for f2fs.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      3c454145
  2. 11 Jun, 2015 2 commits
  3. 09 Jun, 2015 1 commit
  4. 08 Jun, 2015 2 commits
  5. 02 Jun, 2015 3 commits
    • Jaegeuk Kim's avatar
      f2fs: fix to return exact trimmed size · f56aa1c5
      Jaegeuk Kim authored
      Now, we add all the candidates for trim commands and then finally issue
      discard commands.
      So, we should count the trimmed size in back-end.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      f56aa1c5
    • Chao Yu's avatar
      f2fs: support FALLOC_FL_INSERT_RANGE · f62185d0
      Chao Yu authored
      FALLOC_FL_INSERT_RANGE flag for ->fallocate was introduced in commit
      dd46c787 ("fs: Add support FALLOC_FL_INSERT_RANGE for fallocate").
      
      The effect of FALLOC_FL_INSERT_RANGE command is the opposite of
      FALLOC_FL_COLLAPSE_RANGE, if this command was performed, all data from
      offset to EOF in our file will be shifted to right as given length, and
      then range [offset, offset + length] becomes a hole.
      
      This command is useful for our user who wants to add some data in the
      middle of the file, for example: video/music editor will insert a keyframe
      in specified position of media file, with this command we can easily create
      a hole for inserting without removing original data.
      
      This patch introduces f2fs_insert_range() to support FALLOC_FL_INSERT_RANGE.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarYuan Zhong <yuan.mark.zhong@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      f62185d0
    • Chao Yu's avatar
      f2fs: hide common code in f2fs_replace_block · 528e3459
      Chao Yu authored
      This patch clean up codes through:
      1.rename f2fs_replace_block to __f2fs_replace_block().
      2.introduce new f2fs_replace_block() to include __f2fs_replace_block()
      and some common related codes around __f2fs_replace_block().
      
      Then, newly introduced function f2fs_replace_block can be used by
      following patch.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      528e3459
  6. 01 Jun, 2015 27 commits
  7. 28 May, 2015 4 commits