]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 27 Mar 2009 23:23:12 +0000 (16:23 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 27 Mar 2009 23:23:12 +0000 (16:23 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (37 commits)
  fs: avoid I_NEW inodes
  Merge code for single and multiple-instance mounts
  Remove get_init_pts_sb()
  Move common mknod_ptmx() calls into caller
  Parse mount options just once and copy them to super block
  Unroll essentials of do_remount_sb() into devpts
  vfs: simple_set_mnt() should return void
  fs: move bdev code out of buffer.c
  constify dentry_operations: rest
  constify dentry_operations: configfs
  constify dentry_operations: sysfs
  constify dentry_operations: JFS
  constify dentry_operations: OCFS2
  constify dentry_operations: GFS2
  constify dentry_operations: FAT
  constify dentry_operations: FUSE
  constify dentry_operations: procfs
  constify dentry_operations: ecryptfs
  constify dentry_operations: CIFS
  constify dentry_operations: AFS
  ...

93 files changed:
arch/alpha/kernel/entry.S
arch/alpha/kernel/osf_sys.c
arch/ia64/ia32/ia32_entry.S
arch/ia64/kernel/perfmon.c
arch/mips/kernel/linux32.c
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-o32.S
arch/parisc/kernel/syscall_table.S
arch/powerpc/include/asm/systbl.h
arch/s390/kernel/compat_wrapper.S
arch/x86/ia32/ia32entry.S
arch/x86/ia32/sys_ia32.c
arch/x86/include/asm/ia32.h
arch/x86/include/asm/sys_ia32.h
drivers/mtd/mtdsuper.c
fs/9p/v9fs_vfs.h
fs/9p/vfs_dentry.c
fs/9p/vfs_super.c
fs/adfs/adfs.h
fs/adfs/dir.c
fs/affs/affs.h
fs/affs/amigaffs.c
fs/affs/namei.c
fs/afs/dir.c
fs/anon_inodes.c
fs/autofs/root.c
fs/autofs4/inode.c
fs/autofs4/root.c
fs/block_dev.c
fs/buffer.c
fs/cifs/cifsfs.c
fs/cifs/cifsfs.h
fs/cifs/dir.c
fs/coda/dir.c
fs/compat.c
fs/configfs/dir.c
fs/dcache.c
fs/devpts/inode.c
fs/drop_caches.c
fs/ecryptfs/dentry.c
fs/ecryptfs/ecryptfs_kernel.h
fs/fat/namei_msdos.c
fs/fat/namei_vfat.c
fs/fuse/dir.c
fs/fuse/fuse_i.h
fs/gfs2/ops_dentry.c
fs/gfs2/super.h
fs/hfs/hfs_fs.h
fs/hfs/sysdep.c
fs/hfsplus/hfsplus_fs.h
fs/hfsplus/inode.c
fs/hostfs/hostfs_kern.c
fs/hpfs/dentry.c
fs/inode.c
fs/isofs/inode.c
fs/jfs/jfs_inode.h
fs/jfs/namei.c
fs/libfs.c
fs/namei.c
fs/namespace.c
fs/ncpfs/dir.c
fs/nfs/dir.c
fs/nfs/nfs4_fs.h
fs/notify/inotify/inotify.c
fs/ocfs2/dcache.c
fs/ocfs2/dcache.h
fs/pipe.c
fs/proc/base.c
fs/proc/generic.c
fs/proc/proc_sysctl.c
fs/proc/root.c
fs/quota/dquot.c
fs/reiserfs/xattr.c
fs/smbfs/dir.c
fs/super.c
fs/sysfs/dir.c
fs/sysv/namei.c
fs/sysv/sysv.h
fs/ubifs/super.c
fs/ufs/inode.c
fs/ufs/namei.c
fs/ufs/super.c
fs/ufs/ufs.h
include/linux/buffer_head.h
include/linux/compat.h
include/linux/dcache.h
include/linux/fs.h
include/linux/ncp_fs.h
include/linux/nfs_fs.h
include/linux/nfs_xdr.h
kernel/cgroup.c
net/socket.c
net/sunrpc/rpc_pipe.c

index e4a54b615894f270b97fbf3a9ddd348e2abcae3a..b45d913a51c368881b4311d1f1887566829b09a8 100644 (file)
@@ -903,8 +903,9 @@ sys_alpha_pipe:
        stq     $26, 0($sp)
        .prologue 0
 
+       mov     $31, $17
        lda     $16, 8($sp)
-       jsr     $26, do_pipe
+       jsr     $26, do_pipe_flags
 
        ldq     $26, 0($sp)
        bne     $0, 1f
index ae41f097864b8ccc1ee49622dd96e6a88d8d4f39..42ee05981e7173d39ac6e047dabce5b46075669b 100644 (file)
@@ -46,8 +46,6 @@
 #include <asm/hwrpb.h>
 #include <asm/processor.h>
 
-extern int do_pipe(int *);
-
 /*
  * Brk needs to return an error.  Still support Linux's brk(0) query idiom,
  * which OSF programs just shouldn't be doing.  We're still not quite
index a46f8395e9a51857b0c0364a8b80733bd0575d64..af9405cd70e5fa36a3f786958a4fa0cc0a5cc300 100644 (file)
@@ -240,7 +240,7 @@ ia32_syscall_table:
        data8 sys_ni_syscall
        data8 sys_umask           /* 60 */
        data8 sys_chroot
-       data8 sys_ustat
+       data8 compat_sys_ustat
        data8 sys_dup2
        data8 sys_getppid
        data8 sys_getpgrp         /* 65 */
index 0e499757309bfbdab35d1233126e4259d9f42bdd..5c0f408cfd719f02ded2c58dc6ebf2b3c181c7b5 100644 (file)
@@ -2196,7 +2196,7 @@ pfmfs_delete_dentry(struct dentry *dentry)
        return 1;
 }
 
-static struct dentry_operations pfmfs_dentry_operations = {
+static const struct dentry_operations pfmfs_dentry_operations = {
        .d_delete = pfmfs_delete_dentry,
 };
 
index 49aac6e17df932a89658840302c7332a8c27f012..2a472713de8e535353ec32718b181a8405b487a6 100644 (file)
@@ -355,40 +355,6 @@ SYSCALL_DEFINE1(32_personality, unsigned long, personality)
        return ret;
 }
 
-/* ustat compatibility */
-struct ustat32 {
-       compat_daddr_t  f_tfree;
-       compat_ino_t    f_tinode;
-       char            f_fname[6];
-       char            f_fpack[6];
-};
-
-extern asmlinkage long sys_ustat(dev_t dev, struct ustat __user * ubuf);
-
-SYSCALL_DEFINE2(32_ustat, dev_t, dev, struct ustat32 __user *, ubuf32)
-{
-       int err;
-       struct ustat tmp;
-       struct ustat32 tmp32;
-       mm_segment_t old_fs = get_fs();
-
-       set_fs(KERNEL_DS);
-       err = sys_ustat(dev, (struct ustat __user *)&tmp);
-       set_fs(old_fs);
-
-       if (err)
-               goto out;
-
-       memset(&tmp32, 0, sizeof(struct ustat32));
-       tmp32.f_tfree = tmp.f_tfree;
-       tmp32.f_tinode = tmp.f_tinode;
-
-       err = copy_to_user(ubuf32, &tmp32, sizeof(struct ustat32)) ? -EFAULT : 0;
-
-out:
-       return err;
-}
-
 SYSCALL_DEFINE4(32_sendfile, long, out_fd, long, in_fd,
        compat_off_t __user *, offset, s32, count)
 {
index 7438e92f8a010566e183f986190b14de82e70bd7..f61d6b0e5731dadfcac24715babed10639ce97d2 100644 (file)
@@ -253,7 +253,7 @@ EXPORT(sysn32_call_table)
        PTR     compat_sys_utime                /* 6130 */
        PTR     sys_mknod
        PTR     sys_32_personality
-       PTR     sys_32_ustat
+       PTR     compat_sys_ustat
        PTR     compat_sys_statfs
        PTR     compat_sys_fstatfs              /* 6135 */
        PTR     sys_sysfs
index b0fef4ff9827610210ef3dc16d903d347491169d..60997f1f69d4e857861df014ab37e403f1d53c60 100644 (file)
@@ -265,7 +265,7 @@ sys_call_table:
        PTR     sys_olduname
        PTR     sys_umask                       /* 4060 */
        PTR     sys_chroot
-       PTR     sys_32_ustat
+       PTR     compat_sys_ustat
        PTR     sys_dup2
        PTR     sys_getppid
        PTR     sys_getpgrp                     /* 4065 */
index 303d2b647e418daab682f586565ade19e5420325..03b9a01bc16cf49340db4d69329a08338e47650f 100644 (file)
        ENTRY_OURS(newuname)
        ENTRY_SAME(umask)               /* 60 */
        ENTRY_SAME(chroot)
-       ENTRY_SAME(ustat)
+       ENTRY_COMP(ustat)
        ENTRY_SAME(dup2)
        ENTRY_SAME(getppid)
        ENTRY_SAME(getpgrp)             /* 65 */
index 72353f6070a436747817d2394c8e8f9ff67898b0..fe166491e9dcf9a821fb10be53678b48a3f3578e 100644 (file)
@@ -65,7 +65,7 @@ SYSCALL(ni_syscall)
 SYSX(sys_ni_syscall,sys_olduname, sys_olduname)
 COMPAT_SYS_SPU(umask)
 SYSCALL_SPU(chroot)
-SYSCALL(ustat)
+COMPAT_SYS(ustat)
 SYSCALL_SPU(dup2)
 SYSCALL_SPU(getppid)
 SYSCALL_SPU(getpgrp)
index 62c706eb0de6d427401a2325dbb73e6982eec6a8..87cf5a79a351c38e5dfed555fca336b3fe6e3575 100644 (file)
@@ -252,7 +252,7 @@ sys32_chroot_wrapper:
 sys32_ustat_wrapper:
        llgfr   %r2,%r2                 # dev_t
        llgtr   %r3,%r3                 # struct ustat *
-       jg      sys_ustat
+       jg      compat_sys_ustat
 
        .globl  sys32_dup2_wrapper
 sys32_dup2_wrapper:
index 5a0d76dc56a46431690702be8f745d6813db4cfc..8ef8876666b2ed5aaabcc6f21d7129fde453ca75 100644 (file)
@@ -557,7 +557,7 @@ ia32_sys_call_table:
        .quad sys32_olduname
        .quad sys_umask         /* 60 */
        .quad sys_chroot
-       .quad sys32_ustat
+       .quad compat_sys_ustat
        .quad sys_dup2
        .quad sys_getppid
        .quad sys_getpgrp               /* 65 */
index 6c0d7f6231af26e3eb3fb26821d4dbf493233fc2..efac92fd1efbc3f3a7b1fa923b0314e951249555 100644 (file)
@@ -638,28 +638,6 @@ long sys32_uname(struct old_utsname __user *name)
        return err ? -EFAULT : 0;
 }
 
-long sys32_ustat(unsigned dev, struct ustat32 __user *u32p)
-{
-       struct ustat u;
-       mm_segment_t seg;
-       int ret;
-
-       seg = get_fs();
-       set_fs(KERNEL_DS);
-       ret = sys_ustat(dev, (struct ustat __user *)&u);
-       set_fs(seg);
-       if (ret < 0)
-               return ret;
-
-       if (!access_ok(VERIFY_WRITE, u32p, sizeof(struct ustat32)) ||
-           __put_user((__u32) u.f_tfree, &u32p->f_tfree) ||
-           __put_user((__u32) u.f_tinode, &u32p->f_tfree) ||
-           __copy_to_user(&u32p->f_fname, u.f_fname, sizeof(u.f_fname)) ||
-           __copy_to_user(&u32p->f_fpack, u.f_fpack, sizeof(u.f_fpack)))
-               ret = -EFAULT;
-       return ret;
-}
-
 asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv,
                             compat_uptr_t __user *envp, struct pt_regs *regs)
 {
index 50ca486fd88c9468fe52b4a9fb357f192fbd6ab0..1f7e62517284618d6fd08aad123f6e34da8caa26 100644 (file)
@@ -129,13 +129,6 @@ typedef struct compat_siginfo {
        } _sifields;
 } compat_siginfo_t;
 
-struct ustat32 {
-       __u32                   f_tfree;
-       compat_ino_t            f_tinode;
-       char                    f_fname[6];
-       char                    f_fpack[6];
-};
-
 #define IA32_STACK_TOP IA32_PAGE_OFFSET
 
 #ifdef __KERNEL__
