1. 05 1月, 2009 2 次提交
  2. 25 6月, 2008 1 次提交
    • B
      [GFS2] fix gfs2 block allocation (cleaned up) · 5af4e7a0
      Benjamin Marzinski 提交于
      This patch fixes bz 450641.
      
      This patch changes the computation for zero_metapath_length(), which it
      renames to metapath_branch_start(). When you are extending the metadata
      tree, The indirect blocks that point to the new data block must either
      diverge from the existing tree either at the inode, or at the first
      indirect block. They can diverge at the first indirect block because the
      inode has room for 483 pointers while the indirect blocks have room for
      509 pointers, so when the tree is grown, there is some free space in the
      first indirect block. What metapath_branch_start() now computes is the
      height where the first indirect block for the new data block is located.
      It can either be 1 (if the indirect block diverges from the inode) or 2
      (if it diverges from the first indirect block).
      Signed-off-by: NBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      5af4e7a0
  3. 31 3月, 2008 17 次提交
    • S
      [GFS2] Streamline quota lock/check for no-quota case · d82661d9
      Steven Whitehouse 提交于
      This patch streamlines the quota checking in the "no quota" case by
      making the check inline in the calling function, thus reducing the
      number of function calls. Eventually we might be able to remove the
      checks from the gfs2_quota_lock() and gfs2_quota_check() functions, but
      currently we can't as there are a very few places in the code which need
      to call these functions directly still.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Cc: Abhijith Das <adas@redhat.com>
      d82661d9
    • C
      [GFS2] possible null pointer dereference fixup · 182fe5ab
      Cyrill Gorcunov 提交于
      gfs2_alloc_get may fail so we have to check it to prevent
      NULL pointer dereference.
      Signed-off-by: NCyrill Gorcunov <gorcunov@gamil.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      182fe5ab
    • S
      [GFS2] Allow bmap to allocate extents · 9b8c81d1
      Steven Whitehouse 提交于
      We've supported mapping of extents when no block allocation is required
      for some time. This patch extends that to mapping of extents when an
      allocation has been requested. In that case we try to allocate as many
      blocks as are requested, but we might return fewer in case there is
      something preventing us from returning the complete amount (e.g. an
      already allocated block is in the way).
      
      Currently the only code path which can actually request multiple data
      blocks in a single bmap call is the page_mkwrite path and even then it
      only happens if there are multiple blocks per page. What this patch does
      do however, is merge the allocation requests for metadata (growing the
      metadata tree in either height or depth) with the allocation of the data
      blocks in the case that both are needed. This results in lower overheads
      even in the single block allocation case.
      
      The one thing which we can't handle here at the moment is unstuffing. I
      would like to be able to do that, but the problem which arises is that
      in order to unstuff one has to get a locked page from the page cache
      which results in locking problems in the (usual) case that the caller is
      holding the page lock on the page it wishes to map. So that case will
      have to be addressed in future patches.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      9b8c81d1
    • S
      [GFS2] Get inode buffer only once per block map call · e23159d2
      Steven Whitehouse 提交于
      In the case that we needed to grow the height of the metadata tree
      we were looking up the inode buffer and then brelse()ing it despite
      the fact that it is needed later in the block map process.
      
      This patch ensures that we look up the inode's buffer once and only
      once during the block map process.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      e23159d2
    • S
      [GFS2] Eliminate (almost) duplicate field from gfs2_inode · 77658aad
      Steven Whitehouse 提交于
      The blocks counter is almost a duplicate of the i_blocks
      field in the VFS inode. The only difference is that i_blocks
      can be only 32bits long for 32bit arch without large single file
      support. Since GFS2 doesn't handle the non-large single file
      case (for 32 bit anyway) this adds a new config dependency on
      64BIT || LSF. This has always been the case, however we've never
      explicitly said so before.
      
      Even if we do add support for the non-LSF case, we will still
      not require this field to be duplicated since we will not be
      able to access oversized files anyway.
      
      So the net result of all this is that we shave 8 bytes from a gfs2_inode
      and get our config deps correct.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      77658aad
    • S
      [GFS2] Add a function to interate over an extent · 30cbf189
      Steven Whitehouse 提交于
      This adds a function (currently the only use is during mapping
      of already allocated blocks, but watch this space) which iterates
      over a number of pointers in a block and returns the extent length.
      
      If the initial pointer is 0 (i.e. unallocated) it will return the
      number of unallocated blocks in the extent. If the initial pointer
      is allocated, then it returns the number of contiguously allocated
      blocks in the extent.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      30cbf189
    • S
      [GFS2] The case of the missing asterisk · c85a665f
      Steven Whitehouse 提交于
      A dereference was forgotten. This adds it back correctly.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      c85a665f
    • S
      [GFS2] Add extent allocation to block allocator · b45e41d7
      Steven Whitehouse 提交于
      Rather than having to allocate a single block at a time, this patch
      allows the block allocator to allocate an extent. Since there is
      no difference (so far as the block allocator is concerned) between
      data blocks and indirect blocks, it is posible to allocate a single
      extent and for the caller to unrevoke just the blocks required
      for indirect blocks.
      
      Currently the only bit of GFS2 to make use of this feature is the
      build height function. The intention is that gfs2_block_map will
      be changed to make use of this feature in future patches.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      b45e41d7
    • S
      [GFS2] Merge gfs2_alloc_meta and gfs2_alloc_data · 1639431a
      Steven Whitehouse 提交于
      Thanks to the preceeding patches, the only difference between
      these two functions is their name. We can thus merge them
      and call the new function gfs2_alloc_block to reflect the
      fact that it can allocate either kind of block.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      1639431a
    • S
      [GFS2] Update gfs2_trans_add_unrevoke to accept extents · 5731be53
      Steven Whitehouse 提交于
      By adding an extra argument to gfs2_trans_add_unrevoke we can now
      specify an extent length of blocks to unrevoke. This means that
      we only need to make one pass through the list for each extent
      rather than each block. Currently the only extent length which
      is used is 1, but that will change in the future.
      
      Also gfs2_trans_add_unrevoke is removed from gfs2_alloc_meta
      since its the only difference between this and gfs2_alloc_data
      which is left. This will allow a future patch to merge these
      two functions into one (i.e. one call to allocate both data
      and metadata in a single extent in the future).
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      5731be53
    • S
      [GFS2] Reduce inode size by merging fields · ce276b06
      Steven Whitehouse 提交于
      There were three fields being used to keep track of the location
      of the most recently allocated block for each inode. These have
      been merged into a single field in order to better keep the
      data and metadata for an inode close on disk, and also to reduce
      the space required for storage.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      ce276b06
    • S
      [GFS2] Introduce array of buffers to struct metapath · dbac6710
      Steven Whitehouse 提交于
      The reason for doing this is to allow all the block mapping code
      to share the same array. As a result we can remove two arguments
      from lookup_metapath since they are now returned via the array.
      
      We also add a function to drop all refs to buffer heads when we
      are done with the metapath. The build_height function shares the
      struct metapath, but currently still frees its own buffers, and
      this will change in a future patch.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      dbac6710
    • S
      [GFS2] Move part of gfs2_block_map into a separate function · 11707ea0
      Steven Whitehouse 提交于
      This is required to enable future changes to the block
      mapping code.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      11707ea0
    • B
      [GFS2] Misc fixups · 7eabb77e
      Bob Peterson 提交于
      This patch contains two small fixups that didn't fit elsewhere.
      They are: (1) get rid of temp variable in find_metapath.
      (2) Remove vestigial "ret" variable from gfs2_writepage_common.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      7eabb77e
    • B
      [GFS2] Get rid of unneeded parameter in gfs2_rlist_alloc · fe6c991c
      Bob Peterson 提交于
      This patch removed the unnecessary parameter from function
      gfs2_rlist_alloc.  The parameter was always passed in as 0.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      fe6c991c
    • S
      [GFS2] Streamline indirect pointer tree height calculation · ecc30c79
      Steven Whitehouse 提交于
      This patch improves the calculation of the tree height in order to reduce
      the number of operations which are carried out on each call to gfs2_block_map.
      In the common case, we now make a single comparison, rather than calculating
      the required tree height from scratch each time. Also in the case that the
      tree does need some extra height, we start from the current height rather from
      zero when we work out what the new height ought to be.
      
      In addition the di_height field is moved into the inode proper and reduced
      in size to a u8 since the value must be between 0 and GFS2_MAX_META_HEIGHT (10).
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      ecc30c79
    • S
      [GFS2] Speed up gfs2_write_alloc_required, deprecate gfs2_extent_map · 941e6d7d
      Steven Whitehouse 提交于
      This patch removes the call to gfs2_extent_map from gfs2_write_alloc_required,
      instead we call gfs2_block_map directly. This results in fewer overall calls
      to gfs2_block_map in the multi-block case.
      
      Also, gfs2_extent_map is marked as deprecated so that people know that its
      going away as soon as all the callers have been converted.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      941e6d7d
  4. 06 2月, 2008 1 次提交
    • C
      Pagecache zeroing: zero_user_segment, zero_user_segments and zero_user · eebd2aa3
      Christoph Lameter 提交于
      Simplify page cache zeroing of segments of pages through 3 functions
      
      zero_user_segments(page, start1, end1, start2, end2)
      
              Zeros two segments of the page. It takes the position where to
              start and end the zeroing which avoids length calculations and
      	makes code clearer.
      
      zero_user_segment(page, start, end)
      
              Same for a single segment.
      
      zero_user(page, start, length)
      
              Length variant for the case where we know the length.
      
      We remove the zero_user_page macro. Issues:
      
      1. Its a macro. Inline functions are preferable.
      
      2. The KM_USER0 macro is only defined for HIGHMEM.
      
         Having to treat this special case everywhere makes the
         code needlessly complex. The parameter for zeroing is always
         KM_USER0 except in one single case that we open code.
      
      Avoiding KM_USER0 makes a lot of code not having to be dealing
      with the special casing for HIGHMEM anymore. Dealing with
      kmap is only necessary for HIGHMEM configurations. In those
      configurations we use KM_USER0 like we do for a series of other
      functions defined in highmem.h.
      
      Since KM_USER0 is depends on HIGHMEM the existing zero_user_page
      function could not be a macro. zero_user_* functions introduced
      here can be be inline because that constant is not used when these
      functions are called.
      
      Also extract the flushing of the caches to be outside of the kmap.
      
      [akpm@linux-foundation.org: fix nfs and ntfs build]
      [akpm@linux-foundation.org: fix ntfs build some more]
      Signed-off-by: NChristoph Lameter <clameter@sgi.com>
      Cc: Steven French <sfrench@us.ibm.com>
      Cc: Michael Halcrow <mhalcrow@us.ibm.com>
      Cc: <linux-ext4@vger.kernel.org>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Anton Altaparmakov <aia21@cantab.net>
      Cc: Mark Fasheh <mark.fasheh@oracle.com>
      Cc: David Chinner <dgc@sgi.com>
      Cc: Michael Halcrow <mhalcrow@us.ibm.com>
      Cc: Steven French <sfrench@us.ibm.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      eebd2aa3
  5. 25 1月, 2008 6 次提交
  6. 10 10月, 2007 3 次提交
  7. 09 7月, 2007 5 次提交
    • S
      [GFS2] Fix gfs2_block_truncate_page err return · 1875f2f3
      S. Wendy Cheng 提交于
      Code segment inside gfs2_block_truncate_page() doesn't set the return
      code correctly. This causes NFSD erroneously returns EIO back to client
      with setattr procedure call (truncate error).
      Signed-off-by: NS. Wendy Cheng <wcheng@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      1875f2f3
    • S
      [GFS2] Add nanosecond timestamp feature · 4bd91ba1
      Steven Whitehouse 提交于
      This adds a nanosecond timestamp feature to the GFS2 filesystem. Due
      to the way that the on-disk format works, older filesystems will just
      appear to have this field set to zero. When mounted by an older version
      of GFS2, the filesystem will simply ignore the extra fields so that
      it will again appear to have whole second resolution, so that its
      trivially backward compatible.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      4bd91ba1
    • S
      [GFS2] Fix sign problem in quota/statfs and cleanup _host structures · bb8d8a6f
      Steven Whitehouse 提交于
      This patch fixes some sign issues which were accidentally introduced
      into the quota & statfs code during the endianess annotation process.
      Also included is a general clean up which moves all of the _host
      structures out of gfs2_ondisk.h (where they should not have been to
      start with) and into the places where they are actually used (often only
      one place). Also those _host structures which are not required any more
      are removed entirely (which is the eventual plan for all of them).
      
      The conversion routines from ondisk.c are also moved into the places
      where they are actually used, which for almost every one, was just one
      single place, so all those are now static functions. This also cleans up
      the end of gfs2_ondisk.h which no longer needs the #ifdef __KERNEL__.
      
      The net result is a reduction of about 100 lines of code, many functions
      now marked static plus the bug fixes as mentioned above. For good
      measure I ran the code through sparse after making these changes to
      check that there are no warnings generated.
      
      This fixes Red Hat bz #239686
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      bb8d8a6f
    • S
      [GFS2] Clean up inode number handling · dbb7cae2
      Steven Whitehouse 提交于
      This patch cleans up the inode number handling code. The main difference
      is that instead of looking up the inodes using a struct gfs2_inum_host
      we now use just the no_addr member of this structure. The tests relating
      to no_formal_ino can then be done by the calling code. This has
      advantages in that we want to do different things in different code
      paths if the no_formal_ino doesn't match. In the NFS patch we want to
      return -ESTALE, but in the ->lookup() path, its a bug in the fs if the
      no_formal_ino doesn't match and thus we can withdraw in this case.
      
      In order to later fix bz #201012, we need to be able to look up an inode
      without knowing no_formal_ino, as the only information that is known to
      us is the on-disk location of the inode in question.
      
      This patch will also help us to fix bz #236099 at a later date by
      cleaning up a lot of the code in that area.
      
      There are no user visible changes as a result of this patch and there
      are no changes to the on-disk format either.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      dbb7cae2
    • N
      [GFS2] use zero_user_page · 0507ecf5
      Nate Diller 提交于
      Use zero_user_page() instead of open-coding it.
      Signed-off-by: NNate Diller <nate.diller@gmail.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      0507ecf5
  8. 15 2月, 2007 1 次提交
    • T
      [PATCH] remove many unneeded #includes of sched.h · cd354f1a
      Tim Schmielau 提交于
      After Al Viro (finally) succeeded in removing the sched.h #include in module.h
      recently, it makes sense again to remove other superfluous sched.h includes.
      There are quite a lot of files which include it but don't actually need
      anything defined in there.  Presumably these includes were once needed for
      macros that used to live in sched.h, but moved to other header files in the
      course of cleaning it up.
      
      To ease the pain, this time I did not fiddle with any header files and only
      removed #includes from .c-files, which tend to cause less trouble.
      
      Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
      arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
      allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
      configs in arch/arm/configs on arm.  I also checked that no new warnings were
      introduced by the patch (actually, some warnings are removed that were emitted
      by unnecessarily included header files).
      Signed-off-by: NTim Schmielau <tim@physik3.uni-rostock.de>
      Acked-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cd354f1a
  9. 06 2月, 2007 1 次提交
    • E
      [GFS2] use CURRENT_TIME_SEC instead of get_seconds in gfs2 · ddfe0627
      Eric Sandeen 提交于
      I was looking something else up and came across this...
      
      I don't honestly have a good reason to change it other than to make it
      like every other Linux filesystem in this regard.  ;-)  It doesn't
      functionally change anything, but makes some lines shorter. :)
      
      I'm also curious; why does gfs2 have 64-bits of on-disk timestamps, but
      not in timespec_t format, and only stores second resolutions?  Seems like
      you're halfway to sub-second resolutions already.
      
      I suppose if that gets implemented then all of the below should
      instead be CURRENT_TIME not CURRENT_TIME_SEC.
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      ddfe0627
  10. 30 11月, 2006 3 次提交