1. 16 5月, 2012 2 次提交
  2. 11 4月, 2012 3 次提交
    • A
      ext2: do not register write_super within VFS · f72cf5e2
      Artem Bityutskiy 提交于
      Jan Kara removed 'sb->s_dirt' VFS flag references, so we do not need to
      register the ext2 'ext2_write_super()' method in the VFS superblock operations,
      because 'sb->s_dirt' won't be ever set to 1 and VFS won't ever call
      '->write_super()' anyway. Thus, remove the method.
      
      Tested using xfstests.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      f72cf5e2
    • J
      ext2: Remove s_dirt handling · b838ec22
      Jan Kara 提交于
      Places which modify superblock feature / state fields mark the superblock
      buffer dirty so it is written out by flusher thread. Thus there's no need to
      set s_dirt there.
      
      The only other fields changing in the superblock are the numbers of free
      blocks, free inodes and s_wtime. There's no real need to write (or even
      compute) these periodically. Free blocks / inodes counters are recomputed on
      every mount from group counters anyway and value of s_wtime is only
      informational and imprecise anyway. So it should be enough to write these
      opportunistically on mount, remount, umount, and sync_fs times.
      Signed-off-by: NJan Kara <jack@suse.cz>
      b838ec22
    • A
      ext2: write superblock only once on unmount · f2b22420
      Artem Bityutskiy 提交于
      Currently on unmount if we are mounted R/W, we first write the superblock to
      the media if it is dirty, and then write it again, which is not optimal. This
      patch makes ext2 write the superblock on unmount less times.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      f2b22420
  3. 21 3月, 2012 2 次提交
  4. 09 1月, 2012 1 次提交
  5. 07 1月, 2012 1 次提交
  6. 04 1月, 2012 1 次提交
    • A
      vfs: fix the stupidity with i_dentry in inode destructors · 6b520e05
      Al Viro 提交于
      Seeing that just about every destructor got that INIT_LIST_HEAD() copied into
      it, there is no point whatsoever keeping this INIT_LIST_HEAD in inode_init_once();
      the cost of taking it into inode_init_always() will be negligible for pipes
      and sockets and negative for everything else.  Not to mention the removal of
      boilerplate code from ->destroy_inode() instances...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6b520e05
  7. 30 8月, 2011 1 次提交
  8. 17 5月, 2011 1 次提交
  9. 31 3月, 2011 1 次提交
  10. 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
  11. 06 1月, 2011 1 次提交
  12. 29 10月, 2010 1 次提交
  13. 26 10月, 2010 1 次提交
  14. 05 10月, 2010 2 次提交
    • J
      BKL: Remove BKL from ext2 filesystem · 3e44f9f1
      Jan Blunck 提交于
      The BKL is still used in ext2_put_super(), ext2_fill_super(), ext2_sync_fs()
      ext2_remount() and ext2_write_inode(). From these calls ext2_put_super(),
      ext2_fill_super() and ext2_remount() are protected against each other by
      the struct super_block s_umount rw semaphore. The call in ext2_write_inode()
      could only protect the modification of the ext2_sb_info through
      ext2_update_dynamic_rev() against concurrent ext2_sync_fs() or ext2_remount().
      ext2_fill_super() and ext2_put_super() can be left out because you need a
      valid filesystem reference in all three cases, which you do not have when
      you are one of these functions.
      
      If the BKL is only protecting the modification of the ext2_sb_info it can
      safely be removed since this is protected by the struct ext2_sb_info s_lock.
      Signed-off-by: NJan Blunck <jblunck@infradead.org>
      Cc: Jan Kara <jack@suse.cz>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      3e44f9f1
    • J
      BKL: Explicitly add BKL around get_sb/fill_super · db719222
      Jan Blunck 提交于
      This patch is a preparation necessary to remove the BKL from do_new_mount().
      It explicitly adds calls to lock_kernel()/unlock_kernel() around
      get_sb/fill_super operations for filesystems that still uses the BKL.
      
      I've read through all the code formerly covered by the BKL inside
      do_kern_mount() and have satisfied myself that it doesn't need the BKL
      any more.
      
      do_kern_mount() is already called without the BKL when mounting the rootfs
      and in nfsctl. do_kern_mount() calls vfs_kern_mount(), which is called
      from various places without BKL: simple_pin_fs(), nfs_do_clone_mount()
      through nfs_follow_mountpoint(), afs_mntpt_do_automount() through
      afs_mntpt_follow_link(). Both later functions are actually the filesystems
      follow_link inode operation. vfs_kern_mount() is calling the specified
      get_sb function and lets the filesystem do its job by calling the given
      fill_super function.
      
      Therefore I think it is safe to push down the BKL from the VFS to the
      low-level filesystems get_sb/fill_super operation.
      
      [arnd: do not add the BKL to those file systems that already
             don't use it elsewhere]
      Signed-off-by: NJan Blunck <jblunck@infradead.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Cc: Christoph Hellwig <hch@infradead.org>
      db719222
  15. 10 8月, 2010 1 次提交
  16. 24 5月, 2010 5 次提交
  17. 22 5月, 2010 7 次提交
    • J
      BKL: Remove BKL from ext2 filesystem · e0a5cbac
      Jan Blunck 提交于
      The BKL is still used in ext2_put_super(), ext2_fill_super(), ext2_sync_fs()
      ext2_remount() and ext2_write_inode(). From these calls ext2_put_super(),
      ext2_fill_super() and ext2_remount() are protected against each other by
      the struct super_block s_umount rw semaphore. The call in ext2_write_inode()
      could only protect the modification of the ext2_sb_info through
      ext2_update_dynamic_rev() against concurrent ext2_sync_fs() or ext2_remount().
      ext2_fill_super() and ext2_put_super() can be left out because you need a
      valid filesystem reference in all three cases, which you do not have when
      you are one of these functions.
      
      If the BKL is only protecting the modification of the ext2_sb_info it can
      safely be removed since this is protected by the struct ext2_sb_info s_lock.
      Signed-off-by: NJan Blunck <jblunck@suse.de>
      Cc: Jan Kara <jack@suse.cz>
      Signed-off-by: NJan Kara <jack@suse.cz>
      e0a5cbac
    • J
      ext2: Add ext2_sb_info s_lock spinlock · c15271f4
      Jan Blunck 提交于
      Add a spinlock that protects against concurrent modifications of
      s_mount_state, s_blocks_last, s_overhead_last and the content of the
      superblock's buffer pointed to by sbi->s_es. The spinlock is now used in
      ext2_xattr_update_super_block() which was setting the
      EXT2_FEATURE_COMPAT_EXT_ATTR flag on the superblock without protection
      before. Likewise the spinlock is used in ext2_show_options() to have a
      consistent view of the mount options.
      
      This is a preparation patch for removing the BKL from ext2 in the next
      patch.
      Signed-off-by: NJan Blunck <jblunck@suse.de>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Jan Kara <jack@suse.cz>
      Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Signed-off-by: NJan Kara <jack@suse.cz>
      c15271f4
    • J
      ext2: Move ext2_write_super() out of ext2_setup_super() · 4c96a68b
      Jan Blunck 提交于
      Move ext2_write_super() out of ext2_setup_super() as a preparation for the
      next patch that adds a new lock for superblock fields.
      Signed-off-by: NJan Blunck <jblunck@suse.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      4c96a68b
    • J
      ext2: Fold ext2_commit_super() into ext2_sync_super() · ee6921eb
      Jan Blunck 提交于
      Both function originally did similar things except that ext2_sync_super()
      is returning after the call to sync_dirty_buffer(sbh). Therefore this
      patch adds a wait flag to tell ext2_sync_super() if it has to call
      sync_dirty_buffer() to wait for in-progress I/O to finish.
      Signed-off-by: NJan Blunck <jblunck@suse.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      ee6921eb
    • J
      ext2: Remove duplicate code from ext2_sync_fs() · 20da9baf
      Jan Blunck 提交于
      Depending in the state (valid or unchecked) of the filesystem either
      ext2_sync_super() or ext2_commit_super() is called. If the filesystem is
      currently valid (it is checked), we first mark it unchecked and afterwards
      duplicate the work that ext2_sync_super() is doing later. Therefore this
      patch removes the duplicate code and calls ext2_sync_super() directly after
      marking the filesystem unchecked.
      Signed-off-by: NJan Blunck <jblunck@suse.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      20da9baf
    • J
      ext2: Set the write time in ext2_sync_fs() · 269c8db3
      Jan Blunck 提交于
      This is probably a typo since the write time should actually be updated by
      ext2_sync_fs() instead of the mount time.
      Signed-off-by: NJan Blunck <jblunck@suse.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      269c8db3
    • J
      ext2: Use ext2_clear_super_error() in ext2_sync_fs() · 2b8120ef
      Jan Blunck 提交于
      ext2_sync_fs() used to duplicate the code from ext2_clear_super_error().
      Signed-off-by: NJan Blunck <jblunck@suse.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      2b8120ef
  18. 05 3月, 2010 2 次提交
  19. 16 12月, 2009 1 次提交
  20. 10 12月, 2009 2 次提交
    • S
      ext2: clear uptodate flag on super block I/O error · 2074abfe
      Stephen Hemminger 提交于
      This fixes a WARN backtrace in mark_buffer_dirty() that occurs during
      unmount when a USB or floppy device is removed. I reported this a kernel
      regression, but looks like it might have been there for longer
      than that.
      
      The super block update from a previous operation has marked the buffer
      as in error, and the flag has to be cleared before doing the update.
      (Similar code already exists in ext4).
      Signed-off-by: NStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      2074abfe
    • A
      ext2: Unify log messages in ext2 · 2314b07c
      Alexey Fisher 提交于
      make messages produced by ext2 more unified. It should be
      easy to parse.
      
      dmesg before patch:
      [ 4893.684892] reservations ON
      [ 4893.684896] xip option not supported
      [ 4893.684961] EXT2-fs warning: mounting ext3 filesystem as ext2
      [ 4893.684964] EXT2-fs warning: maximal mount count reached, running
      e2fsck is recommended
      [ 4893.684990] EXT II FS: 0.5b, 95/08/09, bs=1024, fs=1024, gc=2,
      bpg=8192, ipg=1280, mo=80010]
      
      dmesg after patch:
      [ 4893.684892] EXT2-fs (loop0): reservations ON
      [ 4893.684896] EXT2-fs (loop0): xip option not supported
      [ 4893.684961] EXT2-fs (loop0): warning: mounting ext3 filesystem as
      ext2
      [ 4893.684964] EXT2-fs (loop0): warning: maximal mount count reached,
      running e2fsck is recommended
      [ 4893.684990] EXT2-fs (loop0): 0.5b, 95/08/09, bs=1024, fs=1024, gc=2,
      bpg=8192, ipg=1280, mo=80010]
      Signed-off-by: NAlexey Fisher <bug-track@fisher-privat.net>
      Reviewed-by: NAndreas Dilger <adilger@sun.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      2314b07c
  21. 24 6月, 2009 1 次提交
  22. 12 6月, 2009 2 次提交