index ffb08be2a5303405c1a5629766f84f1964018a3b..72a6dcd1299b6154562f5717c9ef751a9e287dc2 100644 (file)
@@ -70,8 +70,6 @@ struct old_utsname;
 asmlinkage long sys32_olduname(struct oldold_utsname __user *);
 long sys32_uname(struct old_utsname __user *);
 
-long sys32_ustat(unsigned, struct ustat32 __user *);
-
 asmlinkage long sys32_execve(char __user *, compat_uptr_t __user *,
                             compat_uptr_t __user *, struct pt_regs *);
 asmlinkage long sys32_clone(unsigned int, unsigned int, struct pt_regs *);
index 00d46e137b2ab306ca3775c4f216d6016a44df37..92285d0089c278dd0e72a60f58f7a912b831f1ec 100644 (file)
@@ -81,13 +81,16 @@ static int get_sb_mtd_aux(struct file_system_type *fs_type, int flags,
 
        /* go */
        sb->s_flags |= MS_ACTIVE;
-       return simple_set_mnt(mnt, sb);
+       simple_set_mnt(mnt, sb);
+
+       return 0;
 
        /* new mountpoint for an already mounted superblock */
 already_mounted:
        DEBUG(1, "MTDSB: Device %d (\"%s\") is already mounted\n",
              mtd->index, mtd->name);
-       ret = simple_set_mnt(mnt, sb);
+       simple_set_mnt(mnt, sb);
+       ret = 0;
        goto out_put;
 
 out_error:
index c295ba786edd9082dbd9026ef2324a2d684ea1a3..f0c7de78e205b1063fa9d552617c7d17a4123997 100644 (file)
@@ -41,8 +41,8 @@ extern struct file_system_type v9fs_fs_type;
 extern const struct address_space_operations v9fs_addr_operations;
 extern const struct file_operations v9fs_file_operations;
 extern const struct file_operations v9fs_dir_operations;
-extern struct dentry_operations v9fs_dentry_operations;
-extern struct dentry_operations v9fs_cached_dentry_operations;
+extern const struct dentry_operations v9fs_dentry_operations;
+extern const struct dentry_operations v9fs_cached_dentry_operations;
 
 struct inode *v9fs_get_inode(struct super_block *sb, int mode);
 ino_t v9fs_qid2ino(struct p9_qid *qid);
index 06dcc7c4f2343ebb9cced85a8da46c880849794f..d74325295b1e43d74617d89798a8deb78ef6a5d6 100644 (file)
@@ -104,12 +104,12 @@ void v9fs_dentry_release(struct dentry *dentry)
        }
 }
 
