1. 15 3月, 2011 8 次提交
    • B
      exofs: deprecate the commands pending counter · a49fb4c3
      Boaz Harrosh 提交于
      One leftover from the days of IBM's original code, is an SB counter
      that counts in-flight asynchronous commands. And a piece of code that
      waits for the counter to reach zero at unmount. I guess it might have
      been needed then, cause of some reference missing or something.
      
      I'm not removing it yet but am putting a warning message if ever this
      counter triggers at unmount. If I'll never see it triggers or reported
      I'll remove the counter for good.
      (I had this print as a debug output for a long time and never had it
       trigger)
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      a49fb4c3
    • B
      exofs: Write sbi->s_nextid as part of the Create command · 1cea312a
      Boaz Harrosh 提交于
      Before when creating a new inode, we'd set the sb->s_dirt flag,
      and sometime later the system would write out s_nextid as part
      of the sb_info. Also on inode sync we would force the sb sync
      as well.
      
      Define the s_nextid as a new partition attribute and set it
      every time we create a new object.
      At mount we read it from it's new place.
      
      We now never set sb->s_dirt anywhere in exofs. write_super
      is actually never called. The call to exofs_write_super from
      exofs_put_super is also removed because the VFS always calls
      ->sync_fs before calling ->put_super twice.
      
      To stay backward-and-forward compatible we also write the old
      s_nextid in the super_block object at unmount, and support zero
      length attribute on mount.
      
      This also fixes a BUG where in layouts when group_width was not
      a divisor of EXOFS_SUPER_ID (0x10000) the s_nextid was not read
      from the device it was written to. Because of the sliding window
      layout trick, and because the read was always done from the 0
      device but the write was done via the raid engine that might slide
      the device view. Now we read and write through the raid engine.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      1cea312a
    • B
      exofs: Add option to mount by osdname · 9ed96484
      Boaz Harrosh 提交于
      If /dev/osd* devices are shuffled because more devices
      where added, and/or login order has changed. It is hard to
      mount the FS you want.
      
      Add an option to mount by osdname. osdname is any osd-device's
      osdname as specified to the mkfs.exofs command when formatting
      the osd-devices.
      The new mount format is:
      	OPT="osdname=$UUID0,pid=$PID,_netdev"
      	mount -t exofs -o $OPT $DEV_OSD0 $MOUNTDIR
      
      if "osdname=" is specified in options above $DEV_OSD0 is
      ignored and can be empty.
      
      Also while at it: Removed some old unused Opt_* enums.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      9ed96484
    • B
      exofs: Override read-ahead to align on stripe_size · 66cd6cad
      bharrosh@panasas.com 提交于
      * Set all inode->i_mapping->backing_dev_info to point to
        the per super-block sb->s_bdi.
      
      * Calculating a read_ahead that is:
        - preferable 2 stripes long
          (Future patch will add a mount option to override this)
        - Minimum 128K aligned up to stripe-size
        - Caped to maximum-IO-sizes round down to stripe_size.
          (Max sizes are governed by max bio-size that fits in a page
           times number-of-devices)
      
      CC: Marc Dionne <marc.c.dionne@gmail.com>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      66cd6cad
    • N
      exofs: simple fsync race fix · 97178b7b
      Nick Piggin 提交于
      It is incorrect to test inode dirty bits without participating in the inode
      writeback protocol. Inode writeback sets I_SYNC and clears I_DIRTY_?, then
      writes out the particular bits, then clears I_SYNC when it is done. BTW. it
      may not completely write all pages out, so I_DIRTY_PAGES would get set
      again.
      
      This is a standard pattern used throughout the kernel's writeback caches
      (I_SYNC ~= I_WRITEBACK, if that makes it clearer).
      
      And so it is not possible to determine an inode's dirty status just by
      checking I_DIRTY bits. Especially not for the purpose of data integrity
      syncs.
      
      Missing the check for these bits means that fsync can complete while
      writeback to the inode is underway. Inode writeback functions get this
      right, so call into them rather than try to shortcut things by testing
      dirty state improperly.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      97178b7b
    • B
      exofs: Optimize read_4_write · a8f1418f
      Boaz Harrosh 提交于
      Don't attempt a read passed i_size, just zero the page and be
      done with it.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      a8f1418f
    • B
      exofs: Trivial: fix some indentation and debug prints · 0a935519
      Boaz Harrosh 提交于
      I stumbled on some of these prints in log files so, might
      just submit the fixes.
      
      * All i_ino prints in exofs should be hex
      * All OSD_ERR prints should end with a "\n"
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      0a935519
    • T
      exofs: Remove redundant unlikely() · 2c722c9a
      Tobias Klauser 提交于
      IS_ERR() already implies unlikely(), so it can be omitted here.
      Signed-off-by: NTobias Klauser <tklauser@distanz.ch>
      2c722c9a
  2. 03 3月, 2011 1 次提交
  3. 03 2月, 2011 1 次提交
  4. 07 1月, 2011 1 次提交
    • N
      fs: icache RCU free inodes · fa0d7e3d
      Nick Piggin 提交于
      RCU free the struct inode. This will allow:
      
      - Subsequent store-free path walking patch. The inode must be consulted for
        permissions when walking, so an RCU inode reference is a must.
      - sb_inode_list_lock to be moved inside i_lock because sb list walkers who want
        to take i_lock no longer need to take sb_inode_list_lock to walk the list in
        the first place. This will simplify and optimize locking.
      - Could remove some nested trylock loops in dcache code
      - Could potentially simplify things a bit in VM land. Do not need to take the
        page lock to follow page->mapping.
      
      The downsides of this is the performance cost of using RCU. In a simple
      creat/unlink microbenchmark, performance drops by about 10% due to inability to
      reuse cache-hot slab objects. As iterations increase and RCU freeing starts
      kicking over, this increases to about 20%.
      
      In cases where inode lifetimes are longer (ie. many inodes may be allocated
      during the average life span of a single inode), a lot of this cache reuse is
      not applicable, so the regression caused by this patch is smaller.
      
      The cache-hot regression could largely be avoided by using SLAB_DESTROY_BY_RCU,
      however this adds some complexity to list walking and store-free path walking,
      so I prefer to implement this at a later date, if it is shown to be a win in
      real situations. I haven't found a regression in any non-micro benchmark so I
      doubt it will be a problem.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      fa0d7e3d
  5. 29 10月, 2010 1 次提交
  6. 26 10月, 2010 4 次提交
  7. 19 10月, 2010 2 次提交
    • B
      exofs: Set i_mapping->backing_dev_info anyway · 115e19c5
      Boaz Harrosh 提交于
      Though it has been promised that inode->i_mapping->backing_dev_info
      is not used and the supporting code is fine. Until the pointer
      will default to NULL, I'd rather it points to the correct thing
      regardless.
      
      At least for future infrastructure coder it is a clear indication
      of where are the key points that inodes are initialized.
      I know because it took me time to find this out.
      
      Signed-off-by: Boaz Harrosh <Boaz Harrosh bharrosh@panasas.com>
      115e19c5
    • B
      exofs: Cleaup read path in regard with read_for_write · 7aebf410
      Boaz Harrosh 提交于
      Last BUG fix added a flag to the the page_collect structure
      to communicate with readpage_strip. This calls for a clean up
      removing that flag's reincarnations in the read functions
      parameters.
      
      Signed-off-by: Boaz Harrosh <Boaz Harrosh bharrosh@panasas.com>
      7aebf410
  8. 08 10月, 2010 1 次提交
    • B
      exofs: Fix double page_unlock BUG in write_begin/end · f17b1f9f
      Boaz Harrosh 提交于
      This BUG is there since the first submit of the code, but only triggered
      in last Kernel. It's timing related do to the asynchronous object-creation
      behaviour of exofs. (Which should be investigated farther)
      
      The bug is obvious hence the fixed.
      
      Signed-off-by: Boaz Harrosh <Boaz Harrosh bharrosh@panasas.com>
      f17b1f9f
  9. 10 8月, 2010 3 次提交
    • A
      convert exofs to ->evict_inode() · 4ec70c9b
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      4ec70c9b
    • B
      exofs: New truncate sequence · 2f246fd0
      Boaz Harrosh 提交于
      These changes are crafted based on the similar
      conversion done to ext2 by Nick Piggin.
      
      * Remove the deprecated ->truncate vector. Let exofs_setattr
        take care of on-disk size updates.
      * Call truncate_pagecache on the unused pages if
        write_begin/end fails.
      * Cleanup exofs_delete_inode that did stupid inode
        writes and updates on an inode that will be
        removed.
      * And finally get rid of exofs_get_block. We never
        had any blocks it was all for calling nobh_truncate_page.
        nobh_truncate_page is not actually needed in exofs since
        the last page is complete and gone, just like all the other
        pages. There is no partial blocks in exofs.
      
      I've tested with this patch, and there are no apparent
      failures, so far.
      
      CC: Nick Piggin <npiggin@suse.de>
      CC: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      2f246fd0
    • C
      remove inode_setattr · 1025774c
      Christoph Hellwig 提交于
      Replace inode_setattr with opencoded variants of it in all callers.  This
      moves the remaining call to vmtruncate into the filesystem methods where it
      can be replaced with the proper truncate sequence.
      
      In a few cases it was obvious that we would never end up calling vmtruncate
      so it was left out in the opencoded variant:
      
       spufs: explicitly checks for ATTR_SIZE earlier
       btrfs,hugetlbfs,logfs,dlmfs: explicitly clears ATTR_SIZE earlier
       ufs: contains an opencoded simple_seattr + truncate that sets the filesize just above
      
      In addition to that ncpfs called inode_setattr with handcrafted iattrs,
      which allowed to trim down the opencoded variant.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1025774c
  10. 09 8月, 2010 1 次提交
  11. 08 8月, 2010 1 次提交
    • C
      block: unify flags for struct bio and struct request · 7b6d91da
      Christoph Hellwig 提交于
      Remove the current bio flags and reuse the request flags for the bio, too.
      This allows to more easily trace the type of I/O from the filesystem
      down to the block driver.  There were two flags in the bio that were
      missing in the requests:  BIO_RW_UNPLUG and BIO_RW_AHEAD.  Also I've
      renamed two request flags that had a superflous RW in them.
      
      Note that the flags are in bio.h despite having the REQ_ name - as
      blkdev.h includes bio.h that is the only way to go for now.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <jaxboe@fusionio.com>
      7b6d91da
  12. 04 8月, 2010 4 次提交
    • B
      exofs: Fix groups code when num_devices is not divisible by group_width · 5002dd18
      Boaz Harrosh 提交于
      There is a bug when num_devices is not divisible by group_width * mirrors.
      We would not return to the proper device and offset when looping on to the
      next group.
      
      The fix makes code simpler actually.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      5002dd18
    • B
      exofs: Remove useless optimization · 6e31609b
      Boaz Harrosh 提交于
      We used to compact all used devices in an IO to the beginning
      of the device array in an io_state. And keep a last device used
      so in later loops we don't iterate on all device slots. This
      does not prevent us from checking if slots are empty since in
      reads we only read from a single mirror and jump to the next
      mirror-set.
      
      This optimization is marginal, and needlessly complicates the
      code. Specially when we will later want to support raid/456
      with same abstract code. So remove the distinction between
      "dev" and "comp". Only "dev" is used both as the device used
      and as the index (component) in the device array.
      
      [Note that now the io_state->dev member is redundant but I
       keep it because I might want to optimize by only IOing a
       single group, though keeping a group_width*mirrors devices
       in io_state, we now keep num-devices in each io_state]
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      6e31609b
    • B
      exofs: exofs_file_fsync and exofs_file_flush correctness · b2848349
      Boaz Harrosh 提交于
      As per Christoph advise: no need to call filemap_write_and_wait().
      In exofs all metadata is at the inode so just writing the inode is
      all is needed. ->fsync implies this must be done synchronously.
      
      But now exofs_file_fsync can not be used by exofs_file_flush.
      vfs_fsync() should do that job correctly.
      
      FIXME: remove the sb_sync and fix that sb_update better.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      b2848349
    • B
      exofs: Remove superfluous dependency on buffer_head and writeback · 85dc7878
      Boaz Harrosh 提交于
      exofs_releasepage && exofs_invalidatepage are never called.
      Leave the WARN_ONs but remove any code. Remove the
      
      cleanup other stale #includes.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      85dc7878
  13. 28 5月, 2010 1 次提交
  14. 22 5月, 2010 1 次提交
  15. 17 5月, 2010 2 次提交
  16. 30 4月, 2010 1 次提交
  17. 29 4月, 2010 1 次提交
  18. 22 4月, 2010 1 次提交
  19. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  20. 06 3月, 2010 1 次提交
  21. 28 2月, 2010 3 次提交
    • B
      exofs: groups support · 50a76fd3
      Boaz Harrosh 提交于
      * _calc_stripe_info() changes to accommodate for grouping
        calculations. Returns additional information
      
      * old _prepare_pages() becomes _prepare_one_group()
        which stores pages belonging to one device group.
      
      * New _prepare_for_striping iterates on all groups calling
        _prepare_one_group().
      
      * Enable mounting of groups data_maps (group_width != 0)
      
      [QUESTION]
      what is faster A or B;
      A.	x += stride;
      	x = x % width + first_x;
      
      B	x += stride
      	if (x < last_x)
      		x = first_x;
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      50a76fd3
    • B
      exofs: Prepare for groups · b367e78b
      Boaz Harrosh 提交于
      * Rename _offset_dev_unit_off() to _calc_stripe_info()
        and recieve a struct for the output params
      
      * In _prepare_for_striping we only need to call
        _calc_stripe_info() once. The other componets
        are easy to calculate from that. This code
        was inspired by what's done in truncate.
      
      * Some code shifts that make sense now but will make
        more sense when group support is added.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      b367e78b
    • B
      exofs: Error recovery if object is missing from storage · 96391e2b
      Boaz Harrosh 提交于
      If an object is referenced by a directory but does not
      exist on a target, it is a very serious corruption that
      means:
      1. Either a power failure with very slim chance of it
        happening. Because the directory update is always submitted
        much after object creation, but if a directory is written
        to one device and the object creation to another it might
        theoretically happen.
      2. It only ever happened to me while developing with BUGs
        causing file corruption. Crashes could also cause it but
        they are more like case 1.
      
      In any way the object does not exist, so data is surely lost.
      If there is a mix-up in the obj-id or data-map, then lost objects
      can be salvaged by off-line fsck. The only recoverable information
      is the directory name. By letting it appear as a regular empty file,
      with date==0 (1970 Jan 1st) ownership to root, we enable recovery
      of the only useful information. And also enable deletion or over-write.
      I can see how this can hurt.
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      96391e2b