1. 24 9月, 2012 6 次提交
    • S
      GFS2: Update rgblk_free() to use rbm · 3b1d0b9d
      Steven Whitehouse 提交于
      Replace open coded version with a call to gfs2_rbm_from_block()
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      3b1d0b9d
    • S
      GFS2: Update gfs2_get_block_type() to use rbm · 3983903a
      Steven Whitehouse 提交于
      Use the new gfs2_rbm_from_block() function to replace an open
      coded version of the same code.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      3983903a
    • S
      GFS2: Replace rgblk_search with gfs2_rbm_find · 5b924ae2
      Steven Whitehouse 提交于
      This is part of a series of patches which are introducing the
      gfs2_rbm structure throughout the block allocation code. The
      main aim of this part is to create a search function which can
      deal directly with struct gfs2_rbm. In this case it specifies
      the initial position at which to start the search and also the
      point at which the search terminates.
      
      The net result of this is to clean up the search code and make
      it rather more readable, and the various possible exceptions which
      may occur during the search are partitioned into their own functions.
      
      There are some bug fixes too. We should not be checking the reservations
      while allocating extents - the time for that is when we are searching
      for where to put the extent, not when we've already made that decision.
      
      Also, rgblk_search had two uses, and in only one of those cases did
      it make sense to check for reservations. This is fixed in the new
      gfs2_rbm_find function, which has a cleaner interface.
      
      The reservation checking has been improved by always checking for
      contiguous reservations, and returning the first free block after
      all contiguous reservations. This is done under the spin lock to
      ensure consistancy of the tree.
      
      The allocation of extents is now in all cases done by the existing
      allocation code, and if there is an active reservation, that is updated
      after the fact. Again this is done under the spin lock, since it entails
      changing the lookup key for the reservation in question.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      5b924ae2
    • S
      GFS2: Add structure to contain rgrp, bitmap, offset tuple · 4a993fb1
      Steven Whitehouse 提交于
      This patch introduces a new structure, gfs2_rbm, which is a
      tuple of a resource group, a bitmap within the resource group
      and an offset within that bitmap. This is designed to make
      manipulating these sets of variables easier. There is also a
      new helper function which converts this representation back
      to a disk block address.
      
      In addition, the rbtree nodes which are used for the reservations
      were not being correctly initialised, which is now fixed. Also,
      the tracing was not passing through the inode where it should
      have been. That is mostly fixed aside from one corner case. This
      needs to be revisited since there can also be a NULL rgrp in
      some cases which results in the device being incorrect in the
      trace.
      
      This is intended to be the first step towards cleaning up some
      of the allocation code, and some further bug fixes.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      4a993fb1
    • S
      GFS2: Remove rs_requested field from reservations · 71f890f7
      Steven Whitehouse 提交于
      The rs_requested field is left over from the original allocation
      code, however this should have been a parameter passed to the
      various functions from gfs2_inplace_reserve() and not a member of the
      reservation structure as the value is not required after the
      initial allocation.
      
      This also helps simplify the code since we no longer need to set
      the rs_requested to zero. Also the gfs2_inplace_release()
      function can also be simplified since the reservation structure
      will always be defined when it is called, and the only remaining
      task is to unlock the rgrp if required. It can also now be
      called unconditionally too, resulting in a further simplification.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      71f890f7
    • S
      GFS2: Merge two nearly identical xattr functions · 1f981697
      Steven Whitehouse 提交于
      There were two functions in the xattr code which were nearly
      identical, the only difference being that one was copy data into
      the unstuffed xattrs and the other was copying data out from it.
      
      This patch merges the two functions such that the code which deal
      with iteration over the unstuffed xattrs is no longer duplicated.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      1f981697
  2. 13 9月, 2012 3 次提交
  3. 04 8月, 2012 1 次提交
  4. 31 7月, 2012 2 次提交
  5. 23 7月, 2012 2 次提交
  6. 21 7月, 2012 1 次提交
  7. 19 7月, 2012 1 次提交
    • B
      GFS2: Reduce file fragmentation · 8e2e0047
      Bob Peterson 提交于
      This patch reduces GFS2 file fragmentation by pre-reserving blocks. The
      resulting improved on disk layout greatly speeds up operations in cases
      which would have resulted in interlaced allocation of blocks previously.
      A typical example of this is 10 parallel dd processes, each writing to a
      file in a common dirctory.
      
      The implementation uses an rbtree of reservations attached to each
      resource group (and each inode).
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      8e2e0047
  8. 18 7月, 2012 1 次提交
  9. 14 7月, 2012 4 次提交
  10. 28 6月, 2012 1 次提交
    • M
      GFS2: Fixing double brelse'ing bh allocated in gfs2_meta_read when EIO occurs · 44b8db13
      Masatake YAMATO 提交于
      This patch fixes buffer_head double free in following code path:
      
      gfs2_block_map
      => gfs2_meta_inode_buffer
       => gfs2_meta_indirect_buffer
        => gfs2_meta_read
      => release_metapath
      
      gfs2_block_map calls gfs2_meta_inode_buffer with &mp.mp_bh[0]
      as an argument. mp.mp_bh are filled with zero at the beginning
      of gfs2_block_map.
      
      If gfs2_meta_inode_buffer returns non-zero value, gfs2_block_map
      calls release_metapath to free buffers chained to mp.mp_bh.
      release_metapath checks each slot of mp.mp_bh[i] and
      free(with brelse) unless the slot is filled with NULL.
      
      &mp.mp_bh[0] passed to gfs2_meta_inode_buffer is filled at
      gfs2_meta_read. gfs2_meta_read is filled a buffer allocated with
      gfs2_getbuf even if EIO occurs. When EIO occurs, the allocated buffer
      is brelse'ed though the pointer(wrong poiner) points the brelse'ed is
      passed back to caller via an argument bhp.
      
      gfs2_meta_indirect_buffer, the caller also pass the wrong pointer
      to its caller with EIO. Finally gfs2_block_map gets both EIO and
      &mp.mp_bh[0] filled with the wrong pointer. release_metapath
      calls brelse again on the wrong pointer.
      Signed-off-by: NMasatake YAMATO <yamato@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      44b8db13
  11. 14 6月, 2012 1 次提交
  12. 13 6月, 2012 1 次提交
  13. 11 6月, 2012 2 次提交
  14. 08 6月, 2012 2 次提交
    • B
      GFS2: Use lvbs for storing rgrp information with mount option · 90306c41
      Benjamin Marzinski 提交于
      Instead of reading in the resource groups when gfs2 is checking
      for free space to allocate from, gfs2 can store the necessary infromation
      in the resource group's lvb.  Also, instead of searching for unlinked
      inodes in every resource group that's checked for free space, gfs2 can
      store the number of unlinked but inodes in the lvb, and only check for
      unlinked inodes if it will find some.
      
      The first time a resource group is locked, the lvb must initialized.
      Since this involves counting the unlinked inodes in the resource group,
      this takes a little extra time.  But after that, if the resource group
      is locked with GL_SKIP, the buffer head won't be read in unless it's
      actually needed.
      
      Enabling the resource groups lvbs is done via the rgrplvb mount option.  If
      this option isn't set, the lvbs will still be set and updated, but they won't
      be verfied or used by the filesystem.  To safely turn on this option, all of
      the nodes mounting the filesystem must be running code with this patch, and
      the filesystem must have been completely unmounted since they were updated.
      Signed-off-by: NBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      90306c41
    • S
      GFS2: Cache last hash bucket for glock seq_files · ba1ddcb6
      Steven Whitehouse 提交于
      For the glocks and glstats seq_files, which are exposed via debugfs
      we should cache the most recent hash bucket, along with the offset
      into that bucket. This allows us to restart from that point, rather
      than having to begin at the beginning each time.
      
      This is an idea from Eric Dumazet, however I've slightly extended it
      so that if the position from which we are due to start is at any
      point beyond the last cached point, we start from the last cached
      point, plus whatever is the appropriate offset. I don't really expect
      people to be lseeking around these files, but if they did so with only
      positive offsets, then we'd still get some of the benefit of using a
      cached offset.
      
      With my simple test of around 200k entries in the file, I'm seeing
      an approx 10x speed up.
      
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      ba1ddcb6
  15. 07 6月, 2012 1 次提交
  16. 06 6月, 2012 4 次提交
  17. 30 5月, 2012 1 次提交
  18. 16 5月, 2012 1 次提交
  19. 11 5月, 2012 3 次提交
    • B
      GFS2: Add rgrp information to block_alloc trace point · 41db1ab9
      Bob Peterson 提交于
      This is a second attempt at a patch that adds rgrp information to the
      block allocation trace point for GFS2. As suggested, the patch was
      modified to list the rgrp information _after_ the fields that exist today.
      
      Again, the reason for this patch is to allow us to trace and debug
      problems with the block reservations patch, which is still in the works.
      We can debug problems with reservations if we can see what block allocations
      result from the block reservations. It may also be handy in figuring out
      if there are problems in rgrp free space accounting. In other words,
      we can use it to track the rgrp and its free space along side the allocations
      that are taking place.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      41db1ab9
    • B
      GFS2: Eliminate unused "new" parameter to gfs2_meta_indirect_buffer · f2f9c812
      Bob Peterson 提交于
      It turns out that the "new" parameter to function gfs2_meta_indirect_buffer
      was always being passed in as zero. Therefore, this patch eliminates it
      and simplifies the function.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      f2f9c812
    • L
      vfs: make it possible to access the dentry hash/len as one 64-bit entry · 26fe5750
      Linus Torvalds 提交于
      This allows comparing hash and len in one operation on 64-bit
      architectures.  Right now only __d_lookup_rcu() takes advantage of this,
      since that is the case we care most about.
      
      The use of anonymous struct/unions hides the alternate 64-bit approach
      from most users, the exception being a few cases where we initialize a
      'struct qstr' with a static initializer.  This makes the problematic
      cases use a new QSTR_INIT() helper function for that (but initializing
      just the name pointer with a "{ .name = xyzzy }" initializer remains
      valid, as does just copying another qstr structure).
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      26fe5750
  20. 08 5月, 2012 1 次提交
  21. 06 5月, 2012 1 次提交