1. 07 4月, 2009 2 次提交
    • R
      nilfs2: avoid double error caused by nilfs_transaction_end · 47420c79
      Ryusuke Konishi 提交于
      Pekka Enberg pointed out that double error handlings found after
      nilfs_transaction_end() can be avoided by separating abort operation:
      
       OK, I don't understand this. The only way nilfs_transaction_end() can
       fail is if we have NILFS_TI_SYNC set and we fail to construct the
       segment. But why do we want to construct a segment if we don't commit?
      
       I guess what I'm asking is why don't we have a separate
       nilfs_transaction_abort() function that can't fail for the erroneous
       case to avoid this double error value tracking thing?
      
      This does the separation and renames nilfs_transaction_end() to
      nilfs_transaction_commit() for clarification.
      
      Since, some calls of these functions were used just for exclusion control
      against the segment constructor, they are replaced with semaphore
      operations.
      Acked-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      47420c79
    • R
      nilfs2: add inode and other major structures · 65b4643d
      Ryusuke Konishi 提交于
      This adds the following common structures of the NILFS2 file system.
      
      * nilfs_inode_info structure:
        gives on-memory inode.
      
      * nilfs_sb_info structure:
        keeps per-mount state and a special inode for the ifile.
        This structure is attached to the super_block structure.
      
      * the_nilfs structure:
        keeps shared state and locks among a read/write mount and snapshot
        mounts.  This keeps special inodes for the sufile, cpfile, dat, and
        another dat inode used during GC (gcdat).  This also has a hash table
        of dummy inodes to cache disk blocks during GC (gcinodes).
      
      * nilfs_transaction_info structure:
        keeps per task state while nilfs is writing logs or doing indivisible
        inode or namespace operations.  This structure is used to identify
        context during log making and store nest level of the lock which
        ensures atomicity of file system operations.
      Signed-off-by: NKoji Sato <sato.koji@lab.ntt.co.jp>
      Signed-off-by: NRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      65b4643d