1. 03 2月, 2009 1 次提交
  2. 09 1月, 2009 1 次提交
  3. 06 1月, 2009 13 次提交
    • T
      ocfs2: Access the right buffer_head in ocfs2_merge_rec_left. · 9047beab
      Tao Ma 提交于
      In commit "ocfs2: Use metadata-specific ocfs2_journal_access_*()
      functions", the wrong buffer_head is accessed. So change it
      to the right buffer_head.
      Signed-off-by: NTao Ma <tao.ma@oracle.com>
      Acked-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      9047beab
    • J
      ocfs2: Create ocfs2_xattr_value_buf. · 2a50a743
      Joel Becker 提交于
      When an ocfs2 extended attribute is large enough to require its own
      allocation tree, we root it with an ocfs2_xattr_value_root.  However,
      these roots can be a part of inodes, xattr blocks, or xattr buckets.
      Thus, they need a different journal access function for each container.
      
      We wrap the bh, its journal access function, and the value root (xv) in
      a structure called ocfs2_xattr_valu_buf.  This is a package that can
      be passed around.  In this first pass, we simply pass it to the
      extent tree code.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      2a50a743
    • J
      ocfs2: Use metadata-specific ocfs2_journal_access_*() functions. · 13723d00
      Joel Becker 提交于
      The per-metadata-type ocfs2_journal_access_*() functions hook up jbd2
      commit triggers and allow us to compute metadata ecc right before the
      buffers are written out.  This commit provides ecc for inodes, extent
      blocks, group descriptors, and quota blocks.  It is not safe to use
      extened attributes and metaecc at the same time yet.
      
      The ocfs2_extent_tree and ocfs2_path abstractions in alloc.c both hide
      the type of block at their root.  Before, it didn't matter, but now the
      root block must use the appropriate ocfs2_journal_access_*() function.
      To keep this abstract, the structures now have a pointer to the matching
      journal_access function and a wrapper call to call it.
      
      A few places use naked ocfs2_write_block() calls instead of adding the
      blocks to the journal.  We make sure to calculate their checksum and ecc
      before the write.
      
      Since we pass around the journal_access functions.  Let's typedef them
      in ocfs2.h.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      13723d00
    • J
      ocfs2: Wrap up the common use cases of ocfs2_new_path(). · ffdd7a54
      Joel Becker 提交于
      The majority of ocfs2_new_path() calls are:
      
      	ocfs2_new_path(path_root_bh(otherpath),
      		       path_root_el(otherpath));
      
      Let's call that ocfs2_new_path_from_path().  The rest do similar things
      from struct ocfs2_extent_tree.  Let's call those
      ocfs2_new_path_from_et().  This will make the next change easier.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      ffdd7a54
    • J
      ocfs2: block read meta ecc. · d6b32bbb
      Joel Becker 提交于
      Add block check calls to the read_block validate functions.  This is the
      almost all of the read-side checking of metaecc.  xattr buckets are not checked
      yet.   Writes are also unchecked, and so a read-write mount will quickly fail.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      d6b32bbb
    • J
      ocfs2: Add quota calls for allocation and freeing of inodes and space · a90714c1
      Jan Kara 提交于
      Add quota calls for allocation and freeing of inodes and space, also update
      estimates on number of needed credits for a transaction. Move out inode
      allocation from ocfs2_mknod_locked() because vfs_dq_init() must be called
      outside of a transaction.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      a90714c1
    • M
      ocfs2: Remove JBD compatibility layer · 53ef99ca
      Mark Fasheh 提交于
      JBD2 is fully backwards compatible with JBD and it's been tested enough with
      Ocfs2 that we can clean this code up now.
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      53ef99ca
    • J
      ocfs2: Validate metadata only when it's read from disk. · 970e4936
      Joel Becker 提交于
      Add an optional validation hook to ocfs2_read_blocks().  Now the
      validation function is only called when a block was actually read off of
      disk.  It is not called when the buffer was in cache.
      
      We add a buffer state bit BH_NeedsValidate to flag these buffers.  It
      must always be one higher than the last JBD2 buffer state bit.
      
      The dinode, dirblock, extent_block, and xattr_block validators are
      lifted to this scheme directly.  The group_descriptor validator needs to
      be split into two pieces.  The first part only needs the gd buffer and
      is passed to ocfs2_read_block().  The second part requires the dinode as
      well, and is called every time.  It's only 3 compares, so it's tiny.
      This also allows us to clean up the non-fatal gd check used by resize.c.
      It now has no magic argument.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      970e4936
    • J
      ocfs2: Wrap extent block reads in a dedicated function. · 5e96581a
      Joel Becker 提交于
      We weren't consistently checking extent blocks after we read them.
      Most places checked the signature, but none checked h_blkno or
      h_fs_signature.  Create a toplevel ocfs2_read_extent_block() that does
      the read and the validation.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      5e96581a
    • J
      ocfs2: Morph the haphazard OCFS2_IS_VALID_DINODE() checks. · 10995aa2
      Joel Becker 提交于
      Random places in the code would check a dinode bh to see if it was
      valid.  Not only did they do different levels of validation, they
      handled errors in different ways.
      
      The previous commit unified inode block reads, validating all block
      reads in the same place.  Thus, these haphazard checks are no longer
      necessary.  Rather than eliminate them, however, we change them to
      BUG_ON() checks.  This ensures the assumptions remain true.  All of the
      code paths to these checks have been audited to ensure they come from a
      validated inode read.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      10995aa2
    • J
      ocfs2: Wrap inode block reads in a dedicated function. · b657c95c
      Joel Becker 提交于
      The ocfs2 code currently reads inodes off disk with a simple
      ocfs2_read_block() call.  Each place that does this has a different set
      of sanity checks it performs.  Some check only the signature.  A couple
      validate the block number (the block read vs di->i_blkno).  A couple
      others check for VALID_FL.  Only one place validates i_fs_generation.  A
      couple check nothing.  Even when an error is found, they don't all do
      the same thing.
      
      We wrap inode reading into ocfs2_read_inode_block().  This will validate
      all the above fields, going readonly if they are invalid (they never
      should be).  ocfs2_read_inode_block_full() is provided for the places
      that want to pass read_block flags.  Every caller is passing a struct
      inode with a valid ip_blkno, so we don't need a separate blkno argument
      either.
      
      We will remove the validation checks from the rest of the code in a
      later commit, as they are no longer necessary.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      b657c95c
    • M
      ocfs2: turn __ocfs2_remove_inode_range() into ocfs2_remove_btree_range() · fecc0112
      Mark Fasheh 提交于
      This patch genericizes the high level handling of extent removal.
      ocfs2_remove_btree_range() is nearly identical to
      __ocfs2_remove_inode_range(), except that extent tree operations have been
      used where necessary. We update ocfs2_remove_inode_range() to use the
      generic helper. Now extent tree based structures have an easy way to
      truncate ranges.
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      Acked-by: NJoel Becker <joel.becker@oracle.com>
      fecc0112
    • T
      ocfs2: Add clusters free in dealloc_ctxt. · 2891d290
      Tao Ma 提交于
      Now in ocfs2 xattr set, the whole process are divided into many small
      parts and they are wrapped into diffrent transactions and it make the
      set doesn't look like a real transaction. So we want to integrate it
      into a real one.
      
      In some cases we will allocate some clusters and free some in just one
      transaction. e.g, one xattr is larger than inline size, so it and its
      value root is stored within the inode while the value is outside in a
      cluster. Then we try to update it with a smaller value(larger than the
      size of root but smaller than inline size), we may need to free the
      outside cluster while allocate a new bucket(one cluster) since now the
      inode may be full. The old solution will lock the global_bitmap(if the
      local alloc failed in stress test) and then the truncate log. This will
      cause a ABBA lock with truncate log flush.
      
      This patch add the clusters free in dealloc_ctxt, so that we can record
      the free clusters during the transaction and then free it after we
      release the global_bitmap in xattr set.
      Signed-off-by: NTao Ma <tao.ma@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      2891d290
  4. 15 10月, 2008 2 次提交
  5. 14 10月, 2008 22 次提交
  6. 04 10月, 2008 1 次提交
    • M
      ocfs2: fiemap support · 00dc417f
      Mark Fasheh 提交于
      Plug ocfs2 into ->fiemap. Some portions of ocfs2_get_clusters() had to be
      refactored so that the extent cache can be skipped in favor of going
      directly to the on-disk records. This makes it easier for us to determine
      which extent is the last one in the btree. Also, I'm not sure we want to be
      caching fiemap lookups anyway as they're not directly related to data
      read/write.
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Cc: ocfs2-devel@oss.oracle.com
      Cc: linux-fsdevel@vger.kernel.org
      00dc417f