1. 07 May, 2014 1 commit
  2. 27 Feb, 2014 1 commit
    • Jaegeuk Kim's avatar
      f2fs: introduce large directory support · 38431545
      Jaegeuk Kim authored
      This patch introduces an i_dir_level field to support large directory.
      
      Previously, f2fs maintains multi-level hash tables to find a dentry quickly
      from a bunch of chiild dentries in a directory, and the hash tables consist of
      the following tree structure as below.
      
      In Documentation/filesystems/f2fs.txt,
      
      ----------------------
      A : bucket
      B : block
      N : MAX_DIR_HASH_DEPTH
      ----------------------
      
      level #0   | A(2B)
                 |
      level #1   | A(2B) - A(2B)
                 |
      level #2   | A(2B) - A(2B) - A(2B) - A(2B)
           .     |   .       .       .       .
      level #N/2 | A(2B) - A(2B) - A(2B) - A(2B) - A(2B) - ... - A(2B)
           .     |   .       .       .       .
      level #N   | A(4B) - A(4B) - A(4B) - A(4B) - A(4B) - ... - A(4B)
      
      But, if we can guess that a directory will handle a number of child files,
      we don't need to traverse the tree from level #0 to #N all the time.
      Since the lower level tables contain relatively small number of dentries,
      the miss ratio of the target dentry is likely to be high.
      
      In order to avoid that, we can configure the hash tables sparsely from level #0
      like this.
      
      level #0   | A(2B) - A(2B) - A(2B) - A(2B)
      
      level #1
      
         | A(2B) - A(2B) - A(2B) - A(2B) - A(2B) - ... - A(2B)
           .     |   .       .       .       .
      level #N/2 | A(2B) - A(2B) - A(2B) - A(2B) - A(2B) - ... - A(2B)
           .     |   .       .       .       .
      level #N   | A(4B) - A(4B) - A(4B) - A(4B) - A(4B) - ... - A(4B)
      
      With this structure, we can skip the ineffective tree searches in lower level
      hash tables.
      
      This patch adds just a facility for this by introducing i_dir_level in
      f2fs_inode.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      38431545
  3. 06 Jan, 2014 1 commit
    • Jaegeuk Kim's avatar
      f2fs: add inline_data recovery routine · 1e1bb4ba
      Jaegeuk Kim authored
      
      
      This patch adds a inline_data recovery routine with the following policy.
      
      [prev.] [next] of inline_data flag
         o       o  -> recover inline_data
         o       x  -> remove inline_data, and then recover data blocks
         x       o  -> remove inline_data, and then recover inline_data
         x       x  -> recover data blocks
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      1e1bb4ba
  4. 23 Dec, 2013 1 commit
    • Huajun Li's avatar
      f2fs: add flags and helpers to support inline data · 1001b347
      Huajun Li authored
      
      
      Add new inode flags F2FS_INLINE_DATA and FI_INLINE_DATA to indicate
      whether the inode has inline data.
      
      Inline data makes use of inode block's data indices region to save small
      file. Currently there are 923 data indices in an inode block. Since
      inline xattr has made use of the last 50 indices to save its data, there
      are 873 indices left which can be used for inline data. When
      FI_INLINE_DATA is set, the layout of inode block's indices region is
      like below:
      
      +-----------------+
      |                 | Reserved. reserve_new_block() will make use of
      | i_addr[0]       | i_addr[0] when we need to reserve a new data block
      |                 | to convert inline data into regular one's.
      |-----------------|
      |                 | Used by inline data. A file whose size is less than
      | i_addr[1~872]   | 3488 bytes(~3.4k) and doesn't reserve extra
      |                 | blocks by fallocate() can be saved here.
      |-----------------|
      |                 |
      | i_addr[873~922] | Reserved for inline xattr
      |                 |
      +-----------------+
      Signed-off-by: default avatarHaicheng Li <haicheng.li@linux.intel.com>
      Signed-off-by: default avatarHuajun Li <huajun.li@intel.com>
      Signed-off-by: default avatarWeihong Xu <weihong.xu@intel.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      1001b347
  5. 26 Aug, 2013 3 commits
    • Jaegeuk Kim's avatar
      f2fs: support the inline xattrs · 65985d93
      Jaegeuk Kim authored
      
      
      0. modified inode structure
      --------------------------------------
      metadata (e.g., i_mtime, i_ctime, etc)
      --------------------------------------
      direct pointers [0 ~ 873]
      
      inline xattrs (200 bytes by default)
      
      indirect pointers [0 ~ 4]
      --------------------------------------
      node footer
      --------------------------------------
      
      1. setxattr flow
       - read_all_xattrs copies all the xattrs from inline and xattr node block.
       - handle xattr entries
       - write_all_xattrs copies modified xattrs into inline and xattr node block.
      
      2. getxattr flow
       - read_all_xattrs copies all the xattrs from inline and xattr node block.
       - check target entries
      
      3. Usage
       # mount -t f2fs -o inline_xattr $DEV $MNT
      
       Once mounted with the inline_xattr option, f2fs marks all the newly created
       files to reserve an amount of inline xattr space explicitly inside the inode
       block. Without the mount option, f2fs will not touch any existing files and
       newly created files as well.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      65985d93
    • Jaegeuk Kim's avatar
      f2fs: reserve the xattr space dynamically · de93653f
      Jaegeuk Kim authored
      
      
      This patch enables the number of direct pointers inside on-disk inode block to
      be changed dynamically according to the size of inline xattr space.
      
      The number of direct pointers, ADDRS_PER_INODE, can be changed only if the file
      has inline xattr flag.
      
      The number of direct pointers that will be used by inline xattrs is defined as
      F2FS_INLINE_XATTR_ADDRS.
      Current patch assigns F2FS_INLINE_XATTR_ADDRS to 0 temporarily.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      de93653f
    • Jaegeuk Kim's avatar
      f2fs: add flags for inline xattrs · 444c580f
      Jaegeuk Kim authored
      
      
      This patch adds basic inode flags for inline xattrs, F2FS_INLINE_XATTR,
      and add a mount option, inline_xattr, which is enabled when xattr is set.
      
      If the mount option is enabled, all the files are marked with the inline_xattrs
      flag.
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
      444c580f
  6. 28 May, 2013 1 commit
  7. 18 Mar, 2013 1 commit
  8. 11 Dec, 2012 3 commits