1. 06 1月, 2009 1 次提交
    • 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
  2. 15 10月, 2008 3 次提交
  3. 14 10月, 2008 6 次提交
    • M
      ocfs2: Don't check for NULL before brelse() · a81cb88b
      Mark Fasheh 提交于
      This is pointless as brelse() already does the check.
      
      Signed-off-by: Mark Fasheh
      a81cb88b
    • M
      ocfs2: make la_debug_mutex static · 4cc81245
      Mark Fasheh 提交于
      It can also be moved into ocfs2_la_debug_read().
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      4cc81245
    • J
      ocfs2: Limit inode allocation to 32bits. · 1187c968
      Joel Becker 提交于
      ocfs2 inode numbers are block numbers.  For any filesystem with less
      than 2^32 blocks, this is not a problem.  However, when ocfs2 starts
      using JDB2, it will be able to support filesystems with more than 2^32
      blocks.  This would result in inode numbers higher than 2^32.
      
      The problem is that stat(2) can't handle those numbers on 32bit
      machines.  The simple solution is to have ocfs2 allocate all inodes
      below that boundary.
      
      The suballoc code is changed to honor an optional block limit.  Only the
      inode suballocator sets that limit - all other allocations stay unlimited.
      
      The biggest trick is to grow the inode suballocator beneath that limit.
      There's no point in allocating block groups that are above the limit,
      then rejecting their elements later on.  We want to prevent the inode
      allocator from ever having block groups above the limit.  This involves
      a little gyration with the local alloc code.  If the local alloc window
      is above the limit, it signals the caller to try the global bitmap but
      does not disable the local alloc file (which can be used for other
      allocations).
      
      [ Minor cleanup - removed an ML_NOTICE comment. --Mark ]
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      1187c968
    • M
      ocfs2: track local alloc state via debugfs · 9a8ff578
      Mark Fasheh 提交于
      A per-mount debugfs file, "local_alloc" is created which when read will
      expose live state of the nodes local alloc file. Performance impact is
      minimal, only a bit of memory overhead per mount point. Still, the code is
      hidden behind CONFIG_OCFS2_FS_STATS. This feature will help us debug
      local alloc performance problems on a live system.
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      9a8ff578
    • M
      ocfs2: throttle back local alloc when low on disk space · 9c7af40b
      Mark Fasheh 提交于
      Ocfs2's local allocator disables itself for the duration of a mount point
      when it has trouble allocating a large enough area from the primary bitmap.
      That can cause performance problems, especially for disks which were only
      temporarily full or fragmented. This patch allows for the allocator to
      shrink it's window first, before being disabled. Later, it can also be
      re-enabled so that any performance drop is minimized.
      
      To do this, we allow the value of osb->local_alloc_bits to be shrunk when
      needed. The default value is recorded in a mostly read-only variable so that
      we can re-initialize when required.
      
      Locking had to be updated so that we could protect changes to
      local_alloc_bits. Mostly this involves protecting various local alloc values
      with the osb spinlock. A new state is also added, OCFS2_LA_THROTTLED, which
      is used when the local allocator is has shrunk, but is not disabled. If the
      available space dips below 1 megabyte, the local alloc file is disabled. In
      either case, local alloc is re-enabled 30 seconds after the event, or when
      an appropriate amount of bits is seen in the primary bitmap.
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      9c7af40b
    • M
      ocfs2: Track local alloc bits internally · ebcee4b5
      Mark Fasheh 提交于
      Do this instead of tracking absolute local alloc size. This avoids
      needless re-calculatiion of bits from bytes in localalloc.c. Additionally,
      the value is now in a more natural unit for internal file system bitmap
      work.
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      ebcee4b5
  4. 15 7月, 2008 1 次提交
  5. 01 5月, 2008 1 次提交
  6. 18 4月, 2008 2 次提交
  7. 04 3月, 2008 2 次提交
  8. 26 1月, 2008 2 次提交
  9. 28 11月, 2007 1 次提交
  10. 04 10月, 2007 1 次提交
  11. 21 9月, 2007 1 次提交
    • M
      ocfs2: Allow smaller allocations during large writes · 415cb800
      Mark Fasheh 提交于
      The ocfs2 write code loops through a page much like the block code, except
      that ocfs2 allocation units can be any size, including larger than page
      size. Typically it's equal to or larger than page size - most kernels run 4k
      pages, the minimum ocfs2 allocation (cluster) size.
      
      Some changes introduced during 2.6.23 changed the way writes to pages are
      handled, and inadvertantly broke support for > 4k page size. Instead of just
      writing one cluster at a time, we now handle the whole page in one pass.
      
      This means that multiple (small) seperate allocations might happen in the
      same pass. The allocation code howver typically optimizes by getting the
      maximum which was reserved. This triggered a BUG_ON in the extend code where
      it'd ask for a single bit (for one part of a > 4k page) and get back more
      than it asked for.
      
      Fix this by providing a variant of the high level allocation function which
      allows the caller to specify a maximum. The traditional function remains and
      just calls the new one with a maximum determined from the initial
      reservation.
      Signed-off-by: NMark Fasheh <mark.fasheh@oracle.com>
      415cb800
  12. 26 5月, 2007 1 次提交
    • M
      ocfs2: fix inode leak · 8fccfc82
      Mark Fasheh 提交于
      We weren't cleaning up our inode reference on error in
      ocfs2_reserve_local_alloc_bits(). Add a check for error return and iput() if
      need be. Move the code to set the alloc context inode info to the end of the
      function so we don't have any possibility of passing back a bad pointer.
      Signed-off-by: NMark Fasheh <mark.fasheh@oracle.com>
      8fccfc82
  13. 14 12月, 2006 1 次提交
  14. 02 12月, 2006 7 次提交
  15. 08 8月, 2006 1 次提交
    • M
      ocfs2: allocation hints · 883d4cae
      Mark Fasheh 提交于
      Record the most recently used allocation group on the allocation context, so
      that subsequent allocations can attempt to optimize for contiguousness.
      Local alloc especially should benefit from this as the current chain search
      tends to let it spew across the disk.
      Signed-off-by: NMark Fasheh <mark.fasheh@oracle.com>
      883d4cae
  16. 25 3月, 2006 1 次提交
  17. 10 1月, 2006 1 次提交
  18. 04 1月, 2006 1 次提交