1. 16 1月, 2011 1 次提交
  2. 13 1月, 2011 1 次提交
  3. 10 1月, 2011 2 次提交
  4. 07 1月, 2011 6 次提交
    • N
      fs: rcu-walk aware d_revalidate method · 34286d66
      Nick Piggin 提交于
      Require filesystems be aware of .d_revalidate being called in rcu-walk
      mode (nd->flags & LOOKUP_RCU). For now do a simple push down, returning
      -ECHILD from all implementations.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      34286d66
    • N
      fs: dcache reduce branches in lookup path · fb045adb
      Nick Piggin 提交于
      Reduce some branches and memory accesses in dcache lookup by adding dentry
      flags to indicate common d_ops are set, rather than having to check them.
      This saves a pointer memory access (dentry->d_op) in common path lookup
      situations, and saves another pointer load and branch in cases where we
      have d_op but not the particular operation.
      
      Patched with:
      
      git grep -E '[.>]([[:space:]])*d_op([[:space:]])*=' | xargs sed -e 's/\([^\t ]*\)->d_op = \(.*\);/d_set_d_op(\1, \2);/' -e 's/\([^\t ]*\)\.d_op = \(.*\);/d_set_d_op(\&\1, \2);/' -i
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      fb045adb
    • N
      fs: change d_hash for rcu-walk · b1e6a015
      Nick Piggin 提交于
      Change d_hash so it may be called from lock-free RCU lookups. See similar
      patch for d_compare for details.
      
      For in-tree filesystems, this is just a mechanical change.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      b1e6a015
    • N
      fs: change d_compare for rcu-walk · 621e155a
      Nick Piggin 提交于
      Change d_compare so it may be called from lock-free RCU lookups. This
      does put significant restrictions on what may be done from the callback,
      however there don't seem to have been any problems with in-tree fses.
      If some strange use case pops up that _really_ cannot cope with the
      rcu-walk rules, we can just add new rcu-unaware callbacks, which would
      cause name lookup to drop out of rcu-walk mode.
      
      For in-tree filesystems, this is just a mechanical change.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      621e155a
    • N
      cifs: dont overwrite dentry name in d_revalidate · 79eb4dde
      Nick Piggin 提交于
      Use vfat's method for dealing with negative dentries to preserve case,
      rather than overwrite dentry name in d_revalidate, which is a bit ugly
      and also gets in the way of doing lock-free path walking.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      79eb4dde
    • N
      cifs: don't overwrite dentry name in d_revalidate · 262f86ad
      Nick Piggin 提交于
      Instead, use fatfs's method for dealing with negative dentries to
      preserve case, rather than overwrite dentry name in d_revalidate, which
      is a bit ugly and also gets in the way of doing lock-free path walking.
      Signed-off-by: NNick Piggin <npiggin@kernel.dk>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      262f86ad
  5. 18 10月, 2010 6 次提交
  6. 13 10月, 2010 2 次提交
    • J
      cifs: don't use vfsmount to pin superblock for oplock breaks · d7c86ff8
      Jeff Layton 提交于
      Filesystems aren't really supposed to do anything with a vfsmount. It's
      considered a layering violation since vfsmounts are entirely managed at
      the VFS layer.
      
      CIFS currently keeps an active reference to a vfsmount in order to
      prevent the superblock vanishing before an oplock break has completed.
      What we really want to do instead is to keep sb->s_active high until the
      oplock break has completed. This patch borrows the scheme that NFS uses
      for handling sillyrenames.
      
      An atomic_t is added to the cifs_sb_info. When it transitions from 0 to
      1, an extra reference to the superblock is taken (by bumping the
      s_active value). When it transitions from 1 to 0, that reference is
      dropped and a the superblock teardown may proceed if there are no more
      references to it.
      
      Also, the vfsmount pointer is removed from cifsFileInfo and from
      cifs_new_fileinfo, and some bogus forward declarations are removed from
      cifsfs.h.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Acked-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      d7c86ff8
    • J
      cifs: keep dentry reference in cifsFileInfo instead of inode reference · a5e18bc3
      Jeff Layton 提交于
      cifsFileInfo is a bit problematic. It contains a reference back to the
      struct file itself. This makes it difficult for a cifsFileInfo to exist
      without a corresponding struct file.
      
      It would be better instead of the cifsFileInfo just held info pertaining
      to the open file on the server instead without any back refrences to the
      struct file. This would allow it to exist after the filp to which it was
      originally attached was closed.
      
      Much of the use of the file pointer in this struct is to get at the
      dentry.  Begin divorcing the cifsFileInfo from the struct file by
      keeping a reference to the dentry. Since the dentry will have a
      reference to the inode, we can eliminate the "pInode" field too and
      convert the igrab/iput to dget/dput.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-by: NSuresh Jayaraman <sjayaraman@suse.de>
      Acked-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      a5e18bc3
  7. 07 10月, 2010 3 次提交
  8. 30 9月, 2010 5 次提交
  9. 17 8月, 2010 2 次提交
  10. 02 8月, 2010 1 次提交
  11. 23 7月, 2010 1 次提交
    • T
      cifs: use workqueue instead of slow-work · 9b646972
      Tejun Heo 提交于
      Workqueue can now handle high concurrency.  Use system_nrt_wq
      instead of slow-work.
      
      * Updated is_valid_oplock_break() to not call cifs_oplock_break_put()
        as advised by Steve French.  It might cause deadlock.  Instead,
        reference is increased after queueing succeeded and
        cifs_oplock_break() briefly grabs GlobalSMBSeslock before putting
        the cfile to make sure it doesn't put before the matching get is
        finished.
      
      * Anton Blanchard reported that cifs conversion was using now gone
        system_single_wq.  Use system_nrt_wq which provides non-reentrance
        guarantee which is enough and much better.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-by: NSteve French <sfrench@samba.org>
      Cc: Anton Blanchard <anton@samba.org>
      9b646972
  12. 17 6月, 2010 2 次提交
    • J
      cifs: pass instantiated filp back after open call · 6ca9f3ba
      Jeff Layton 提交于
      The current scheme of sticking open files on a list and assuming that
      cifs_open will scoop them off of it is broken and leads to "Busy
      inodes after umount..." errors at unmount time.
      
      The problem is that there is no guarantee that cifs_open will always
      be called after a ->lookup or ->create operation. If there are
      permissions or other problems, then it's quite likely that it *won't*
      be called.
      
      Fix this by fully instantiating the filp whenever the file is created
      and pass that filp back to the VFS. If there is a problem, the VFS
      can clean up the references.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-and-Tested-by: NSuresh Jayaraman <sjayaraman@suse.de>
      6ca9f3ba
    • J
      cifs: move cifs_new_fileinfo call out of cifs_posix_open · 2422f676
      Jeff Layton 提交于
      Having cifs_posix_open call cifs_new_fileinfo is problematic and
      inconsistent with how "regular" opens work. It's also buggy as
      cifs_reopen_file calls this function on a reconnect, which creates a new
      struct cifsFileInfo that just gets leaked.
      
      Push it out into the callers. This also allows us to get rid of the
      "mnt" arg to cifs_posix_open.
      
      Finally, in the event that a cifsFileInfo isn't or can't be created, we
      always want to close the filehandle out on the server as the client
      won't have a record of the filehandle and can't actually use it. Make
      sure that CIFSSMBClose is called in those cases.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Reviewed-and-Tested-by: NSuresh Jayaraman <sjayaraman@suse.de>
      2422f676
  13. 18 5月, 2010 1 次提交
  14. 11 5月, 2010 2 次提交
  15. 23 4月, 2010 1 次提交
  16. 21 4月, 2010 1 次提交
    • J
      [CIFS] Neaten cERROR and cFYI macros, reduce text space · b6b38f70
      Joe Perches 提交于
      Neaten cERROR and cFYI macros, reduce text space
      ~2.5K
      
      Convert '__FILE__ ": " fmt' to '"%s: " fmt', __FILE__' to save text space
      Surround macros with do {} while
      Add parentheses to macros
      Make statement expression macro from macro with assign
      Remove now unnecessary parentheses from cFYI and cERROR uses
      
      defconfig with CIFS support old
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       156012	   1760	    148	 157920	  268e0	fs/cifs/built-in.o
      
      defconfig with CIFS support old
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       153508	   1760	    148	 155416	  25f18	fs/cifs/built-in.o
      
      allyesconfig old:
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       309138	   3864	  74824	 387826	  5eaf2	fs/cifs/built-in.o
      
      allyesconfig new
      $ size fs/cifs/built-in.o
         text	   data	    bss	    dec	    hex	filename
       305655	   3864	  74824	 384343	  5dd57	fs/cifs/built-in.o
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      b6b38f70
  17. 06 3月, 2010 1 次提交
    • J
      cifs: overhaul cifs_revalidate and rename to cifs_revalidate_dentry · df2cf170
      Jeff Layton 提交于
      cifs_revalidate is renamed to cifs_revalidate_dentry as a later patch
      will add a by-filehandle variant.
      
      Add a new "invalid_mapping" flag to the cifsInodeInfo that indicates
      that the pagecache is considered invalid. Add a new routine to check
      inode attributes whenever they're updated and set that flag if the inode
      has changed on the server.
      
      cifs_revalidate_dentry is then changed to just update the attrcache if
      needed and then to zap the pagecache if it's not valid.
      
      There are some other behavior changes in here as well. Open files are
      now allowed to have their caches invalidated. I see no reason why we'd
      want to keep stale data around just because a file is open. Also,
      cifs_revalidate_cache uses the server_eof for revalidating the file
      size since that should more closely match the size of the file on the
      server.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <sfrench@us.ibm.com>
      df2cf170
  18. 10 12月, 2009 1 次提交
    • C
      vfs: Implement proper O_SYNC semantics · 6b2f3d1f
      Christoph Hellwig 提交于
      While Linux provided an O_SYNC flag basically since day 1, it took until
      Linux 2.4.0-test12pre2 to actually get it implemented for filesystems,
      since that day we had generic_osync_around with only minor changes and the
      great "For now, when the user asks for O_SYNC, we'll actually give
      O_DSYNC" comment.  This patch intends to actually give us real O_SYNC
      semantics in addition to the O_DSYNC semantics.  After Jan's O_SYNC
      patches which are required before this patch it's actually surprisingly
      simple, we just need to figure out when to set the datasync flag to
      vfs_fsync_range and when not.
      
      This patch renames the existing O_SYNC flag to O_DSYNC while keeping it's
      numerical value to keep binary compatibility, and adds a new real O_SYNC
      flag.  To guarantee backwards compatiblity it is defined as expanding to
      both the O_DSYNC and the new additional binary flag (__O_SYNC) to make
      sure we are backwards-compatible when compiled against the new headers.
      
      This also means that all places that don't care about the differences can
      just check O_DSYNC and get the right behaviour for O_SYNC, too - only
      places that actuall care need to check __O_SYNC in addition.  Drivers and
      network filesystems have been updated in a fail safe way to always do the
      full sync magic if O_DSYNC is set.  The few places setting O_SYNC for
      lower layers are kept that way for now to stay failsafe.
      
      We enforce that O_DSYNC is set when __O_SYNC is set early in the open path
      to make sure we always get these sane options.
      
      Note that parisc really screwed up their headers as they already define a
      O_DSYNC that has always been a no-op.  We try to repair it by using it for
      the new O_DSYNC and redefinining O_SYNC to send both the traditional
      O_SYNC numerical value _and_ the O_DSYNC one.
      
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Grant Grundler <grundler@parisc-linux.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Andreas Dilger <adilger@sun.com>
      Acked-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Acked-by: NKyle McMartin <kyle@mcmartin.ca>
      Acked-by: NUlrich Drepper <drepper@redhat.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJan Kara <jack@suse.cz>
      6b2f3d1f
  19. 25 11月, 2009 1 次提交