1. 07 10月, 2014 1 次提交
    • J
      f2fs: support atomic writes · 88b88a66
      Jaegeuk Kim 提交于
      This patch introduces a very limited functionality for atomic write support.
      In order to support atomic write, this patch adds two ioctls:
       o F2FS_IOC_START_ATOMIC_WRITE
       o F2FS_IOC_COMMIT_ATOMIC_WRITE
      
      The database engine should be aware of the following sequence.
      1. open
       -> ioctl(F2FS_IOC_START_ATOMIC_WRITE);
      2. writes
        : all the written data will be treated as atomic pages.
      3. commit
       -> ioctl(F2FS_IOC_COMMIT_ATOMIC_WRITE);
        : this flushes all the data blocks to the disk, which will be shown all or
        nothing by f2fs recovery procedure.
      4. repeat to #2.
      
      The IO pattens should be:
      
        ,- START_ATOMIC_WRITE                  ,- COMMIT_ATOMIC_WRITE
       CP | D D D D D D | FSYNC | D D D D | FSYNC ...
                            `- COMMIT_ATOMIC_WRITE
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      88b88a66
  2. 24 9月, 2014 4 次提交
    • C
      f2fs: support large sector size · 55cf9cb6
      Chao Yu 提交于
      Block size in f2fs is 4096 bytes, so theoretically, f2fs can support 4096 bytes
      sector device at maximum. But now f2fs only support 512 bytes size sector, so
      block device such as zRAM which uses page cache as its block storage space will
      not be mounted successfully as mismatch between sector size of zRAM and sector
      size of f2fs supported.
      
      In this patch we support large sector size in f2fs, so block device with sector
      size of 512/1024/2048/4096 bytes can be supported in f2fs.
      Signed-off-by: NChao Yu <chao2.yu@samsung.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      55cf9cb6
    • J
      f2fs: update i_size when __allocate_data_block · 976e4c50
      Jaegeuk Kim 提交于
      The f2fs_direct_IO uses __allocate_data_block, but inside the allocation path,
      we should update i_size at the changed time to update its inode page.
      Otherwise, we can get wrong i_size after roll-forward recovery.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      976e4c50
    • J
      f2fs: use MAX_BIO_BLOCKS(sbi) · 90a893c7
      Jaegeuk Kim 提交于
      This patch cleans up a simple macro.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      90a893c7
    • J
      f2fs: fix conditions to remain recovery information in f2fs_sync_file · 88bd02c9
      Jaegeuk Kim 提交于
      This patch revisited whole the recovery information during the f2fs_sync_file.
      
      In this patch, there are three information to make a decision.
      
      a) IS_CHECKPOINTED,	/* is it checkpointed before? */
      b) HAS_FSYNCED_INODE,	/* is the inode fsynced before? */
      c) HAS_LAST_FSYNC,	/* has the latest node fsync mark? */
      
      And, the scenarios for our rule are based on:
      
      [Term] F: fsync_mark, D: dentry_mark
      
      1. inode(x) | CP | inode(x) | dnode(F)
      2. inode(x) | CP | inode(F) | dnode(F)
      3. inode(x) | CP | dnode(F) | inode(x) | inode(F)
      4. inode(x) | CP | dnode(F) | inode(F)
      5. CP | inode(x) | dnode(F) | inode(DF)
      6. CP | inode(DF) | dnode(F)
      7. CP | dnode(F) | inode(DF)
      8. CP | dnode(F) | inode(x) | inode(DF)
      
      For example, #3, the three conditions should be changed as follows.
      
         inode(x) | CP | dnode(F) | inode(x) | inode(F)
      a)    x       o      o          o          o
      b)    x       x      x          x          o
      c)    x       o      o          x          o
      
      If f2fs_sync_file stops   ------^,
       it should write inode(F)    --------------^
      
      So, the need_inode_block_update should return true, since
       c) get_nat_flag(e, HAS_LAST_FSYNC), is false.
      
      For example, #8,
            CP | alloc | dnode(F) | inode(x) | inode(DF)
      a)    o      x        x          x          x
      b)    x               x          x          o
      c)    o               o          x          o
      
      If f2fs_sync_file stops   -------^,
       it should write inode(DF)    --------------^
      
      Note that, the roll-forward policy should follow this rule, which means,
      if there are any missing blocks, we doesn't need to recover that inode.
      Signed-off-by: NHuang Ying <ying.huang@intel.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      88bd02c9
  3. 16 9月, 2014 1 次提交
  4. 10 9月, 2014 1 次提交
  5. 04 9月, 2014 1 次提交
  6. 22 8月, 2014 2 次提交
    • J
      f2fs: avoid double lock in truncate_blocks · 764aa3e9
      Jaegeuk Kim 提交于
      The init_inode_metadata calls truncate_blocks when error is occurred.
      The callers holds f2fs_lock_op, so we should not call it again in
      truncate_blocks.
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      764aa3e9
    • J
      f2fs: handle EIO not to break fs consistency · cf779cab
      Jaegeuk Kim 提交于
      There are two rules when EIO is occurred.
      1. don't write any checkpoint data to preserve the previous checkpoint
      2. don't lose the cached dentry/node/meta pages
      
      So, at first, this patch adds set_page_dirty in f2fs_write_end_io's failure.
      Then, writing checkpoint/dentry/node blocks is not allowed.
      
      Note that, for the data pages, we can't just throw away by redirtying them.
      Otherwise, kworker can fall into infinite loop to flush them.
      (Ref. xfstests/019)
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      cf779cab
  7. 20 8月, 2014 2 次提交
  8. 02 8月, 2014 1 次提交
  9. 29 7月, 2014 2 次提交
  10. 25 7月, 2014 1 次提交
  11. 10 7月, 2014 2 次提交
  12. 23 6月, 2014 1 次提交
  13. 08 6月, 2014 1 次提交
  14. 04 6月, 2014 1 次提交
  15. 07 5月, 2014 15 次提交
  16. 02 4月, 2014 1 次提交
  17. 01 4月, 2014 1 次提交
  18. 18 3月, 2014 2 次提交