1. 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
  2. 14 7月, 2012 2 次提交
  3. 06 6月, 2012 2 次提交
  4. 05 4月, 2012 1 次提交
  5. 29 2月, 2012 1 次提交
    • S
      GFS2: FITRIM ioctl support · 66fc061b
      Steven Whitehouse 提交于
      The FITRIM ioctl provides an alternative way to send discard requests to
      the underlying device. Using the discard mount option results in every
      freed block generating a discard request to the block device. This can
      be slow, since many block devices can only process discard requests of
      larger sizes, and also such operations can be time consuming.
      
      Rather than using the discard mount option, FITRIM allows a sweep of the
      filesystem on an occasional basis, and also to optionally avoid sending
      down discard requests for smaller regions.
      
      In GFS2 FITRIM will work at resource group granularity. There is a flag
      for each resource group which keeps track of which resource groups have
      been trimmed. This flag is reset whenever a deallocation occurs in the
      resource group, and set whenever a successful FITRIM of that resource
      group has taken place. This helps to reduce repeated discard requests
      for the same block ranges, again improving performance.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      66fc061b
  6. 28 2月, 2012 2 次提交
  7. 11 1月, 2012 1 次提交
  8. 04 1月, 2012 4 次提交
  9. 06 12月, 2011 1 次提交
  10. 22 11月, 2011 2 次提交
    • S
      GFS2: Fix multi-block allocation · 6a8099ed
      Steven Whitehouse 提交于
      Clean up gfs2_alloc_blocks so that it takes the full extent length
      rather than just the number of non-inode blocks as an argument. That
      will only make a difference in the inode allocation case for now.
      
      Also, this fixes the extent length handling around gfs2_alloc_extent() so
      that multi block allocations will work again.
      
      The rd_last_alloc block is set to the final block in the allocated
      extent (as per the update to i_goal, but referenced to a different
      start point).
      
      This also removes the dinode argument to rgblk_search() which is no
      longer used.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      6a8099ed
    • B
      GFS2: decouple quota allocations from block allocations · 564e12b1
      Bob Peterson 提交于
      This patch separates the code pertaining to allocations into two
      parts: quota-related information and block reservations.
      This patch also moves all the block reservation structure allocations to
      function gfs2_inplace_reserve to simplify the code, and moves
      the frees to function gfs2_inplace_release.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      564e12b1
  11. 21 11月, 2011 1 次提交
    • B
      GFS2: move toward a generic multi-block allocator · 6e87ed0f
      Bob Peterson 提交于
      This patch is a revision of the one I previously posted.
      I tried to integrate all the suggestions Steve gave.
      The purpose of the patch is to change function gfs2_alloc_block
      (allocate either a dinode block or an extent of data blocks)
      to a more generic gfs2_alloc_blocks function that can
      allocate both a dinode _and_ an extent of data blocks in the
      same call. This will ultimately help us create a multi-block
      reservation scheme to reduce file fragmentation.
      
      This patch moves more toward a generic multi-block allocator that
      takes a pointer to the number of data blocks to allocate, plus whether
      or not to allocate a dinode. In theory, it could be called to allocate
      (1) a single dinode block, (2) a group of one or more data blocks, or
      (3) a dinode plus several data blocks.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      6e87ed0f
  12. 15 11月, 2011 1 次提交
  13. 08 11月, 2011 1 次提交
  14. 21 10月, 2011 5 次提交
    • S
      GFS2: Cache the most recently used resource group in the inode · 54335b1f
      Steven Whitehouse 提交于
      This means that after the initial allocation for any inode, the
      last used resource group is cached in the inode for future use.
      This drastically reduces the number of lookups of resource
      groups in the common case, and this the contention on that
      data structure.
      
      The allocation algorithm is the same as previously, except that we
      always check to see if the goal block is within the cached rgrp
      first before going to the rbtree to look one up.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      54335b1f
    • S
      GFS2: Make resource groups "append only" during life of fs · 8339ee54
      Steven Whitehouse 提交于
      Since we have ruled out supporting online filesystem shrink,
      it is possible to make the resource group list append only
      during the life of a super block. This gives several benefits:
      
      Firstly, we only need to read new rindex elements as they are added
      rather than needing to reread the whole rindex file each time one
      element is added.
      
      Secondly, the rindex glock can be held for much shorter periods of
      time, and is completely removed from the fast path for allocations.
      The lock is taken in shared mode only when updating the resource
      groups when the first allocation occurs, and after a grow has
      taken place.
      
      Thirdly, this results in a reduction in code size, and everything
      gets a lot simpler to understand in this area.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      8339ee54
    • S
      GFS2: Clean up gfs2_create · 9a63edd1
      Steven Whitehouse 提交于
      If we pass through knowledge of whether the creation is intended to be
      exclusive or not, then we can deal with that in gfs2_create_inode
      and remove one set of locking. Also this removes the loop in
      gfs2_create and simplifies the code a bit.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      9a63edd1
    • S
      GFS2: Use ->dirty_inode() · ab9bbda0
      Steven Whitehouse 提交于
      The aim of this patch is to use the newly enhanced ->dirty_inode()
      super block operation to deal with atime updates, rather than
      piggy backing that code into ->write_inode() as is currently
      done.
      
      The net result is a simplification of the code in various places
      and a reduction of the number of gfs2_dinode_out() calls since
      this is now implied by ->dirty_inode().
      
      Some of the mark_inode_dirty() calls have been moved under glocks
      in order to take advantage of then being able to avoid locking in
      ->dirty_inode() when we already have suitable locks.
      
      One consequence is that generic_write_end() now correctly deals
      with file size updates, so that we do not need a separate check
      for that afterwards. This also, indirectly, means that fdatasync
      should work correctly on GFS2 - the current code always syncs the
      metadata whether it needs to or not.
      
      Has survived testing with postmark (with and without atime) and
      also fsx.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      ab9bbda0
    • S
      GFS2: Fix inode allocation error path · 40ac218f
      Steven Whitehouse 提交于
      If we have got far enough through the inode allocation code
      path that an inode has already been allocated, then we must
      call iput to dispose of it, if an error occurs during a
      later part of the process. This will always be the final iput
      since there will be no other references to the inode.
      
      Unlike when the inode has been unlinked, its block state will
      be GFS2_BLKST_INODE rather than GFS2_BLKST_UNLINKED so we need
      to skip the test in ->evict_inode() for this one case in order
      to ensure that it will be deallocated correctly. This patch adds
      a new flag in order to ensure that this will happen correctly.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      40ac218f
  15. 26 7月, 2011 1 次提交
  16. 21 7月, 2011 1 次提交
  17. 20 7月, 2011 3 次提交
  18. 19 7月, 2011 1 次提交
    • M
      security: new security_inode_init_security API adds function callback · 9d8f13ba
      Mimi Zohar 提交于
      This patch changes the security_inode_init_security API by adding a
      filesystem specific callback to write security extended attributes.
      This change is in preparation for supporting the initialization of
      multiple LSM xattrs and the EVM xattr.  Initially the callback function
      walks an array of xattrs, writing each xattr separately, but could be
      optimized to write multiple xattrs at once.
      
      For existing security_inode_init_security() calls, which have not yet
      been converted to use the new callback function, such as those in
      reiserfs and ocfs2, this patch defines security_old_inode_init_security().
      Signed-off-by: NMimi Zohar <zohar@us.ibm.com>
      9d8f13ba
  19. 13 5月, 2011 3 次提交
  20. 10 5月, 2011 1 次提交
  21. 09 5月, 2011 5 次提交
    • S
      GFS2: Move most of the remaining inode.c into ops_inode.c · 194c011f
      Steven Whitehouse 提交于
      This is in preparation to remove inode.c and rename ops_inode.c
      to inode.c. Also most of the functions which were left in inode.c
      relate to the creation and lookup of inodes. I'm intending to work
      on consolidating some of that code, and its easier when its all in
      one place.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      194c011f
    • S
      GFS2: Remove gfs2_dinode_print() function · 94fb763b
      Steven Whitehouse 提交于
      This function was intended for debugging purposes, but it is not very
      useful. If we want to know what is on disk then all we need is a
      block number and gfs2_edit can give us much better information about
      what is there. Otherwise, if we are interested in what is stored in
      the in-core inode, it doesn't help us out there either.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      94fb763b
    • S
      GFS2: When adding a new dir entry, inc link count if it is a subdir · 3d6ecb7d
      Steven Whitehouse 提交于
      This adds an increment of the link count when we add a new directory
      entry, if that entry is itself a directory. This means that we no
      longer need separate code to perform this operation.
      
      Now that both adding and removing directory entries automatically
      update the parent directory's link count if required, that makes
      the code shorter and simpler than before.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      3d6ecb7d
    • S
      GFS2: Make gfs2_dir_del update link count when required · 855d23ce
      Steven Whitehouse 提交于
      When we remove an entry from a directory, we can save ourselves
      some trouble if we know the type of the entry in question, since
      if it is itself a directory, we can update the link count of the
      parent at the same time as removing the directory entry.
      
      In addition this patch also merges the rmdir and unlink code which
      was almost identical anyway. This eliminates the calls to remove
      the . and .. directory entries on each rmdir (not needed since the
      directory will be deallocated, anyway) which was the only thing preventing
      passing the dentry to gfs2_dir_del(). The passing of the dentry
      rather than just the name allows us to figure out the type of the entry
      which is being removed, and thus adjust the link count when required.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      855d23ce
    • S
      GFS2: Don't use gfs2_change_nlink in link syscall · 2baee03f
      Steven Whitehouse 提交于
      There are three users of gfs2_change_nlink which add to the link
      count. Two of these are about to be removed in later patches, so
      this means that there will no callers, when that happens allowing
      removal of that function, also in a later patch.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      2baee03f