-struct dentry_operations v9fs_cached_dentry_operations = {
+const struct dentry_operations v9fs_cached_dentry_operations = {
        .d_delete = v9fs_cached_dentry_delete,
        .d_release = v9fs_dentry_release,
 };
 
-struct dentry_operations v9fs_dentry_operations = {
+const struct dentry_operations v9fs_dentry_operations = {
        .d_delete = v9fs_dentry_delete,
        .d_release = v9fs_dentry_release,
 };
index 93212e40221ac10d39757a09cdacffb8fb922edb..5f8ab8adb5f5d7bd47fe65c61a25df8d78b82ca3 100644 (file)
@@ -168,8 +168,9 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
        p9stat_free(st);
        kfree(st);
 
-P9_DPRINTK(P9_DEBUG_VFS, " return simple set mount\n");
-       return simple_set_mnt(mnt, sb);
+P9_DPRINTK(P9_DEBUG_VFS, " simple set mount, return 0\n");
+       simple_set_mnt(mnt, sb);
+       return 0;
 
 release_sb:
        if (sb) {
index 831157502d5ae58a25bcec65c9af58d5eabc871f..e0a85dbeeb887138b2389d417b2da3354af0d271 100644 (file)
@@ -86,7 +86,7 @@ void __adfs_error(struct super_block *sb, const char *function,
 /* dir_*.c */
 extern const struct inode_operations adfs_dir_inode_operations;
 extern const struct file_operations adfs_dir_operations;
-extern struct dentry_operations adfs_dentry_operations;
+extern const struct dentry_operations adfs_dentry_operations;
 extern struct adfs_dir_ops adfs_f_dir_ops;
 extern struct adfs_dir_ops adfs_fplus_dir_ops;
 
index 85a30e929800aea513f28f3e7dfd6827bb39814f..e867ccf372466aaa495d360cc1605fb43a05dc95 100644 (file)
@@ -263,7 +263,7 @@ adfs_compare(struct dentry *parent, struct qstr *entry, struct qstr *name)
        return 0;
 }
 
-struct dentry_operations adfs_dentry_operations = {
+const struct dentry_operations adfs_dentry_operations = {
        .d_hash         = adfs_hash,
        .d_compare      = adfs_compare,
 };
index e9ec915f7553f1e7e821d40a7ee9671b5c9eea1b..1a2d5e3c7f4eb5120dae33137d44cd0e9ef01849 100644 (file)
@@ -199,8 +199,7 @@ extern const struct address_space_operations         affs_symlink_aops;
 extern const struct address_space_operations    affs_aops;
 extern const struct address_space_operations    affs_aops_ofs;
 
-extern struct dentry_operations         affs_dentry_operations;
-extern struct dentry_operations         affs_dentry_operations_intl;
+extern const struct dentry_operations   affs_dentry_operations;
 
 static inline void
 affs_set_blocksize(struct super_block *sb, int size)
index 805573005de66614cec77f00f83593c61fa1f027..7d0f0a30f7a3670d804b9c045e4385d961e32cdb 100644 (file)
@@ -179,14 +179,18 @@ affs_remove_link(struct dentry *dentry)
                affs_lock_dir(dir);
                affs_fix_dcache(dentry, link_ino);
                retval = affs_remove_hash(dir, link_bh);
-               if (retval)
+               if (retval) {
+                       affs_unlock_dir(dir);
                        goto done;
+               }
                mark_buffer_dirty_inode(link_bh, inode);
 
                memcpy(AFFS_TAIL(sb, bh)->name, AFFS_TAIL(sb, link_bh)->name, 32);
                retval = affs_insert_hash(dir, bh);
-               if (retval)
+               if (retval) {
+                       affs_unlock_dir(dir);
                        goto done;
+               }
                mark_buffer_dirty_inode(bh, inode);
 
                affs_unlock_dir(dir);
index cfcf1b6cf82be05dbd9001e494c55cfa26b4b790..960d336ec694c3d1dc83c7941753a2c7199f317a 100644 (file)
@@ -19,12 +19,12 @@ static int   affs_intl_toupper(int ch);
 static int      affs_intl_hash_dentry(struct dentry *, struct qstr *);
 static int       affs_intl_compare_dentry(struct dentry *, struct qstr *, struct qstr *);
 
-struct dentry_operations affs_dentry_operations = {
+const struct dentry_operations affs_dentry_operations = {
        .d_hash         = affs_hash_dentry,
        .d_compare      = affs_compare_dentry,
 };
 
-static struct dentry_operations affs_intl_dentry_operations = {
+static const struct dentry_operations affs_intl_dentry_operations = {
        .d_hash         = affs_intl_hash_dentry,
        .d_compare      = affs_intl_compare_dentry,
 };
index 99cf390641f74ee198e5f37d53b9a821b2268f50..9bd757774c9ed0d154b7f8ec55f93db18f08c9bc 100644 (file)
@@ -62,7 +62,7 @@ const struct inode_operations afs_dir_inode_operations = {
        .setattr        = afs_setattr,
 };
 
-static struct dentry_operations afs_fs_dentry_operations = {
+static const struct dentry_operations afs_fs_dentry_operations = {
        .d_revalidate   = afs_d_revalidate,
        .d_delete       = afs_d_delete,
        .d_release      = afs_d_release,
index 3bbdb9d023767a142f8917bc793437abf586f211..1dd96d4406c09dde60b038a0eb5900606d59e18c 100644 (file)
@@ -48,7 +48,7 @@ static struct file_system_type anon_inode_fs_type = {
        .get_sb         = anon_inodefs_get_sb,
        .kill_sb        = kill_anon_super,
 };
-static struct dentry_operations anon_inodefs_dentry_operations = {
+static const struct dentry_operations anon_inodefs_dentry_operations = {
        .d_delete       = anon_inodefs_delete_dentry,
 };
 
index 8aacade56956ec650daaa537e76370724277b765..4a1401cea0a1737e45b19d4d7850fe17da55282d 100644 (file)
@@ -192,7 +192,7 @@ static int autofs_revalidate(struct dentry * dentry, struct nameidata *nd)
        return 1;
 }
 
-static struct dentry_operations autofs_dentry_operations = {
+static const struct dentry_operations autofs_dentry_operations = {
        .d_revalidate   = autofs_revalidate,
 };
 
index 716e12b627b239d23176551ffec355e0813ad6dc..69c8142da8386577cba280ba13d229db16067580 100644 (file)
@@ -310,7 +310,7 @@ static struct autofs_info *autofs4_mkroot(struct autofs_sb_info *sbi)
        return ino;
 }
 
-static struct dentry_operations autofs4_sb_dentry_operations = {
+static const struct dentry_operations autofs4_sb_dentry_operations = {
        .d_release      = autofs4_dentry_release,
 };
 
index 2a41c2a7fc521fd1f5bac1043077a146ef57c417..74b1469a950452ba86f661b79c1390d03c464857 100644 (file)
@@ -349,13 +349,13 @@ void autofs4_dentry_release(struct dentry *de)
 }
 
 /* For dentries of directories in the root dir */
-static struct dentry_operations autofs4_root_dentry_operations = {
+static const struct dentry_operations autofs4_root_dentry_operations = {
        .d_revalidate   = autofs4_revalidate,
        .d_release      = autofs4_dentry_release,
 };
 
 /* For other dentries */
-static struct dentry_operations autofs4_dentry_operations = {
+static const struct dentry_operations autofs4_dentry_operations = {
        .d_revalidate   = autofs4_revalidate,
        .d_release      = autofs4_dentry_release,
 };
index b3c1efff5e1db0180c610bf0df465527587c934c..8c3c6899ccf33f433969e1b48b045a6a896b55ef 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/module.h>
 #include <linux/blkpg.h>
 #include <linux/buffer_head.h>
+#include <linux/pagevec.h>
 #include <linux/writeback.h>
 #include <linux/mpage.h>
 #include <linux/mount.h>
@@ -174,6 +175,151 @@ blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
                                iov, offset, nr_segs, blkdev_get_blocks, NULL);
 }
 
+/*
+ * Write out and wait upon all the dirty data associated with a block
+ * device via its mapping.  Does not take the superblock lock.
+ */
+int sync_blockdev(struct block_device *bdev)
+{
+       int ret = 0;
+
+       if (bdev)
+               ret = filemap_write_and_wait(bdev->bd_inode->i_mapping);
+       return ret;
+}
+EXPORT_SYMBOL(sync_blockdev);
+
+/*
+ * Write out and wait upon all dirty data associated with this
+ * device.   Filesystem data as well as the underlying block
+ * device.  Takes the superblock lock.
+ */
+int fsync_bdev(struct block_device *bdev)
+{
+       struct super_block *sb = get_super(bdev);
+       if (sb) {
+               int res = fsync_super(sb);
+               drop_super(sb);
+               return res;
+       }
+       return sync_blockdev(bdev);
+}
+
+/**
+ * freeze_bdev  --  lock a filesystem and force it into a consistent state
+ * @bdev:      blockdevice to lock
+ *
+ * This takes the block device bd_mount_sem to make sure no new mounts
+ * happen on bdev until thaw_bdev() is called.
+ * If a superblock is found on this device, we take the s_umount semaphore
+ * on it to make sure nobody unmounts until the snapshot creation is done.
+ * The reference counter (bd_fsfreeze_count) guarantees that only the last
+ * unfreeze process can unfreeze the frozen filesystem actually when multiple
+ * freeze requests arrive simultaneously. It counts up in freeze_bdev() and
+ * count down in thaw_bdev(). When it becomes 0, thaw_bdev() will unfreeze
+ * actually.
+ */
+struct super_block *freeze_bdev(struct block_device *bdev)
+{
+       struct super_block *sb;
+       int error = 0;
+
+       mutex_lock(&bdev->bd_fsfreeze_mutex);
+       if (bdev->bd_fsfreeze_count > 0) {
+               bdev->bd_fsfreeze_count++;
+               sb = get_super(bdev);
+               mutex_unlock(&bdev->bd_fsfreeze_mutex);
+               return sb;
+       }
+       bdev->bd_fsfreeze_count++;
+
+       down(&bdev->bd_mount_sem);
+       sb = get_super(bdev);
+       if (sb && !(sb->s_flags & MS_RDONLY)) {
+               sb->s_frozen = SB_FREEZE_WRITE;
+               smp_wmb();
+
+               __fsync_super(sb);
+
+               sb->s_frozen = SB_FREEZE_TRANS;
+               smp_wmb();
+
+               sync_blockdev(sb->s_bdev);
+
+               if (sb->s_op->freeze_fs) {
+                       error = sb->s_op->freeze_fs(sb);
+                       if (error) {
+                               printk(KERN_ERR
+                                       "VFS:Filesystem freeze failed\n");
+                               sb->s_frozen = SB_UNFROZEN;
+                               drop_super(sb);
+                               up(&bdev->bd_mount_sem);
+                               bdev->bd_fsfreeze_count--;
+                               mutex_unlock(&bdev->bd_fsfreeze_mutex);
+                               return ERR_PTR(error);
+                       }
+               }
+       }
+
+       sync_blockdev(bdev);
+       mutex_unlock(&bdev->bd_fsfreeze_mutex);
+
+       return sb;      /* thaw_bdev releases s->s_umount and bd_mount_sem */
+}
+EXPORT_SYMBOL(freeze_bdev);
+
+/**
+ * thaw_bdev  -- unlock filesystem
+ * @bdev:      blockdevice to unlock
+ * @sb:                associated superblock
+ *
+ * Unlocks the filesystem and marks it writeable again after freeze_bdev().
+ */
+int thaw_bdev(struct block_device *bdev, struct super_block *sb)
+{
+       int error = 0;
+
+       mutex_lock(&bdev->bd_fsfreeze_mutex);
+       if (!bdev->bd_fsfreeze_count) {
+               mutex_unlock(&bdev->bd_fsfreeze_mutex);
+               return -EINVAL;
+       }
+
+       bdev->bd_fsfreeze_count--;
+       if (bdev->bd_fsfreeze_count > 0) {
+               if (sb)
+                       drop_super(sb);
+               mutex_unlock(&bdev->bd_fsfreeze_mutex);
+               return 0;
+       }
+
+       if (sb) {
+               BUG_ON(sb->s_bdev != bdev);
+               if (!(sb->s_flags & MS_RDONLY)) {
+                       if (sb->s_op->unfreeze_fs) {
+                               error = sb->s_op->unfreeze_fs(sb);
+                               if (error) {
+                                       printk(KERN_ERR
+                                               "VFS:Filesystem thaw failed\n");
+                                       sb->s_frozen = SB_FREEZE_TRANS;
+                                       bdev->bd_fsfreeze_count++;
+                                       mutex_unlock(&bdev->bd_fsfreeze_mutex);
+                                       return error;
+                               }
+                       }
+                       sb->s_frozen = SB_UNFROZEN;
+                       smp_wmb();
+                       wake_up(&sb->s_wait_unfrozen);
+               }
+               drop_super(sb);
+       }
+
+       up(&bdev->bd_mount_sem);
+       mutex_unlock(&bdev->bd_fsfreeze_mutex);
+       return 0;
+}
+EXPORT_SYMBOL(thaw_bdev);
+
 static int blkdev_writepage(struct page *page, struct writeback_control *wbc)
 {
        return block_write_full_page(page, blkdev_get_block, wbc);
index 891e1c78e4f1cdf2fef0a5737983f245901371a3..a2fd743d97cb85380b5140e5d84ba9c50c383b84 100644 (file)
@@ -165,151 +165,6 @@ void end_buffer_write_sync(struct buffer_head *bh, int uptodate)
        put_bh(bh);
 }
 
-/*
- * Write out and wait upon all the dirty data associated with a block
- * device via its mapping.  Does not take the superblock lock.
- */
-int sync_blockdev(struct block_device *bdev)
-{
-       int ret = 0;
-
-       if (bdev)
-               ret = filemap_write_and_wait(bdev->bd_inode->i_mapping);
-       return ret;
-}
-EXPORT_SYMBOL(sync_blockdev);
-
-/*
- * Write out and wait upon all dirty data associated with this
- * device.   Filesystem data as well as the underlying block
- * device.  Takes the superblock lock.
- */
-int fsync_bdev(struct block_device *bdev)
-{
-       struct super_block *sb = get_super(bdev);
-       if (sb) {
-               int res = fsync_super(sb);
-               drop_super(sb);
-               return res;
-       }
-       return sync_blockdev(bdev);
-}
-
-/**
- * freeze_bdev  --  lock a filesystem and force it into a consistent state
- * @bdev:      blockdevice to lock
- *
- * This takes the block device bd_mount_sem to make sure no new mounts
- * happen on bdev until thaw_bdev() is called.
- * If a superblock is found on this device, we take the s_umount semaphore
- * on it to make sure nobody unmounts until the snapshot creation is done.
- * The reference counter (bd_fsfreeze_count) guarantees that only the last
- * unfreeze process can unfreeze the frozen filesystem actually when multiple
- * freeze requests arrive simultaneously. It counts up in freeze_bdev() and
- * count down in thaw_bdev(). When it becomes 0, thaw_bdev() will unfreeze
- * actually.
- */
-struct super_block *freeze_bdev(struct block_device *bdev)
-{
-       struct super_block *sb;
-       int error = 0;
-
-       mutex_lock(&bdev->bd_fsfreeze_mutex);
-       if (bdev->bd_fsfreeze_count > 0) {
-               bdev->bd_fsfreeze_count++;
-               sb = get_super(bdev);
-               mutex_unlock(&bdev->bd_fsfreeze_mutex);
-               return sb;
-       }
-       bdev->bd_fsfreeze_count++;
-
-       down(&bdev->bd_mount_sem);
-       sb = get_super(bdev);
-       if (sb && !(sb->s_flags & MS_RDONLY)) {
-               sb->s_frozen = SB_FREEZE_WRITE;
-               smp_wmb();
-
-               __fsync_super(sb);
-
-               sb->s_frozen = SB_FREEZE_TRANS;
-               smp_wmb();
-
-               sync_blockdev(sb->s_bdev);
-
-               if (sb->s_op->freeze_fs) {
-                       error = sb->s_op->freeze_fs(sb);
-                       if (error) {
-                               printk(KERN_ERR
-                                       "VFS:Filesystem freeze failed\n");
-                               sb->s_frozen = SB_UNFROZEN;
-                               drop_super(sb);
-                               up(&bdev->bd_mount_sem);
-                               bdev->bd_fsfreeze_count--;
-                               mutex_unlock(&bdev->bd_fsfreeze_mutex);
-                               return ERR_PTR(error);
-                       }
-               }
-       }
-
-       sync_blockdev(bdev);
-       mutex_unlock(&bdev->bd_fsfreeze_mutex);
-
-       return sb;      /* thaw_bdev releases s->s_umount and bd_mount_sem */
-}
-EXPORT_SYMBOL(freeze_bdev);
-
-/**
- * thaw_bdev  -- unlock filesystem
- * @bdev:      blockdevice to unlock
- * @sb:                associated superblock
- *
- * Unlocks the filesystem and marks it writeable again after freeze_bdev().
- */
-int thaw_bdev(struct block_device *bdev, struct super_block *sb)
-{
-       int error = 0;
-
-       mutex_lock(&bdev->bd_fsfreeze_mutex);
-       if (!bdev->bd_fsfreeze_count) {
-               mutex_unlock(&bdev->bd_fsfreeze_mutex);
-               return -EINVAL;
-       }
-
-       bdev->bd_fsfreeze_count--;
-       if (bdev->bd_fsfreeze_count > 0) {
-               if (sb)
-                       drop_super(sb);
-               mutex_unlock(&bdev->bd_fsfreeze_mutex);
-               return 0;
-       }
-
-       if (sb) {
-               BUG_ON(sb->s_bdev != bdev);
-               if (!(sb->s_flags & MS_RDONLY)) {
-                       if (sb->s_op->unfreeze_fs) {
-                               error = sb->s_op->unfreeze_fs(sb);
-                               if (error) {
-                                       printk(KERN_ERR
-                                               "VFS:Filesystem thaw failed\n");
-                                       sb->s_frozen = SB_FREEZE_TRANS;
-                                       bdev->bd_fsfreeze_count++;
-                                       mutex_unlock(&bdev->bd_fsfreeze_mutex);
-                                       return error;
-                               }
-                       }
-                       sb->s_frozen = SB_UNFROZEN;
-                       smp_wmb();
-                       wake_up(&sb->s_wait_unfrozen);
-               }
-               drop_super(sb);
-       }
-
-       up(&bdev->bd_mount_sem);
-       mutex_unlock(&bdev->bd_fsfreeze_mutex);
-       return 0;
-}
-EXPORT_SYMBOL(thaw_bdev);
-
 /*
  * Various filesystems appear to want __find_get_block to be non-blocking.
  * But it's the page lock which protects the buffers.  To get around this,
index 13ea53251dcf934518889696e7222286c13aefde..38491fd3871df31258d0cd77efb1ba2d74f9cf52 100644 (file)
@@ -606,7 +606,8 @@ cifs_get_sb(struct file_system_type *fs_type,
                return rc;
        }
        sb->s_flags |= MS_ACTIVE;
-       return simple_set_mnt(mnt, sb);
+       simple_set_mnt(mnt, sb);
+       return 0;
 }
 
 static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
index 2b1d28a9ee287b6b998c034c403c240b101c682e..77e190dc28835ad1b5238c14d64b46ccefef27a1 100644 (file)
@@ -78,8 +78,8 @@ extern int cifs_dir_open(struct inode *inode, struct file *file);
 extern int cifs_readdir(struct file *file, void *direntry, filldir_t filldir);
 
 /* Functions related to dir entries */
-extern struct dentry_operations cifs_dentry_ops;
-extern struct dentry_operations cifs_ci_dentry_ops;
+extern const struct dentry_operations cifs_dentry_ops;
+extern const struct dentry_operations cifs_ci_dentry_ops;
 
 /* Functions related to symlinks */
 extern void *cifs_follow_link(struct dentry *direntry, struct nameidata *nd);
index f9b6f68be976e062894da51dade4f78cedbdc8f1..2f35cccfcd8d202423c4e9e1434d139cf78dc084 100644 (file)
@@ -701,7 +701,7 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
        return rc;
 }     */
 
-struct dentry_operations cifs_dentry_ops = {
+const struct dentry_operations cifs_dentry_ops = {
        .d_revalidate = cifs_d_revalidate,
 /* d_delete:       cifs_d_delete,      */ /* not needed except for debugging */
 };
@@ -739,7 +739,7 @@ static int cifs_ci_compare(struct dentry *dentry, struct qstr *a,
        return 1;
 }
 
-struct dentry_operations cifs_ci_dentry_ops = {
+const struct dentry_operations cifs_ci_dentry_ops = {
        .d_revalidate = cifs_d_revalidate,
        .d_hash = cifs_ci_hash,
        .d_compare = cifs_ci_compare,
index 75b1fa90b2cb8ee205efc96bbbb8a7c71fc9a1e1..4bb9d0a5decc2a7f168a1886a01ef72cec5a5351 100644 (file)
@@ -59,7 +59,7 @@ static int coda_return_EIO(void)
 }
 #define CODA_EIO_ERROR ((void *) (coda_return_EIO))
 
-static struct dentry_operations coda_dentry_operations =
+static const struct dentry_operations coda_dentry_operations =
 {
        .d_revalidate   = coda_dentry_revalidate,
        .d_delete       = coda_dentry_delete,
index 0949b43794a4896827dd70714d3b3b7b9a0ae6ed..5e374aad33f73a8b478677b724f65f7b0835699b 100644 (file)
@@ -378,6 +378,34 @@ out:
        return error;
 }
 
+/*
+ * This is a copy of sys_ustat, just dealing with a structure layout.
+ * Given how simple this syscall is that apporach is more maintainable
+ * than the various conversion hacks.
+ */
+asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u)
+{
+       struct super_block *sb;
+       struct compat_ustat tmp;
+       struct kstatfs sbuf;
+       int err;
+
+       sb = user_get_super(new_decode_dev(dev));
+       if (!sb)
+               return -EINVAL;
+       err = vfs_statfs(sb->s_root, &sbuf);
+       drop_super(sb);
+       if (err)
+               return err;
+
+       memset(&tmp, 0, sizeof(struct compat_ustat));
+       tmp.f_tfree = sbuf.f_bfree;
+       tmp.f_tinode = sbuf.f_ffree;
+       if (copy_to_user(u, &tmp, sizeof(struct compat_ustat)))
+               return -EFAULT;
+       return 0;
+}
+
 static int get_compat_flock(struct flock *kfl, struct compat_flock __user *ufl)
 {
        if (!access_ok(VERIFY_READ, ufl, sizeof(*ufl)) ||
index 8e93341f3e82048b7f0f07d4edc6cf2e654c3f93..05373db21a4e8e4a8a297b3c83fb8ef85a0cb175 100644 (file)
@@ -72,7 +72,7 @@ static int configfs_d_delete(struct dentry *dentry)
        return 1;
 }
 
-static struct dentry_operations configfs_dentry_ops = {
+static const struct dentry_operations configfs_dentry_ops = {
        .d_iput         = configfs_d_iput,
        /* simple_delete_dentry() isn't exported */
        .d_delete       = configfs_d_delete,
index 07e2d4a44bda3204c083a6e38ef79fe9b144d958..90bbd7e1b116d0ec48a07d8dab88c5086fb647d6 100644 (file)
@@ -1247,15 +1247,18 @@ struct dentry *d_add_ci(struct dentry *dentry, struct inode *inode,
        struct dentry *found;
        struct dentry *new;
 
-       /* Does a dentry matching the name exist already? */
+       /*
+        * First check if a dentry matching the name already exists,
+        * if not go ahead and create it now.
+        */
        found = d_hash_and_lookup(dentry->d_parent, name);
-       /* If not, create it now and return */
        if (!found) {
                new = d_alloc(dentry->d_parent, name);
                if (!new) {
                        error = -ENOMEM;
                        goto err_out;
                }
+
                found = d_splice_alias(inode, new);
                if (found) {
                        dput(new);
@@ -1263,61 +1266,46 @@ struct dentry *d_add_ci(struct dentry *dentry, struct inode *inode,
                }
                return new;
        }
-       /* Matching dentry exists, check if it is negative. */
+
+       /*
+        * If a matching dentry exists, and it's not negative use it.
+        *
+        * Decrement the reference count to balance the iget() done
+        * earlier on.
+        */
        if (found->d_inode) {
                if (unlikely(found->d_inode != inode)) {
                        /* This can't happen because bad inodes are unhashed. */
                        BUG_ON(!is_bad_inode(inode));
                        BUG_ON(!is_bad_inode(found->d_inode));
                }
-               /*
-                * Already have the inode and the dentry attached, decrement
-                * the reference count to balance the iget() done
-                * earlier on.  We found the dentry using d_lookup() so it
-                * cannot be disconnected and thus we do not need to worry
-                * about any NFS/disconnectedness issues here.
-                */
                iput(inode);
                return found;
        }
+
        /*
         * Negative dentry: instantiate it unless the inode is a directory and
-        * has a 'disconnected' dentry (i.e. IS_ROOT and DCACHE_DISCONNECTED),
-        * in which case d_move() that in place of the found dentry.
+        * already has a dentry.
         */
-       if (!S_ISDIR(inode->i_mode)) {
-               /* Not a directory; everything is easy. */
-               d_instantiate(found, inode);
-               return found;
-       }
        spin_lock(&dcache_lock);
-       if (list_empty(&inode->i_dentry)) {
-               /*
-                * Directory without a 'disconnected' dentry; we need to do
-                * d_instantiate() by hand because it takes dcache_lock which
-                * we already hold.
-                */
+       if (!S_ISDIR(inode->i_mode) || list_empty(&inode->i_dentry)) {
                __d_instantiate(found, inode);
                spin_unlock(&dcache_lock);
                security_d_instantiate(found, inode);
                return found;
        }
+
        /*
-        * Directory with a 'disconnected' dentry; get a reference to the
-        * 'disconnected' dentry.
+        * In case a directory already has a (disconnected) entry grab a
+        * reference to it, move it in place and use it.
         */
        new = list_entry(inode->i_dentry.next, struct dentry, d_alias);
        dget_locked(new);
        spin_unlock(&dcache_lock);
-       /* Do security vodoo. */
        security_d_instantiate(found, inode);
-       /* Move new in place of found. */
        d_move(new, found);
-       /* Balance the iget() we did above. */
        iput(inode);
-       /* Throw away found. */
        dput(found);
-       /* Use new as the actual dentry. */
        return new;
 
 err_out:
index bff4052b05e7003744a57e19b7d38966c7a75d71..63a4a59e4148deae2a7709b2c9cd6722d3422d2a 100644 (file)
@@ -322,177 +322,81 @@ static int compare_init_pts_sb(struct super_block *s, void *p)
 }
 
 /*
- * Safely parse the mount options in @data and update @opts.
+ * devpts_get_sb()
  *
- * devpts ends up parsing options two times during mount, due to the
- * two modes of operation it supports. The first parse occurs in
- * devpts_get_sb() when determining the mode (single-instance or
- * multi-instance mode). The second parse happens in devpts_remount()
- * or new_pts_mount() depending on the mode.
+ *     If the '-o newinstance' mount option was specified, mount a new
+ *     (private) instance of devpts.  PTYs created in this instance are
+ *     independent of the PTYs in other devpts instances.
  *
- * Parsing of options modifies the @data making subsequent parsing
- * incorrect. So make a local copy of @data and parse it.
+ *     If the '-o newinstance' option was not specified, mount/remount the
+ *     initial kernel mount of devpts.  This type of mount gives the
+ *     legacy, single-instance semantics.
  *
- * Return: 0 On success, -errno on error
- */
-static int safe_parse_mount_options(void *data, struct pts_mount_opts *opts)
-{
-       int rc;
-       void *datacp;
-
-       if (!data)
-               return 0;
-
-       /* Use kstrdup() ?  */
-       datacp = kmalloc(PAGE_SIZE, GFP_KERNEL);
-       if (!datacp)
-               return -ENOMEM;
-
-       memcpy(datacp, data, PAGE_SIZE);
-       rc = parse_mount_options((char *)datacp, PARSE_MOUNT, opts);
-       kfree(datacp);
-
-       return rc;
-}
-
-/*
- * Mount a new (private) instance of devpts.  PTYs created in this
- * instance are independent of the PTYs in other devpts instances.
- */
-static int new_pts_mount(struct file_system_type *fs_type, int flags,
-               void *data, struct vfsmount *mnt)
-{
-       int err;
-       struct pts_fs_info *fsi;
-       struct pts_mount_opts *opts;
-
-       err = get_sb_nodev(fs_type, flags, data, devpts_fill_super, mnt);
-       if (err)
-               return err;
-
-       fsi = DEVPTS_SB(mnt->mnt_sb);
-       opts = &fsi->mount_opts;
-
-       err = parse_mount_options(data, PARSE_MOUNT, opts);
-       if (err)
-               goto fail;
-
-       err = mknod_ptmx(mnt->mnt_sb);
-       if (err)
-               goto fail;
-
-       return 0;
-
-fail:
-       dput(mnt->mnt_sb->s_root);
-       deactivate_super(mnt->mnt_sb);
-       return err;
-}
-
-/*
- * Check if 'newinstance' mount option was specified in @data.
+ *     The 'newinstance' option is needed to support multiple namespace
+ *     semantics in devpts while preserving backward compatibility of the
+ *     current 'single-namespace' semantics. i.e all mounts of devpts
+ *     without the 'newinstance' mount option should bind to the initial
+ *     kernel mount, like get_sb_single().
  *
- * Return: -errno      on error (eg: invalid mount options specified)
- *      : 1            if 'newinstance' mount option was specified
- *      : 0            if 'newinstance' mount option was NOT specified
- */
-static int is_new_instance_mount(void *data)
-{
-       int rc;
-       struct pts_mount_opts opts;
-
-       if (!data)
-               return 0;
-
-       rc = safe_parse_mount_options(data, &opts);
-       if (!rc)
-               rc = opts.newinstance;
-
-       return rc;
-}
-
-/*
- * get_init_pts_sb()
- *
- *     This interface is needed to support multiple namespace semantics in
- *     devpts while preserving backward compatibility of the current 'single-
- *     namespace' semantics. i.e all mounts of devpts without the 'newinstance'
- *     mount option should bind to the initial kernel mount, like
- *     get_sb_single().
+ *     Mounts with 'newinstance' option create a new, private namespace.
  *
- *     Mounts with 'newinstance' option create a new private namespace.
+ *     NOTE:
  *
- *     But for single-mount semantics, devpts cannot use get_sb_single(),
+ *     For single-mount semantics, devpts cannot use get_sb_single(),
  *     because get_sb_single()/sget() find and use the super-block from
  *     the most recent mount of devpts. But that recent mount may be a
  *     'newinstance' mount and get_sb_single() would pick the newinstance
  *     super-block instead of the initial super-block.
- *
- *     This interface is identical to get_sb_single() except that it
- *     consistently selects the 'single-namespace' superblock even in the
- *     presence of the private namespace (i.e 'newinstance') super-blocks.
  */
-static int get_init_pts_sb(struct file_system_type *fs_type, int flags,
-               void *data, struct vfsmount *mnt)
+static int devpts_get_sb(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
 {
-       struct super_block *s;
        int error;
+       struct pts_mount_opts opts;
+       struct super_block *s;
+
+       memset(&opts, 0, sizeof(opts));
+       if (data) {
+               error = parse_mount_options(data, PARSE_MOUNT, &opts);
+               if (error)
+                       return error;
+       }
+
+       if (opts.newinstance)
+               s = sget(fs_type, NULL, set_anon_super, NULL);
+       else
+               s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL);
 
-       s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL);
        if (IS_ERR(s))
                return PTR_ERR(s);
 
        if (!s->s_root) {
                s->s_flags = flags;
                error = devpts_fill_super(s, data, flags & MS_SILENT ? 1 : 0);
-               if (error) {
-                       up_write(&s->s_umount);
-                       deactivate_super(s);
-                       return error;
-               }
+               if (error)
+                       goto out_undo_sget;
                s->s_flags |= MS_ACTIVE;
        }
-       do_remount_sb(s, flags, data, 0);
-       return simple_set_mnt(mnt, s);
-}
 
-/*
- * Mount or remount the initial kernel mount of devpts. This type of
- * mount maintains the legacy, single-instance semantics, while the
- * kernel still allows multiple-instances.
- */
-static int init_pts_mount(struct file_system_type *fs_type, int flags,
-               void *data, struct vfsmount *mnt)
-{
-       int err;
+       simple_set_mnt(mnt, s);
 
-       err = get_init_pts_sb(fs_type, flags, data, mnt);
-       if (err)
-               return err;
+       memcpy(&(DEVPTS_SB(s))->mount_opts, &opts, sizeof(opts));
 
-       err = mknod_ptmx(mnt->mnt_sb);
-       if (err) {
-               dput(mnt->mnt_sb->s_root);
-               deactivate_super(mnt->mnt_sb);
-       }
+       error = mknod_ptmx(s);
+       if (error)
+               goto out_dput;
 
-       return err;
-}
-
-static int devpts_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
-{
-       int new;
-
-       new = is_new_instance_mount(data);
-       if (new < 0)
-               return new;
+       return 0;
 
-       if (new)
-               return new_pts_mount(fs_type, flags, data, mnt);
+out_dput:
+       dput(s->s_root);
 
-       return init_pts_mount(fs_type, flags, data, mnt);
+out_undo_sget:
+       up_write(&s->s_umount);
+       deactivate_super(s);
+       return error;
 }
+
 #else
 /*
  * This supports only the legacy single-instance semantics (no
index 3e5637fc377962e1aaca5665f3e03d89366673e3..44d725f612cf346ec2e4d9bf2801913de393b967 100644 (file)
@@ -18,7 +18,7 @@ static void drop_pagecache_sb(struct super_block *sb)
 
        spin_lock(&inode_lock);
        list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
-               if (inode->i_state & (I_FREEING|I_WILL_FREE))
+               if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW))
                        continue;
                if (inode->i_mapping->nrpages == 0)
                        continue;
index 5e596583946c9de4eab193be422c93b8700815a0..2dda5ade75bc78a06461d0b62fbb9f74bde28678 100644 (file)
@@ -89,7 +89,7 @@ static void ecryptfs_d_release(struct dentry *dentry)
        return;
 }
 
-struct dentry_operations ecryptfs_dops = {
+const struct dentry_operations ecryptfs_dops = {
        .d_revalidate = ecryptfs_d_revalidate,
        .d_release = ecryptfs_d_release,
 };
index ac749d4d644fe383caca23093f43b65ffd2c9ba8..064c5820e4e50dc3ba53b320b518a9e3c4ba7caa 100644 (file)
@@ -580,7 +580,7 @@ extern const struct inode_operations ecryptfs_main_iops;
 extern const struct inode_operations ecryptfs_dir_iops;
 extern const struct inode_operations ecryptfs_symlink_iops;
 extern const struct super_operations ecryptfs_sops;
-extern struct dentry_operations ecryptfs_dops;
+extern const struct dentry_operations ecryptfs_dops;
 extern struct address_space_operations ecryptfs_aops;
 extern int ecryptfs_verbosity;
 extern unsigned int ecryptfs_message_buf_len;
index 7ba03a4acbe07d7f8d426580e785f86075e1e7d0..da3f361a37ddb794bd38973bfea03548edbc3e86 100644 (file)
@@ -188,7 +188,7 @@ old_compare:
        goto out;
 }
 
-static struct dentry_operations msdos_dentry_operations = {
+static const struct dentry_operations msdos_dentry_operations = {
        .d_hash         = msdos_hash,
        .d_compare      = msdos_cmp,
 };
index 8ae32e37673c32fbee31e0a89eec705fbacf8267..a0e00e3a46e91fdaa9a881f7e11d69de671e74b4 100644 (file)
@@ -166,13 +166,13 @@ static int vfat_cmp(struct dentry *dentry, struct qstr *a, struct qstr *b)
        return 1;
 }
 
-static struct dentry_operations vfat_ci_dentry_ops = {
+static const struct dentry_operations vfat_ci_dentry_ops = {
        .d_revalidate   = vfat_revalidate_ci,
        .d_hash         = vfat_hashi,
        .d_compare      = vfat_cmpi,
 };
 
-static struct dentry_operations vfat_dentry_ops = {
+static const struct dentry_operations vfat_dentry_ops = {
        .d_revalidate   = vfat_revalidate,
        .d_hash         = vfat_hash,
        .d_compare      = vfat_cmp,
index fdff346e96fdc9dead4f9a00a081f5488fc4a9e3..06da05261e04a8a314881cee7e9e5988bc09c66a 100644 (file)
@@ -224,7 +224,7 @@ static int invalid_nodeid(u64 nodeid)
        return !nodeid || nodeid == FUSE_ROOT_ID;
 }
 
-struct dentry_operations fuse_dentry_operations = {
+const struct dentry_operations fuse_dentry_operations = {
        .d_revalidate   = fuse_dentry_revalidate,
 };
 
index 5e64b815a5a16d737e655c8deeb2729288da81fa..6fc5aedaa0d52b3d86d94bde490aa5711e47cfd1 100644 (file)
@@ -493,7 +493,7 @@ static inline u64 get_node_id(struct inode *inode)
 /** Device operations */
 extern const struct file_operations fuse_dev_operations;
 
-extern struct dentry_operations fuse_dentry_operations;
+extern const struct dentry_operations fuse_dentry_operations;
 
 /**
  * Get a filled in inode
index 5eb57b0443828e2c1c90e530e4c7e4fcb65d577e..022c66cd560638848c2a227d7bd7a56a078768ba 100644 (file)
@@ -107,7 +107,7 @@ static int gfs2_dhash(struct dentry *dentry, struct qstr *str)
        return 0;
 }
 
-struct dentry_operations gfs2_dops = {
+const struct dentry_operations gfs2_dops = {
        .d_revalidate = gfs2_drevalidate,
        .d_hash = gfs2_dhash,
 };
index 91abdbedcc86e5524efaf8012313d05222a0d303..b56413e3e40d8f86d14b5abd5aaed1c29013b4be 100644 (file)
@@ -49,7 +49,7 @@ extern struct file_system_type gfs2_fs_type;
 extern struct file_system_type gfs2meta_fs_type;
 extern const struct export_operations gfs2_export_ops;
 extern const struct super_operations gfs2_super_ops;
-extern struct dentry_operations gfs2_dops;
+extern const struct dentry_operations gfs2_dops;
 
 #endif /* __SUPER_DOT_H__ */
 
index 9955232fdf8c977abae64e327ca250468ee74654..052387e116716d014ff9a398a76597d6fb926131 100644 (file)
@@ -213,7 +213,7 @@ extern void hfs_mdb_put(struct super_block *);
 extern int hfs_part_find(struct super_block *, sector_t *, sector_t *);
 
 /* string.c */
-extern struct dentry_operations hfs_dentry_operations;
+extern const struct dentry_operations hfs_dentry_operations;
 
 extern int hfs_hash_dentry(struct dentry *, struct qstr *);
 extern int hfs_strcmp(const unsigned char *, unsigned int,
index 5bf89ec01cd4476ddf17d088aa7a58d8e303edc3..7478f5c219aa42336984117b937f84039af8a417 100644 (file)
@@ -31,7 +31,7 @@ static int hfs_revalidate_dentry(struct dentry *dentry, struct nameidata *nd)
        return 1;
 }
 
-struct dentry_operations hfs_dentry_operations =
+const struct dentry_operations hfs_dentry_operations =
 {
        .d_revalidate   = hfs_revalidate_dentry,
        .d_hash         = hfs_hash_dentry,
index f027a905225fc5f7a5c2dfe8b5d1e0764ec96c80..5c10d803d9df1ea10dd20b4c0c5b122b36b85e18 100644 (file)
@@ -327,7 +327,7 @@ void hfsplus_file_truncate(struct inode *);
 /* inode.c */
 extern const struct address_space_operations hfsplus_aops;
 extern const struct address_space_operations hfsplus_btree_aops;
-extern struct dentry_operations hfsplus_dentry_operations;
+extern const struct dentry_operations hfsplus_dentry_operations;
 
 void hfsplus_inode_read_fork(struct inode *, struct hfsplus_fork_raw *);
 void hfsplus_inode_write_fork(struct inode *, struct hfsplus_fork_raw *);
index f105ee9e1cc4aad0e244e19c883e77c610954294..1bcf597c05625c8023ddf6074d9efe2aca6b8e1e 100644 (file)
@@ -137,7 +137,7 @@ const struct address_space_operations hfsplus_aops = {
        .writepages     = hfsplus_writepages,
 };
 
-struct dentry_operations hfsplus_dentry_operations = {
+const struct dentry_operations hfsplus_dentry_operations = {
        .d_hash       = hfsplus_hash_dentry,
        .d_compare    = hfsplus_compare_dentry,
 };
index 5c538e0ec14beeba40899ea9eb20b83b8446388e..fe02ad4740e76a2b4246657575d2a0f682b254f1 100644 (file)
@@ -31,12 +31,12 @@ static inline struct hostfs_inode_info *HOSTFS_I(struct inode *inode)
 
 #define FILE_HOSTFS_I(file) HOSTFS_I((file)->f_path.dentry->d_inode)
 
-int hostfs_d_delete(struct dentry *dentry)
+static int hostfs_d_delete(struct dentry *dentry)
 {
        return 1;
 }
 
-struct dentry_operations hostfs_dentry_ops = {
+static const struct dentry_operations hostfs_dentry_ops = {
        .d_delete               = hostfs_d_delete,
 };
 
index 08319126b2afa0c090b8c922350d6aaf4ad8d064..940d6d150beec4d609785c16aadb87a49b1689f7 100644 (file)
@@ -49,7 +49,7 @@ static int hpfs_compare_dentry(struct dentry *dentry, struct qstr *a, struct qst
        return 0;
 }
 
-static struct dentry_operations hpfs_dentry_operations = {
+static const struct dentry_operations hpfs_dentry_operations = {
        .d_hash         = hpfs_hash_dentry,
        .d_compare      = hpfs_compare_dentry,
 };
index 29df4a2974494d333353c0008b9e08026954c547..d06d6d268de9a12c5fbe9d66bd618c293729e8e9 100644 (file)
@@ -366,6 +366,8 @@ static int invalidate_list(struct list_head *head, struct list_head *dispose)
                if (tmp == head)
                        break;
                inode = list_entry(tmp, struct inode, i_sb_list);
+               if (inode->i_state & I_NEW)
+                       continue;
                invalidate_inode_buffers(inode);
                if (!atomic_read(&inode->i_count)) {
                        list_move(&inode->i_list, dispose);
index 6147ec3643a0ebd6280c478f0032fd8a0f051cd4..13d2eddd0692d74b732f6b7b31ca2fbf5fd63014 100644 (file)
@@ -114,7 +114,7 @@ static const struct super_operations isofs_sops = {
 };
 
 
-static struct dentry_operations isofs_dentry_ops[] = {
+static const struct dentry_operations isofs_dentry_ops[] = {
        {
                .d_hash         = isofs_hash,
                .d_compare      = isofs_dentry_cmp,
index adb2fafcc54428d2542b76191e93c8ffff3bd454..1eff7db34d6357a611dbbfbff5bd64c78cac42ed 100644 (file)
@@ -47,5 +47,5 @@ extern const struct file_operations jfs_dir_operations;
 extern const struct inode_operations jfs_file_inode_operations;
 extern const struct file_operations jfs_file_operations;
 extern const struct inode_operations jfs_symlink_inode_operations;
-extern struct dentry_operations jfs_ci_dentry_operations;
+extern const struct dentry_operations jfs_ci_dentry_operations;
 #endif                         /* _H_JFS_INODE */
index 9feaa04555d2c71f4b99aa85c60f0d53baaeaea1..514ee2edb92a9046c40661a81abf26ee1e558da6 100644 (file)
@@ -35,7 +35,7 @@
 /*
  * forward references
  */
-struct dentry_operations jfs_ci_dentry_operations;
+const struct dentry_operations jfs_ci_dentry_operations;
 
 static s64 commitZeroLink(tid_t, struct inode *);
 
@@ -1595,7 +1595,7 @@ out:
        return result;
 }
 
-struct dentry_operations jfs_ci_dentry_operations =
+const struct dentry_operations jfs_ci_dentry_operations =
 {
        .d_hash = jfs_ci_hash,
        .d_compare = jfs_ci_compare,
index 49b44099dabbb9cef010c2394c8ba110440edee4..4910a36f516e3081bcb61713260bb2ca637a9612 100644 (file)
@@ -44,7 +44,7 @@ static int simple_delete_dentry(struct dentry *dentry)
  */
 struct dentry *simple_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
 {
-       static struct dentry_operations simple_dentry_operations = {
+       static const struct dentry_operations simple_dentry_operations = {
                .d_delete = simple_delete_dentry,
        };
 
@@ -242,7 +242,8 @@ int get_sb_pseudo(struct file_system_type *fs_type, char *name,
        d_instantiate(dentry, root);
        s->s_root = dentry;
        s->s_flags |= MS_ACTIVE;
-       return simple_set_mnt(mnt, s);
+       simple_set_mnt(mnt, s);
+       return 0;
 
 Enomem:
        up_write(&s->s_umount);
index 1928197b3874bd9589b3e9bad7335e52a41bd8df..d040ce11785d6acb115154da5e83a7500909df13 100644 (file)
@@ -1489,24 +1489,22 @@ int may_open(struct path *path, int acc_mode, int flag)
        if (!inode)
                return -ENOENT;
 
-       if (S_ISLNK(inode->i_mode))
+       switch (inode->i_mode & S_IFMT) {
+       case S_IFLNK:
                return -ELOOP;
-       
-       if (S_ISDIR(inode->i_mode) && (acc_mode & MAY_WRITE))
-               return -EISDIR;
-
-       /*
-        * FIFO's, sockets and device files are special: they don't
-        * actually live on the filesystem itself, and as such you
-        * can write to them even if the filesystem is read-only.
-        */
-       if (S_ISFIFO(inode->i_mode) || S_ISSOCK(inode->i_mode)) {
-               flag &= ~O_TRUNC;
-       } else if (S_ISBLK(inode->i_mode) || S_ISCHR(inode->i_mode)) {
+       case S_IFDIR:
+               if (acc_mode & MAY_WRITE)
+                       return -EISDIR;
+               break;
+       case S_IFBLK:
+       case S_IFCHR:
                if (path->mnt->mnt_flags & MNT_NODEV)
                        return -EACCES;
-
+               /*FALLTHRU*/
+       case S_IFIFO:
+       case S_IFSOCK:
                flag &= ~O_TRUNC;
+               break;
        }
 
        error = inode_permission(inode, acc_mode);
index f0e753097353b93f581d1ea6e1646df99dcf630a..0a42e0e9602766939a6ac0a2e444df2992adc3f9 100644 (file)
@@ -397,11 +397,10 @@ static void __mnt_unmake_readonly(struct vfsmount *mnt)
        spin_unlock(&vfsmount_lock);
 }
 
-int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb)
+void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb)
 {
        mnt->mnt_sb = sb;
        mnt->mnt_root = dget(sb->s_root);
-       return 0;
 }
 
 EXPORT_SYMBOL(simple_set_mnt);
index 07e9715b865887042b899299effe1c4f37a7e106..9c590722d87ea87fd458041815da3cd8a519b3d1 100644 (file)
@@ -79,7 +79,7 @@ static int ncp_hash_dentry(struct dentry *, struct qstr *);
 static int ncp_compare_dentry (struct dentry *, struct qstr *, struct qstr *);
 static int ncp_delete_dentry(struct dentry *);
 
-static struct dentry_operations ncp_dentry_operations =
+static const struct dentry_operations ncp_dentry_operations =
 {
        .d_revalidate   = ncp_lookup_validate,
        .d_hash         = ncp_hash_dentry,
@@ -87,7 +87,7 @@ static struct dentry_operations ncp_dentry_operations =
        .d_delete       = ncp_delete_dentry,
 };
 
-struct dentry_operations ncp_root_dentry_operations =
+const struct dentry_operations ncp_root_dentry_operations =
 {
        .d_hash         = ncp_hash_dentry,
        .d_compare      = ncp_compare_dentry,
index 672368f865cad895256d76ad6a88aa60da0e16e2..78bf72fc1db3a79fe08ae65c77960eff1326443f 100644 (file)
@@ -899,7 +899,7 @@ static void nfs_dentry_iput(struct dentry *dentry, struct inode *inode)
        iput(inode);
 }
 
-struct dentry_operations nfs_dentry_operations = {
+const struct dentry_operations nfs_dentry_operations = {
        .d_revalidate   = nfs_lookup_revalidate,
        .d_delete       = nfs_dentry_delete,
        .d_iput         = nfs_dentry_iput,
@@ -967,7 +967,7 @@ out:
 #ifdef CONFIG_NFS_V4
 static int nfs_open_revalidate(struct dentry *, struct nameidata *);
 
-struct dentry_operations nfs4_dentry_operations = {
+const struct dentry_operations nfs4_dentry_operations = {
        .d_revalidate   = nfs_open_revalidate,
        .d_delete       = nfs_dentry_delete,
        .d_iput         = nfs_dentry_iput,
index 4e4d332043766915fd34f16625d92d345fffba39..84345deab26ff06a506dff7e4578586166437fe2 100644 (file)
@@ -179,7 +179,7 @@ struct nfs4_state_recovery_ops {
        int (*recover_lock)(struct nfs4_state *, struct file_lock *);
 };
 
-extern struct dentry_operations nfs4_dentry_operations;
+extern const struct dentry_operations nfs4_dentry_operations;
 extern const struct inode_operations nfs4_dir_inode_operations;
 
 /* inode.c */
index 331f2e88e284e44e373cbda23ab41a024c01c6b1..220c13f0d73d254f757636f6f03501b7fdf1b2fb 100644 (file)
@@ -379,6 +379,14 @@ void inotify_unmount_inodes(struct list_head *list)
                struct inode *need_iput_tmp;
                struct list_head *watches;
 
+               /*
+                * We cannot __iget() an inode in state I_CLEAR, I_FREEING,
+                * I_WILL_FREE, or I_NEW which is fine because by that point
+                * the inode cannot have any associated watches.
+                */
+               if (inode->i_state & (I_CLEAR|I_FREEING|I_WILL_FREE|I_NEW))
+                       continue;
+
                /*
                 * If i_count is zero, the inode cannot have any watches and
                 * doing an __iget/iput with MS_ACTIVE clear would actually
@@ -388,14 +396,6 @@ void inotify_unmount_inodes(struct list_head *list)
                if (!atomic_read(&inode->i_count))
                        continue;
 
-               /*
-                * We cannot __iget() an inode in state I_CLEAR, I_FREEING, or
-                * I_WILL_FREE which is fine because by that point the inode
-                * cannot have any associated watches.
-                */
-               if (inode->i_state & (I_CLEAR | I_FREEING | I_WILL_FREE))
-                       continue;
-
                need_iput_tmp = need_iput;
                need_iput = NULL;
                /* In case inotify_remove_watch_locked() drops a reference. */
index e9d7c2038c0f55c1f0cf48386a2f6eed12a2d805..7d604480557afb80a77dc7b4a106a5c9f9b6a43a 100644 (file)
@@ -455,7 +455,7 @@ out_move:
        d_move(dentry, target);
 }
 
-struct dentry_operations ocfs2_dentry_ops = {
+const struct dentry_operations ocfs2_dentry_ops = {
        .d_revalidate           = ocfs2_dentry_revalidate,
        .d_iput                 = ocfs2_dentry_iput,
 };
index d06e16c0664061d7ea7bf4bb319242a890eef68a..faa12e75f98d117a9cf2f7f0bf519a05b83c5401 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef OCFS2_DCACHE_H
 #define OCFS2_DCACHE_H
 
-extern struct dentry_operations ocfs2_dentry_ops;
+extern const struct dentry_operations ocfs2_dentry_ops;
 
 struct ocfs2_dentry_lock {
        /* Use count of dentry lock */
index 94ad15967cf90ddc04467a093247b1da7879a3fd..4af7aa521813e89a256016329d306f8a4f6f59ec 100644 (file)
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -860,7 +860,7 @@ static char *pipefs_dname(struct dentry *dentry, char *buffer, int buflen)
                                dentry->d_inode->i_ino);
 }
 
-static struct dentry_operations pipefs_dentry_operations = {
+static const struct dentry_operations pipefs_dentry_operations = {
        .d_delete       = pipefs_delete_dentry,
        .d_dname        = pipefs_dname,
 };
@@ -1024,11 +1024,6 @@ int do_pipe_flags(int *fd, int flags)
        return error;
 }
 
-int do_pipe(int *fd)
-{
-       return do_pipe_flags(fd, 0);
-}
-
 /*
  * sys_pipe() is the normal C calling standard for creating
  * a pipe. It's not the way Unix traditionally does this, though.
index beaa0ce3b82e1de8fec8941584a03f3dc32a700b..aef6d55b7de6761913d78a6ab594d5ddce7119ec 100644 (file)
@@ -1545,7 +1545,7 @@ static int pid_delete_dentry(struct dentry * dentry)
        return !proc_pid(dentry->d_inode)->tasks[PIDTYPE_PID].first;
 }
 
-static struct dentry_operations pid_dentry_operations =
+static const struct dentry_operations pid_dentry_operations =
 {
        .d_revalidate   = pid_revalidate,
        .d_delete       = pid_delete_dentry,
@@ -1717,7 +1717,7 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
        return 0;
 }
 
-static struct dentry_operations tid_fd_dentry_operations =
+static const struct dentry_operations tid_fd_dentry_operations =
 {
        .d_revalidate   = tid_fd_revalidate,
        .d_delete       = pid_delete_dentry,
@@ -2339,7 +2339,7 @@ static int proc_base_revalidate(struct dentry *dentry, struct nameidata *nd)
        return 0;
 }
 
-static struct dentry_operations proc_base_dentry_operations =
+static const struct dentry_operations proc_base_dentry_operations =
 {
        .d_revalidate   = proc_base_revalidate,
        .d_delete       = pid_delete_dentry,
index db7fa5cab988b1679ebc80a8135cb838a167eda5..5d2989e9dcc125d17aac475df1007b86f43490fd 100644 (file)
@@ -363,7 +363,7 @@ static int proc_delete_dentry(struct dentry * dentry)
        return 1;
 }
 
-static struct dentry_operations proc_dentry_operations =
+static const struct dentry_operations proc_dentry_operations =
 {
        .d_delete       = proc_delete_dentry,
 };
index 94fcfff6863a5976965b8d4253ff3ad1ac45386b..9b1e4e9a16bfd0f1ee07f109b1964f5700c1a577 100644 (file)
@@ -7,7 +7,7 @@
 #include <linux/security.h>
 #include "internal.h"
 
-static struct dentry_operations proc_sys_dentry_operations;
+static const struct dentry_operations proc_sys_dentry_operations;
 static const struct file_operations proc_sys_file_operations;
 static const struct inode_operations proc_sys_inode_operations;
 static const struct file_operations proc_sys_dir_file_operations;
@@ -396,7 +396,7 @@ static int proc_sys_compare(struct dentry *dir, struct qstr *qstr,
        return !sysctl_is_seen(PROC_I(dentry->d_inode)->sysctl);
 }
 
-static struct dentry_operations proc_sys_dentry_operations = {
+static const struct dentry_operations proc_sys_dentry_operations = {
        .d_revalidate   = proc_sys_revalidate,
        .d_delete       = proc_sys_delete,
        .d_compare      = proc_sys_compare,
index f6299a25594e78a7527972930104924434c361c9..1e15a2b176e85a69a4657790009c58976c6dab75 100644 (file)
@@ -83,7 +83,8 @@ static int proc_get_sb(struct file_system_type *fs_type,
                ns->proc_mnt = mnt;
        }
 
-       return simple_set_mnt(mnt, sb);
+       simple_set_mnt(mnt, sb);
+       return 0;
 }
 
 static void proc_kill_sb(struct super_block *sb)
index eb938015bd91a1983513c1c2a297a66467605dd8..2ca967a5ef77de2011d9896695bf80ad4f0e155b 100644 (file)
@@ -823,12 +823,12 @@ static void add_dquot_ref(struct super_block *sb, int type)
 
        spin_lock(&inode_lock);
        list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
+               if (inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW))
+                       continue;
                if (!atomic_read(&inode->i_writecount))
                        continue;
                if (!dqinit_needed(inode, type))
                        continue;
-               if (inode->i_state & (I_FREEING|I_WILL_FREE))
-                       continue;
 
                __iget(inode);
                spin_unlock(&inode_lock);
@@ -915,6 +915,12 @@ static void remove_dquot_ref(struct super_block *sb, int type,
 
        spin_lock(&inode_lock);
        list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
+               /*
+                *  We have to scan also I_NEW inodes because they can already
+                *  have quota pointer initialized. Luckily, we need to touch
+                *  only quota pointers and these have separate locking
+                *  (dqptr_sem).
+                */
                if (!IS_NOQUOTA(inode))
                        remove_inode_dquot_ref(inode, type, tofree_head);
        }
index ad92461cbfc3cadb5b2dcbb32725f108cc0f08a9..ae881ccd2f03472c24ba2aee911377787237ff84 100644 (file)
@@ -1136,7 +1136,7 @@ xattr_lookup_poison(struct dentry *dentry, struct qstr *q1, struct qstr *name)
        return 1;
 }
 
-static struct dentry_operations xattr_lookup_poison_ops = {
+static const struct dentry_operations xattr_lookup_poison_ops = {
        .d_compare = xattr_lookup_poison,
 };
 
index e7ddd0328ddc79ce22f95896ba3dd063d275b73e..3e4803b4427e92e3fb4617ab278e4cc30902e52c 100644 (file)
@@ -277,7 +277,7 @@ static int smb_hash_dentry(struct dentry *, struct qstr *);
 static int smb_compare_dentry(struct dentry *, struct qstr *, struct qstr *);
 static int smb_delete_dentry(struct dentry *);
 
-static struct dentry_operations smbfs_dentry_operations =
+static const struct dentry_operations smbfs_dentry_operations =
 {
        .d_revalidate   = smb_lookup_validate,
        .d_hash         = smb_hash_dentry,
@@ -285,7 +285,7 @@ static struct dentry_operations smbfs_dentry_operations =
        .d_delete       = smb_delete_dentry,
 };
 
-static struct dentry_operations smbfs_dentry_operations_case =
+static const struct dentry_operations smbfs_dentry_operations_case =
 {
        .d_revalidate   = smb_lookup_validate,
        .d_delete       = smb_delete_dentry,
index 49d0bd32a5a7a3918c9f185bd6db21d3d1934f15..2ba481518ba784ec82cbe7c83fbb3801f1f17186 100644 (file)
@@ -838,7 +838,8 @@ int get_sb_bdev(struct file_system_type *fs_type,
                bdev->bd_super = s;
        }
 
-       return simple_set_mnt(mnt, s);
+       simple_set_mnt(mnt, s);
+       return 0;
 
 error_s:
        error = PTR_ERR(s);
@@ -884,7 +885,8 @@ int get_sb_nodev(struct file_system_type *fs_type,
                return error;
        }
        s->s_flags |= MS_ACTIVE;
-       return simple_set_mnt(mnt, s);
+       simple_set_mnt(mnt, s);
+       return 0;
 }
 
 EXPORT_SYMBOL(get_sb_nodev);
@@ -916,7 +918,8 @@ int get_sb_single(struct file_system_type *fs_type,
                s->s_flags |= MS_ACTIVE;
        }
        do_remount_sb(s, flags, data, 0);
-       return simple_set_mnt(mnt, s);
+       simple_set_mnt(mnt, s);
+       return 0;
 }
 
 EXPORT_SYMBOL(get_sb_single);
index 66aeb4fff0c32372968cfe3ac63f0ad0a5f00765..d88d0fac9fa5f185afd13b1f36b11f58baec672d 100644 (file)
@@ -302,7 +302,7 @@ static void sysfs_d_iput(struct dentry * dentry, struct inode * inode)
        iput(inode);
 }
 
-static struct dentry_operations sysfs_dentry_ops = {
+static const struct dentry_operations sysfs_dentry_ops = {
        .d_iput         = sysfs_d_iput,
 };
 
index a1f1ef33e81c4c5584a86630ca1bca637b078fea..33e047b59b8d659975d6c325835f0d11a2df27d4 100644 (file)
@@ -38,7 +38,7 @@ static int sysv_hash(struct dentry *dentry, struct qstr *qstr)
        return 0;
 }
 
-struct dentry_operations sysv_dentry_operations = {
+const struct dentry_operations sysv_dentry_operations = {
        .d_hash         = sysv_hash,
 };
 
index 38ebe3f85b3d092059ae81f7ad3ad6ce2db78208..5784a318c8836e53cd0728087156f318a357c6ff 100644 (file)
@@ -170,7 +170,7 @@ extern const struct file_operations sysv_file_operations;
 extern const struct file_operations sysv_dir_operations;
 extern const struct address_space_operations sysv_aops;
 extern const struct super_operations sysv_sops;
-extern struct dentry_operations sysv_dentry_operations;
+extern const struct dentry_operations sysv_dentry_operations;
 
 
 enum {
index 1182b66a5491443ac725504ec3bd7e3bf0b0dc30..c5c98355459a5fcfab9312b3719e3695c440aadd 100644 (file)
@@ -2034,7 +2034,8 @@ static int ubifs_get_sb(struct file_system_type *fs_type, int flags,
        /* 'fill_super()' opens ubi again so we must close it here */
        ubi_close_volume(ubi);
 
-       return simple_set_mnt(mnt, sb);
+       simple_set_mnt(mnt, sb);
+       return 0;
 
 out_deact:
        up_write(&sb->s_umount);
index 39f8778985655b1f1a166575e013b940af7965d4..3d2512c21f05c7d6ade3f2b64f2231f9b924c94d 100644 (file)
@@ -622,7 +622,6 @@ static int ufs1_read_inode(struct inode *inode, struct ufs_inode *ufs_inode)
        struct ufs_inode_info *ufsi = UFS_I(inode);
        struct super_block *sb = inode->i_sb;
        mode_t mode;
-       unsigned i;
 
        /*
         * Copy data to the in-core inode.
@@ -655,11 +654,12 @@ static int ufs1_read_inode(struct inode *inode, struct ufs_inode *ufs_inode)
 
        
        if (S_ISCHR(mode) || S_ISBLK(mode) || inode->i_blocks) {
-               for (i = 0; i < (UFS_NDADDR + UFS_NINDIR); i++)
-                       ufsi->i_u1.i_data[i] = ufs_inode->ui_u2.ui_addr.ui_db[i];
+               memcpy(ufsi->i_u1.i_data, &ufs_inode->ui_u2.ui_addr,
+                      sizeof(ufs_inode->ui_u2.ui_addr));
        } else {
-               for (i = 0; i < (UFS_NDADDR + UFS_NINDIR) * 4; i++)
-                       ufsi->i_u1.i_symlink[i] = ufs_inode->ui_u2.ui_symlink[i];
+               memcpy(ufsi->i_u1.i_symlink, ufs_inode->ui_u2.ui_symlink,
+                      sizeof(ufs_inode->ui_u2.ui_symlink) - 1);
+               ufsi->i_u1.i_symlink[sizeof(ufs_inode->ui_u2.ui_symlink) - 1] = 0;
        }
        return 0;
 }
@@ -669,7 +669,6 @@ static int ufs2_read_inode(struct inode *inode, struct ufs2_inode *ufs2_inode)
        struct ufs_inode_info *ufsi = UFS_I(inode);
        struct super_block *sb = inode->i_sb;
        mode_t mode;
-       unsigned i;
 
        UFSD("Reading ufs2 inode, ino %lu\n", inode->i_ino);
        /*
@@ -704,12 +703,12 @@ static int ufs2_read_inode(struct inode *inode, struct ufs2_inode *ufs2_inode)
        */
 
        if (S_ISCHR(mode) || S_ISBLK(mode) || inode->i_blocks) {
-               for (i = 0; i < (UFS_NDADDR + UFS_NINDIR); i++)
-                       ufsi->i_u1.u2_i_data[i] =
-                               ufs2_inode->ui_u2.ui_addr.ui_db[i];
+               memcpy(ufsi->i_u1.u2_i_data, &ufs2_inode->ui_u2.ui_addr,
+                      sizeof(ufs2_inode->ui_u2.ui_addr));
        } else {
-               for (i = 0; i < (UFS_NDADDR + UFS_NINDIR) * 4; i++)
-                       ufsi->i_u1.i_symlink[i] = ufs2_inode->ui_u2.ui_symlink[i];
+               memcpy(ufsi->i_u1.i_symlink, ufs2_inode->ui_u2.ui_symlink,
+                      sizeof(ufs2_inode->ui_u2.ui_symlink) - 1);
+               ufsi->i_u1.i_symlink[sizeof(ufs2_inode->ui_u2.ui_symlink) - 1] = 0;
        }
        return 0;
 }
@@ -781,7 +780,6 @@ static void ufs1_update_inode(struct inode *inode, struct ufs_inode *ufs_inode)
 {
        struct super_block *sb = inode->i_sb;
        struct ufs_inode_info *ufsi = UFS_I(inode);
-       unsigned i;
 
        ufs_inode->ui_mode = cpu_to_fs16(sb, inode->i_mode);
        ufs_inode->ui_nlink = cpu_to_fs16(sb, inode->i_nlink);
@@ -809,12 +807,12 @@ static void ufs1_update_inode(struct inode *inode, struct ufs_inode *ufs_inode)
                /* ufs_inode->ui_u2.ui_addr.ui_db[0] = cpu_to_fs32(sb, inode->i_rdev); */
                ufs_inode->ui_u2.ui_addr.ui_db[0] = ufsi->i_u1.i_data[0];
        } else if (inode->i_blocks) {
-               for (i = 0; i < (UFS_NDADDR + UFS_NINDIR); i++)
-                       ufs_inode->ui_u2.ui_addr.ui_db[i] = ufsi->i_u1.i_data[i];
+               memcpy(&ufs_inode->ui_u2.ui_addr, ufsi->i_u1.i_data,
+                      sizeof(ufs_inode->ui_u2.ui_addr));
        }
        else {
-               for (i = 0; i < (UFS_NDADDR + UFS_NINDIR) * 4; i++)
-                       ufs_inode->ui_u2.ui_symlink[i] = ufsi->i_u1.i_symlink[i];
+               memcpy(&ufs_inode->ui_u2.ui_symlink, ufsi->i_u1.i_symlink,
+                      sizeof(ufs_inode->ui_u2.ui_symlink));
        }
 
        if (!inode->i_nlink)
@@ -825,7 +823,6 @@ static void ufs2_update_inode(struct inode *inode, struct ufs2_inode *ufs_inode)
 {
        struct super_block *sb = inode->i_sb;
        struct ufs_inode_info *ufsi = UFS_I(inode);
-       unsigned i;
 
        UFSD("ENTER\n");
        ufs_inode->ui_mode = cpu_to_fs16(sb, inode->i_mode);
@@ -850,11 +847,11 @@ static void ufs2_update_inode(struct inode *inode, struct ufs2_inode *ufs_inode)
                /* ufs_inode->ui_u2.ui_addr.ui_db[0] = cpu_to_fs32(sb, inode->i_rdev); */
                ufs_inode->ui_u2.ui_addr.ui_db[0] = ufsi->i_u1.u2_i_data[0];
        } else if (inode->i_blocks) {
-               for (i = 0; i < (UFS_NDADDR + UFS_NINDIR); i++)
-                       ufs_inode->ui_u2.ui_addr.ui_db[i] = ufsi->i_u1.u2_i_data[i];
+               memcpy(&ufs_inode->ui_u2.ui_addr, ufsi->i_u1.u2_i_data,
+                      sizeof(ufs_inode->ui_u2.ui_addr));
        } else {
-               for (i = 0; i < (UFS_NDADDR + UFS_NINDIR) * 4; i++)
-                       ufs_inode->ui_u2.ui_symlink[i] = ufsi->i_u1.i_symlink[i];
+               memcpy(&ufs_inode->ui_u2.ui_symlink, ufsi->i_u1.i_symlink,
+                      sizeof(ufs_inode->ui_u2.ui_symlink));
        }
 
        if (!inode->i_nlink)
index e3a9b1fac75a2c4f6d04c94f6c22bb39d530d523..23119fe7ad6241e504f4bc7063c22988882d8a0c 100644 (file)
@@ -147,7 +147,7 @@ static int ufs_symlink (struct inode * dir, struct dentry * dentry,
        } else {
                /* fast symlink */
                inode->i_op = &ufs_fast_symlink_inode_operations;
-               memcpy((char*)&UFS_I(inode)->i_u1.i_data,symname,l);
+               memcpy(UFS_I(inode)->i_u1.i_symlink, symname, l);
                inode->i_size = l-1;
        }
        mark_inode_dirty(inode);
index 261a1c2f22dd0bc0c0eac67937e13c85f695006b..e1c1fc5ee2395cca67ad36e10f0577fdef0f0651 100644 (file)
@@ -636,6 +636,7 @@ static int ufs_fill_super(struct super_block *sb, void *data, int silent)
        unsigned block_size, super_block_size;
        unsigned flags;
        unsigned super_block_offset;
+       unsigned maxsymlen;
        int ret = -EINVAL;
 
        uspi = NULL;
@@ -1069,6 +1070,16 @@ magic_found:
                uspi->s_maxsymlinklen =
                    fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen);
 
+       if (uspi->fs_magic == UFS2_MAGIC)
+               maxsymlen = 2 * 4 * (UFS_NDADDR + UFS_NINDIR);
+       else
+               maxsymlen = 4 * (UFS_NDADDR + UFS_NINDIR);
+       if (uspi->s_maxsymlinklen > maxsymlen) {
+               ufs_warning(sb, __func__, "ufs_read_super: excessive maximum "
+                           "fast symlink size (%u)\n", uspi->s_maxsymlinklen);
+               uspi->s_maxsymlinklen = maxsymlen;
+       }
+
        inode = ufs_iget(sb, UFS_ROOTINO);
        if (IS_ERR(inode)) {
                ret = PTR_ERR(inode);
index 11c035168ea6e3c1201ee8f95ed1693c72e566e2..69b3427d7885e0a42e1caa65a22c1ab79d5b015d 100644 (file)
@@ -23,7 +23,7 @@ struct ufs_sb_info {
 struct ufs_inode_info {
        union {
                __fs32  i_data[15];
-               __u8    i_symlink[4*15];
+               __u8    i_symlink[2 * 4 * 15];
                __fs64  u2_i_data[15];
        } i_u1;
        __u32   i_flags;
index bd7ac793be19b80254c421922ede4d540436fd47..f19fd9045ea0a621e05bc6eb11d515a78656f8bb 100644 (file)
@@ -165,15 +165,8 @@ int sync_mapping_buffers(struct address_space *mapping);
 void unmap_underlying_metadata(struct block_device *bdev, sector_t block);
 
 void mark_buffer_async_write(struct buffer_head *bh);
-void invalidate_bdev(struct block_device *);
-int sync_blockdev(struct block_device *bdev);
 void __wait_on_buffer(struct buffer_head *);
 wait_queue_head_t *bh_waitq_head(struct buffer_head *bh);
-int fsync_bdev(struct block_device *);
-struct super_block *freeze_bdev(struct block_device *);
-int thaw_bdev(struct block_device *, struct super_block *);
-int fsync_super(struct super_block *);
-int fsync_no_super(struct block_device *);
 struct buffer_head *__find_get_block(struct block_device *bdev, sector_t block,
                        unsigned size);
 struct buffer_head *__getblk(struct block_device *bdev, sector_t block,
index 3fd2194ff57324670062c5cfc12f95d05fd75f22..b880864672de75e09cfd522f1f6df1fded3ba56b 100644 (file)
@@ -125,6 +125,13 @@ struct compat_dirent {
        char            d_name[256];
 };
 
+struct compat_ustat {
+       compat_daddr_t          f_tfree;
+       compat_ino_t            f_tinode;
+       char                    f_fname[6];
+       char                    f_fpack[6];
+};
+
 typedef union compat_sigval {
        compat_int_t    sival_int;
        compat_uptr_t   sival_ptr;
@@ -178,6 +185,7 @@ long compat_sys_semtimedop(int semid, struct sembuf __user *tsems,
                unsigned nsems, const struct compat_timespec __user *timeout);
 asmlinkage long compat_sys_keyctl(u32 option,
                              u32 arg2, u32 arg3, u32 arg4, u32 arg5);
+asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32);
 
 asmlinkage ssize_t compat_sys_readv(unsigned long fd,
                const struct compat_iovec __user *vec, unsigned long vlen);
index c66d22487bf8c53e7dfb0ee6c34b8cbe726cae56..15156364d196a64103f27b5700756f51882a5eab 100644 (file)
@@ -112,7 +112,7 @@ struct dentry {
        struct list_head d_subdirs;     /* our children */
        struct list_head d_alias;       /* inode alias list */
        unsigned long d_time;           /* used by d_revalidate */
-       struct dentry_operations *d_op;
+       const struct dentry_operations *d_op;
        struct super_block *d_sb;       /* The root of the dentry tree */
        void *d_fsdata;                 /* fs-specific data */
 
index 1cd44f727dac386c90b707f2fe4541b16fdb8d59..42436ae42f7022468fd3fc8f4a947b69f704a7ed 100644 (file)
@@ -1064,34 +1064,147 @@ extern int lease_modify(struct file_lock **, int);
 extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
 extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
 #else /* !CONFIG_FILE_LOCKING */
-#define fcntl_getlk(a, b) ({ -EINVAL; })
-#define fcntl_setlk(a, b, c, d) ({ -EACCES; })
+static inline int fcntl_getlk(struct file *file, struct flock __user *user)
+{
+       return -EINVAL;
+}
+
+static inline int fcntl_setlk(unsigned int fd, struct file *file,
+                             unsigned int cmd, struct flock __user *user)
+{
+       return -EACCES;
+}
+
 #if BITS_PER_LONG == 32
-#define fcntl_getlk64(a, b) ({ -EINVAL; })
-#define fcntl_setlk64(a, b, c, d) ({ -EACCES; })
+static inline int fcntl_getlk64(struct file *file, struct flock64 __user *user)
+{
+       return -EINVAL;
+}
+
+static inline int fcntl_setlk64(unsigned int fd, struct file *file,
+                               unsigned int cmd, struct flock64 __user *user)
+{
+       return -EACCES;
+}
 #endif
-#define fcntl_setlease(a, b, c) ({ 0; })
-#define fcntl_getlease(a) ({ 0; })
-#define locks_init_lock(a) ({ })
-#define __locks_copy_lock(a, b) ({ })
-#define locks_copy_lock(a, b) ({ })
-#define locks_remove_posix(a, b) ({ })
-#define locks_remove_flock(a) ({ })
-#define posix_test_lock(a, b) ({ 0; })
-#define posix_lock_file(a, b, c) ({ -ENOLCK; })
-#define posix_lock_file_wait(a, b) ({ -ENOLCK; })
-#define posix_unblock_lock(a, b) (-ENOENT)
-#define vfs_test_lock(a, b) ({ 0; })
-#define vfs_lock_file(a, b, c, d) (-ENOLCK)
-#define vfs_cancel_lock(a, b) ({ 0; })
-#define flock_lock_file_wait(a, b) ({ -ENOLCK; })
-#define __break_lease(a, b) ({ 0; })
-#define lease_get_mtime(a, b) ({ })
-#define generic_setlease(a, b, c) ({ -EINVAL; })
-#define vfs_setlease(a, b, c) ({ -EINVAL; })
-#define lease_modify(a, b) ({ -EINVAL; })
-#define lock_may_read(a, b, c) ({ 1; })
-#define lock_may_write(a, b, c) ({ 1; })
+static inline int fcntl_setlease(unsigned int fd, struct file *filp, long arg)
+{
+       return 0;
+}
+
+static inline int fcntl_getlease(struct file *filp)
+{
+       return 0;
+}
+
+static inline void locks_init_lock(struct file_lock *fl)
+{
+       return;
+}
+
+static inline void __locks_copy_lock(struct file_lock *new, struct file_lock *fl)
+{
+       return;
+}
+
+static inline void locks_copy_lock(struct file_lock *new, struct file_lock *fl)
+{
+       return;
+}
+
+static inline void locks_remove_posix(struct file *filp, fl_owner_t owner)
+{
+       return;
+}
+
+static inline void locks_remove_flock(struct file *filp)
+{
+       return;
+}
+
+static inline void posix_test_lock(struct file *filp, struct file_lock *fl)
+{
+       return;
+}
+
+static inline int posix_lock_file(struct file *filp, struct file_lock *fl,
+                                 struct file_lock *conflock)
+{
+       return -ENOLCK;
+}
+
+static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl)
+{
+       return -ENOLCK;
+}
+
+static inline int posix_unblock_lock(struct file *filp,
+                                    struct file_lock *waiter)
+{
+       return -ENOENT;
+}
+
+static inline int vfs_test_lock(struct file *filp, struct file_lock *fl)
+{
+       return 0;
+}
+
+static inline int vfs_lock_file(struct file *filp, unsigned int cmd,
+                               struct file_lock *fl, struct file_lock *conf)
+{
+       return -ENOLCK;
+}
+
+static inline int vfs_cancel_lock(struct file *filp, struct file_lock *fl)
+{
+       return 0;
+}
+
+static inline int flock_lock_file_wait(struct file *filp,
+                                      struct file_lock *request)
+{
+       return -ENOLCK;
+}
+
+static inline int __break_lease(struct inode *inode, unsigned int mode)
+{
+       return 0;
+}
+
+static inline void lease_get_mtime(struct inode *inode, struct timespec *time)
+{
+       return;
+}
+
+static inline int generic_setlease(struct file *filp, long arg,
+                                   struct file_lock **flp)
+{
+       return -EINVAL;
+}
+
+static inline int vfs_setlease(struct file *filp, long arg,
+                              struct file_lock **lease)
+{
+       return -EINVAL;
+}
+
+static inline int lease_modify(struct file_lock **before, int arg)
+{
+       return -EINVAL;
+}
+
+static inline int lock_may_read(struct inode *inode, loff_t start,
+                               unsigned long len)
+{
+       return 1;
+}
+
+static inline int lock_may_write(struct inode *inode, loff_t start,
+                                unsigned long len)
+{
+       return 1;
+}
+
 #endif /* !CONFIG_FILE_LOCKING */
 
 
@@ -1607,7 +1720,7 @@ struct super_block *sget(struct file_system_type *type,
 extern int get_sb_pseudo(struct file_system_type *, char *,
        const struct super_operations *ops, unsigned long,
        struct vfsmount *mnt);
-extern int simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
+extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
 int __put_super_and_need_restart(struct super_block *sb);
 
 /* Alas, no aliases. Too much hassle with bringing module.h everywhere */
@@ -1688,13 +1801,44 @@ static inline int break_lease(struct inode *inode, unsigned int mode)
        return 0;
 }
 #else /* !CONFIG_FILE_LOCKING */
-#define locks_mandatory_locked(a) ({ 0; })
-#define locks_mandatory_area(a, b, c, d, e) ({ 0; })
-#define __mandatory_lock(a) ({ 0; })
-#define mandatory_lock(a) ({ 0; })
-#define locks_verify_locked(a) ({ 0; })
-#define locks_verify_truncate(a, b, c) ({ 0; })
-#define break_lease(a, b) ({ 0; })
+static inline int locks_mandatory_locked(struct inode *inode)
+{
+       return 0;
+}
+
+static inline int locks_mandatory_area(int rw, struct inode *inode,
+                                      struct file *filp, loff_t offset,
+                                      size_t count)
+{
+       return 0;
+}
+
+static inline int __mandatory_lock(struct inode *inode)
+{
+       return 0;
+}
+
+static inline int mandatory_lock(struct inode *inode)
+{
+       return 0;
+}
+
+static inline int locks_verify_locked(struct inode *inode)
+{
+       return 0;
+}
+
+static inline int locks_verify_truncate(struct inode *inode, struct file *filp,
+                                       size_t size)
+{
+       return 0;
+}
+
+static inline int break_lease(struct inode *inode, unsigned int mode)
+{
+       return 0;
+}
+
 #endif /* CONFIG_FILE_LOCKING */
 
 /* fs/open.c */
@@ -1731,6 +1875,13 @@ extern void bd_set_size(struct block_device *, loff_t size);
 extern void bd_forget(struct inode *inode);
 extern void bdput(struct block_device *);
 extern struct block_device *open_by_devnum(dev_t, fmode_t);
+extern void invalidate_bdev(struct block_device *);
+extern int sync_blockdev(struct block_device *bdev);
+extern struct super_block *freeze_bdev(struct block_device *);
+extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
+extern int fsync_bdev(struct block_device *);
+extern int fsync_super(struct super_block *);
+extern int fsync_no_super(struct block_device *);
 #else
 static inline void bd_forget(struct inode *inode) {}
 #endif
@@ -1882,7 +2033,6 @@ static inline void allow_write_access(struct file *file)
        if (file)
                atomic_inc(&file->f_path.dentry->d_inode->i_writecount);
 }
-extern int do_pipe(int *);
 extern int do_pipe_flags(int *, int);
 extern struct file *create_read_pipe(struct file *f, int flags);
 extern struct file *create_write_pipe(int flags);
index f69e66d151cca2b2972f720b0d477daebc0ad429..30b06c89394482f86955dfa69f8a9f912e98388d 100644 (file)
@@ -204,7 +204,7 @@ void ncp_update_inode2(struct inode *, struct ncp_entry_info *);
 /* linux/fs/ncpfs/dir.c */
 extern const struct inode_operations ncp_dir_inode_operations;
 extern const struct file_operations ncp_dir_operations;
-extern struct dentry_operations ncp_root_dentry_operations;
+extern const struct dentry_operations ncp_root_dentry_operations;
 int ncp_conn_logged_in(struct super_block *);
 int ncp_date_dos2unix(__le16 time, __le16 date);
 void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date);
index db867b04ac3c21b66e39793149e121b4569ee41f..8cc8807f77d6da286c6225ccb4a8c69642b826e3 100644 (file)
@@ -415,7 +415,7 @@ extern const struct inode_operations nfs_dir_inode_operations;
 extern const struct inode_operations nfs3_dir_inode_operations;
 #endif /* CONFIG_NFS_V3 */
 extern const struct file_operations nfs_dir_operations;
-extern struct dentry_operations nfs_dentry_operations;
+extern const struct dentry_operations nfs_dentry_operations;
 
 extern void nfs_force_lookup_revalidate(struct inode *dir);
 extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_fattr *fattr);
index 2e5f00066afd2a5e625b6bfc34de395a65929cc8..43a713fce11cbfbd25571424e7201758f15b4bf5 100644 (file)
@@ -785,7 +785,7 @@ struct nfs_access_entry;
  */
 struct nfs_rpc_ops {
        u32     version;                /* Protocol version */
-       struct dentry_operations *dentry_ops;
+       const struct dentry_operations *dentry_ops;
        const struct inode_operations *dir_inode_ops;
        const struct inode_operations *file_inode_ops;
 
index 9edb5c4b79b4f1a88a0487f588c36fc6207f54a9..c500ca7239b21a465831e2b3f0454f14505ff3e9 100644 (file)
@@ -1071,7 +1071,8 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
                mutex_unlock(&cgroup_mutex);
        }
 
-       return simple_set_mnt(mnt, sb);
+       simple_set_mnt(mnt, sb);
+       return 0;
 
  free_cg_links:
        free_cg_links(&tmp_cg_links);
@@ -1627,7 +1628,7 @@ static struct inode_operations cgroup_dir_inode_operations = {
 static int cgroup_create_file(struct dentry *dentry, int mode,
                                struct super_block *sb)
 {
-       static struct dentry_operations cgroup_dops = {
+       static const struct dentry_operations cgroup_dops = {
                .d_iput = cgroup_diput,
        };
 
index af0205ff56f2ad3e8ed7f4edfff722291d763f34..0b14b79c03aff9503f4c56f80b4a6e5850737ca8 100644 (file)
@@ -328,7 +328,7 @@ static char *sockfs_dname(struct dentry *dentry, char *buffer, int buflen)
                                dentry->d_inode->i_ino);
 }
 
-static struct dentry_operations sockfs_dentry_operations = {
+static const struct dentry_operations sockfs_dentry_operations = {
        .d_delete = sockfs_delete_dentry,
        .d_dname  = sockfs_dname,
 };
index 577385a4a5dc51219f1b2d6c8e6dec8568b3c2af..9ced0628d69c35d44aa158b6d615acf8086278c6 100644 (file)
@@ -480,7 +480,7 @@ static int rpc_delete_dentry(struct dentry *dentry)
        return 1;
 }
 
-static struct dentry_operations rpc_dentry_operations = {
+static const struct dentry_operations rpc_dentry_operations = {
        .d_delete = rpc_delete_dentry,
 };