1. 28 12月, 2012 2 次提交
  2. 26 12月, 2012 1 次提交
    • J
      f2fs: remove set_page_dirty for atomic f2fs_end_io_write · dfb7c0ce
      Jaegeuk Kim 提交于
      We should guarantee not to do *scheduling while atomic*.
      I found, in atomic f2fs_end_io_write(), there is a set_page_dirty() call
      to deal with IO errors.
      
      But, set_page_dirty() calls:
       -> f2fs_set_data_page_dirty()
         -> set_dirty_dir_page()
            -> cond_resched() which results in scheduling.
      
      In order to avoid this, I'd like to remove simply set_page_dirty(),
      since the page is already marked as ERROR and f2fs will be operated
      as the read-only mode as well.
      So, there is no recovery issue with this.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      dfb7c0ce
  3. 11 12月, 2012 6 次提交
    • J
      f2fs: cleanup the f2fs_bio_alloc routine · 3cd8a239
      Jaegeuk Kim 提交于
      Do cleanup more for better code readability.
      
      - Change the parameter set of f2fs_bio_alloc()
        This function should allocate a bio only since it is not something like
        f2fs_bio_init(). Instead, the caller should initialize the allocated bio.
      
      - Introduce SECTOR_FROM_BLOCK
        This macro translates a block address to its sector address.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      Reviewed-by: NNamjae Jeon <namjae.jeon@samsung.com>
      3cd8a239
    • N
      f2fs: rewrite f2fs_bio_alloc to make it simpler · c212991a
      Namjae Jeon 提交于
      Since, GFP_NOFS(__GFP_WAIT) is used for allocation requests of bio in f2fs.
      So, there is no chance of returning NULL from the BIO allocation.
      
      Making the bio allocation routine for f2fs simpler.
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NAmit Sahrawat <a.sahrawat@samsung.com>
      c212991a
    • N
      f2fs: remove unneeded initialization · 1042d60f
      Namjae Jeon 提交于
      No need to initialize  "struct f2fs_gc_kthread *gc_th = NULL",
      as gc_th = NULL, will be taken care by the return values of kmalloc().
      And fix codes in other places.
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NAmit Sahrawat <a.sahrawat@samsung.com>
      1042d60f
    • J
      f2fs: adjust kernel coding style · 0a8165d7
      Jaegeuk Kim 提交于
      As pointed out by Randy Dunlap, this patch removes all usage of "/**" for comment
      blocks. Instead, just use "/*".
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      0a8165d7
    • J
      f2fs: fix endian conversion bugs reported by sparse · 25ca923b
      Jaegeuk Kim 提交于
      This patch should resolve the bugs reported by the sparse tool.
      Initial reports were written by "kbuild test robot" managed by fengguang.wu.
      
      In my local machines, I've tested also by running:
      > make C=2 CF="-D__CHECK_ENDIAN__"
      
      Accordingly, I've found lots of warnings and bugs related to the endian
      conversion. And I've fixed all at this moment.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      25ca923b
    • J
      f2fs: add segment operations · 351df4b2
      Jaegeuk Kim 提交于
      This adds specific functions not only to manage dirty/free segments, SIT pages,
      a cache for SIT entries, and summary entries, but also to allocate free blocks
      and write three types of pages: data, node, and meta.
      
      - F2FS maintains three types of bitmaps in memory, which indicate free, prefree,
        and dirty segments respectively.
      
      - The key information of an SIT entry consists of a segment number, the number
        of valid blocks in the segment, a bitmap to identify there-in valid or invalid
        blocks.
      
      - An SIT page is composed of a certain range of SIT entries, which is maintained
        by the address space of meta_inode.
      
      - To cache SIT entries, a simple array is used. The index for the array is the
        segment number.
      
      - A summary entry for data contains the parent node information. A summary entry
        for node contains its node offset from the inode.
      
      - F2FS manages information about six active logs and those summary entries in
        memory. Whenever one of them is changed, its summary entries are flushed to
        its SIT page maintained by the address space of meta_inode.
      
      - This patch adds a default block allocation function which supports heap-based
        allocation policy.
      
      - This patch adds core functions to write data, node, and meta pages. Since LFS
        basically produces a series of sequential writes, F2FS merges sequential bios
        with a single one as much as possible to reduce the IO scheduling overhead.
      Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
      351df4b2