1. 07 1月, 2009 29 次提交
  2. 06 1月, 2009 11 次提交
    • M
      inotify: fix type errors in interfaces · 4ae8978c
      Michael Kerrisk 提交于
      The problems lie in the types used for some inotify interfaces, both at the kernel level and at the glibc level. This mail addresses the kernel problem. I will follow up with some suggestions for glibc changes.
      
      For the sys_inotify_rm_watch() interface, the type of the 'wd' argument is
      currently 'u32', it should be '__s32' .  That is Robert's suggestion, and
      is consistent with the other declarations of watch descriptors in the
      kernel source, in particular, the inotify_event structure in
      include/linux/inotify.h:
      
      struct inotify_event {
              __s32           wd;             /* watch descriptor */
              __u32           mask;           /* watch mask */
              __u32           cookie;         /* cookie to synchronize two events */
              __u32           len;            /* length (including nulls) of name */
              char            name[0];        /* stub for possible name */
      };
      
      The patch makes the changes needed for inotify_rm_watch().
      Signed-off-by: NMichael Kerrisk <mtk.manpages@googlemail.com>
      Cc: Robert Love <rlove@google.com>
      Cc: Vegard Nossum <vegard.nossum@gmail.com>
      Cc: Ulrich Drepper <drepper@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      4ae8978c
    • A
      fix breakage in reiserfs_new_inode() · 2f1169e2
      Al Viro 提交于
      now that we use ih.key earlier, we need to do all its setup early enough
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      2f1169e2
    • A
      fix the treatment of jfs special inodes · 5b45d96b
      Al Viro 提交于
      We used to put them on a single list, without any locking.  Racy.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      5b45d96b
    • L
      vfs: remove duplicate code in get_fs_type() · d8e9650d
      Li Zefan 提交于
      save 14 bytes:
      
         text    data     bss     dec     hex filename
         1354      32       4    1390     56e fs/filesystems.o.before
         text    data     bss     dec     hex filename
         1340      32       4    1376     560 fs/filesystems.o
      Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      d8e9650d
    • C
      add a vfs_fsync helper · 4c728ef5
      Christoph Hellwig 提交于
      Fsync currently has a fdatawrite/fdatawait pair around the method call,
      and a mutex_lock/unlock of the inode mutex.  All callers of fsync have
      to duplicate this, but we have a few and most of them don't quite get
      it right.  This patch adds a new vfs_fsync that takes care of this.
      It's a little more complicated as usual as ->fsync might get a NULL file
      pointer and just a dentry from nfsd, but otherwise gets afile and we
      want to take the mapping and file operations from it when it is there.
      
      Notes on the fsync callers:
      
       - ecryptfs wasn't calling filemap_fdatawrite / filemap_fdatawait on the
         	lower file
       - coda wasn't calling filemap_fdatawrite / filemap_fdatawait on the host
      	file, and returning 0 when ->fsync was missing
       - shm wasn't calling either filemap_fdatawrite / filemap_fdatawait nor
         taking i_mutex.  Now given that shared memory doesn't have disk
         backing not doing anything in fsync seems fine and I left it out of
         the vfs_fsync conversion for now, but in that case we might just
         not pass it through to the lower file at all but just call the no-op
         simple_sync_file directly.
      
      [and now actually export vfs_fsync]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      4c728ef5
    • E
      sys_execve and sys_uselib do not call into fsnotify · 6110e3ab
      Eric Paris 提交于
      sys_execve and sys_uselib do not call into fsnotify so inotify does not get
      open events for these types of syscalls.  This patch simply makes the
      requisite fsnotify calls.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      6110e3ab
    • A
      zero i_uid/i_gid on inode allocation · 56ff5efa
      Al Viro 提交于
      ... and don't bother in callers.  Don't bother with zeroing i_blocks,
      while we are at it - it's already been zeroed.
      
      i_mode is not worth the effort; it has no common default value.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      56ff5efa
    • A
      inode->i_op is never NULL · acfa4380
      Al Viro 提交于
      We used to have rather schizophrenic set of checks for NULL ->i_op even
      though it had been eliminated years ago.  You'd need to go out of your
      way to set it to NULL explicitly _and_ a bunch of code would die on
      such inodes anyway.  After killing two remaining places that still
      did that bogosity, all that crap can go away.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      acfa4380
    • A
      ntfs: don't NULL i_op · 9742df33
      Al Viro 提交于
      it's already set to empty table (and no, ntfs doesn't have any explicit
      checks for NULL ->i_op or NULL ->i_fop)
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      9742df33
    • A
      isofs check for NULL ->i_op in root directory is dead code · 261964c6
      Al Viro 提交于
      for one thing it never happens, for another we check that inode
      is a directory right after that place anyway (and we'd already
      checked that reading it from disk has not failed).
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      261964c6
    • A
      affs: do not zero ->i_op · c765d479
      Al Viro 提交于
      it is already set to empty table and should never be NULL
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      c765d479