1. 04 Dec, 2015 1 commit
  2. 09 Oct, 2015 3 commits
    • Chao Yu's avatar
      f2fs: use atomic64_t for extent cache hit stat · 5b7ee374
      Chao Yu authored
      
      
      Our hit stat of extent cache will increase all the time until remount,
      and we use atomic_t type for the stat variable, so it may easily incur
      overflow when we query extent cache frequently in a long time running
      fs.
      
      So to avoid that, this patch uses atomic64_t for hit stat variables.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      5b7ee374
    • Chao Yu's avatar
      f2fs: fix incorrect bimodal calculation · 1d7e10d5
      Chao Yu authored
      
      
      In update_sit_info, we use div_u64 to handle 'u64 divide u64' case, but
      div_u64 can only handle 32-bits divisor, so our divisor with u64 type
      passed to div_u64 will overflow, result in the wrong calculation when
      show debug info of f2fs as below:
      
      BDF: 464, avg. vblocks: 23509
      (BDF should never exceed 100)
      
      So change to use div64_u64 to handle this case correctly.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      1d7e10d5
    • Chao Yu's avatar
      f2fs: fix overflow of size calculation · 9edcdabf
      Chao Yu authored
      
      
      We have potential overflow issue when calculating size of object, when
      we left shift index with PAGE_CACHE_SHIFT bits, if type of index has only
      32-bits space in 32-bit architecture, left shifting will incur overflow,
      i.e:
      
      pgoff_t index =  0xFFFFFFFF;
      loff_t size = index << PAGE_CACHE_SHIFT;
      size: 0xFFFFF000
      
      So we should cast index with 64-bits type to avoid this issue.
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      9edcdabf
  3. 22 Aug, 2015 2 commits
  4. 05 Aug, 2015 2 commits
  5. 01 Jun, 2015 1 commit
    • Arnd Bergmann's avatar
      f2fs: fix building on 32-bit architectures · 7beb428e
      Arnd Bergmann authored
      
      
      A bug fix to the debug output extended the type of some local
      variables to 64-bit, which now causes the kernel to fail building
      because of missing 64-bit division functions:
      
      ERROR: "__aeabi_uldivmod" [fs/f2fs/f2fs.ko] undefined!
      
      In the kernel, we have to use div_u64 or do_div to do this,
      in order to annotate that this is an expensive operation.
      
      As the function is only called for debug out, we know this
      is not performance critical, so it is safe to use div_u64.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: d1f85bd38db19 ("f2fs: avoid value overflow in showing current status")
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      7beb428e
  6. 28 May, 2015 2 commits
  7. 10 Apr, 2015 1 commit
  8. 03 Mar, 2015 1 commit
  9. 12 Feb, 2015 4 commits
  10. 10 Jan, 2015 3 commits
  11. 08 Dec, 2014 2 commits
  12. 20 Nov, 2014 1 commit
    • Chao Yu's avatar
      f2fs: introduce struct inode_management to wrap inner fields · 67298804
      Chao Yu authored
      
      
      Now in f2fs, we have three inode cache: ORPHAN_INO, APPEND_INO, UPDATE_INO,
      and we manage fields related to inode cache separately in struct f2fs_sb_info
      for each inode cache type.
      This makes codes a bit messy, so that this patch intorduce a new struct
      inode_management to wrap inner fields as following which make codes more neat.
      
      /* for inner inode cache management */
      struct inode_management {
      	struct radix_tree_root ino_root;	/* ino entry array */
      	spinlock_t ino_lock;			/* for ino entry lock */
      	struct list_head ino_list;		/* inode list head */
      	unsigned long ino_num;			/* number of entries */
      };
      
      struct f2fs_sb_info {
      	...
      	struct inode_management im[MAX_INO_ENTRY];      /* manage inode cache */
      	...
      }
      Signed-off-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      67298804
  13. 06 Nov, 2014 1 commit
  14. 04 Nov, 2014 1 commit
  15. 30 Sep, 2014 1 commit
    • Jaegeuk Kim's avatar
      f2fs: check the use of macros on block counts and addresses · 7cd8558b
      Jaegeuk Kim authored
      
      
      This patch cleans up the existing and new macros for readability.
      
      Rule is like this.
      
               ,-----------------------------------------> MAX_BLKADDR -,
               |  ,------------- TOTAL_BLKS ----------------------------,
               |  |                                                     |
               |  ,- seg0_blkaddr   ,----- sit/nat/ssa/main blkaddress  |
      block    |  | (SEG0_BLKADDR)  | | | |   (e.g., MAIN_BLKADDR)      |
      address  0..x................ a b c d .............................
                  |                                                     |
      global seg# 0...................... m .............................
                  |                       |                             |
                  |                       `------- MAIN_SEGS -----------'
                  `-------------- TOTAL_SEGS ---------------------------'
                                          |                             |
       seg#                               0..........xx..................
      
      = Note =
       o GET_SEGNO_FROM_SEG0 : blk address -> global segno
       o GET_SEGNO           : blk address -> segno
       o START_BLOCK         : segno -> starting block address
      Reviewed-by: default avatarChao Yu <chao2.yu@samsung.com>
      Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
      7cd8558b
  16. 19 Aug, 2014 1 commit
  17. 29 Jul, 2014 1 commit
  18. 11 Jul, 2014 1 commit
  19. 20 Mar, 2014 1 commit
  20. 24 Feb, 2014 1 commit
  21. 17 Feb, 2014 1 commit
  22. 22 Jan, 2014 2 commits
  23. 20 Jan, 2014 1 commit
  24. 14 Jan, 2014 1 commit
  25. 06 Jan, 2014 1 commit
  26. 23 Dec, 2013 2 commits
  27. 30 Jul, 2013 1 commit