Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

* 'for-linus2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (165 commits)
reiserfs: Properly display mount options in /proc/mounts
vfs: prevent remount read-only if pending removes
vfs: count unlinked inodes
vfs: protect remounting superblock read-only
vfs: keep list of mounts for each superblock
vfs: switch ->show_options() to struct dentry *
vfs: switch ->show_path() to struct dentry *
vfs: switch ->show_devname() to struct dentry *
vfs: switch ->show_stats to struct dentry *
switch security_path_chmod() to struct path *
vfs: prefer ->dentry->d_sb to ->mnt->mnt_sb
vfs: trim includes a bit
switch mnt_namespace ->root to struct mount
vfs: take /proc/*/mounts and friends to fs/proc_namespace.c
vfs: opencode mntget() mnt_set_mountpoint()
vfs: spread struct mount - remaining argument of next_mnt()
vfs: move fsnotify junk to struct mount
vfs: move mnt_devname
vfs: move mnt_list to struct mount
vfs: switch pnode.h macros to struct mount *
...

+2587 -2878
+4 -4
Documentation/filesystems/Locking
··· 37 37 38 38 --------------------------- inode_operations --------------------------- 39 39 prototypes: 40 - int (*create) (struct inode *,struct dentry *,int, struct nameidata *); 40 + int (*create) (struct inode *,struct dentry *,umode_t, struct nameidata *); 41 41 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameid 42 42 ata *); 43 43 int (*link) (struct dentry *,struct inode *,struct dentry *); 44 44 int (*unlink) (struct inode *,struct dentry *); 45 45 int (*symlink) (struct inode *,struct dentry *,const char *); 46 - int (*mkdir) (struct inode *,struct dentry *,int); 46 + int (*mkdir) (struct inode *,struct dentry *,umode_t); 47 47 int (*rmdir) (struct inode *,struct dentry *); 48 - int (*mknod) (struct inode *,struct dentry *,int,dev_t); 48 + int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); 49 49 int (*rename) (struct inode *, struct dentry *, 50 50 struct inode *, struct dentry *); 51 51 int (*readlink) (struct dentry *, char __user *,int); ··· 117 117 int (*statfs) (struct dentry *, struct kstatfs *); 118 118 int (*remount_fs) (struct super_block *, int *, char *); 119 119 void (*umount_begin) (struct super_block *); 120 - int (*show_options)(struct seq_file *, struct vfsmount *); 120 + int (*show_options)(struct seq_file *, struct dentry *); 121 121 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); 122 122 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 123 123 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
+1 -1
Documentation/filesystems/configfs/configfs.txt
··· 192 192 struct configfs_attribute { 193 193 char *ca_name; 194 194 struct module *ca_owner; 195 - mode_t ca_mode; 195 + umode_t ca_mode; 196 196 }; 197 197 198 198 When a config_item wants an attribute to appear as a file in the item's
+12 -12
Documentation/filesystems/debugfs.txt
··· 35 35 36 36 The most general way to create a file within a debugfs directory is with: 37 37 38 - struct dentry *debugfs_create_file(const char *name, mode_t mode, 38 + struct dentry *debugfs_create_file(const char *name, umode_t mode, 39 39 struct dentry *parent, void *data, 40 40 const struct file_operations *fops); 41 41 ··· 53 53 for simple situations. Files containing a single integer value can be 54 54 created with any of: 55 55 56 - struct dentry *debugfs_create_u8(const char *name, mode_t mode, 56 + struct dentry *debugfs_create_u8(const char *name, umode_t mode, 57 57 struct dentry *parent, u8 *value); 58 - struct dentry *debugfs_create_u16(const char *name, mode_t mode, 58 + struct dentry *debugfs_create_u16(const char *name, umode_t mode, 59 59 struct dentry *parent, u16 *value); 60 - struct dentry *debugfs_create_u32(const char *name, mode_t mode, 60 + struct dentry *debugfs_create_u32(const char *name, umode_t mode, 61 61 struct dentry *parent, u32 *value); 62 - struct dentry *debugfs_create_u64(const char *name, mode_t mode, 62 + struct dentry *debugfs_create_u64(const char *name, umode_t mode, 63 63 struct dentry *parent, u64 *value); 64 64 65 65 These files support both reading and writing the given value; if a specific ··· 67 67 values in these files are in decimal; if hexadecimal is more appropriate, 68 68 the following functions can be used instead: 69 69 70 - struct dentry *debugfs_create_x8(const char *name, mode_t mode, 70 + struct dentry *debugfs_create_x8(const char *name, umode_t mode, 71 71 struct dentry *parent, u8 *value); 72 - struct dentry *debugfs_create_x16(const char *name, mode_t mode, 72 + struct dentry *debugfs_create_x16(const char *name, umode_t mode, 73 73 struct dentry *parent, u16 *value); 74 - struct dentry *debugfs_create_x32(const char *name, mode_t mode, 74 + struct dentry *debugfs_create_x32(const char *name, umode_t mode, 75 75 struct dentry *parent, u32 *value); 76 - struct dentry *debugfs_create_x64(const char *name, mode_t mode, 76 + struct dentry *debugfs_create_x64(const char *name, umode_t mode, 77 77 struct dentry *parent, u64 *value); 78 78 79 79 These functions are useful as long as the developer knows the size of the ··· 81 81 architectures, though, complicating the situation somewhat. There is a 82 82 function meant to help out in one special case: 83 83 84 - struct dentry *debugfs_create_size_t(const char *name, mode_t mode, 84 + struct dentry *debugfs_create_size_t(const char *name, umode_t mode, 85 85 struct dentry *parent, 86 86 size_t *value); 87 87 ··· 90 90 91 91 Boolean values can be placed in debugfs with: 92 92 93 - struct dentry *debugfs_create_bool(const char *name, mode_t mode, 93 + struct dentry *debugfs_create_bool(const char *name, umode_t mode, 94 94 struct dentry *parent, u32 *value); 95 95 96 96 A read on the resulting file will yield either Y (for non-zero values) or ··· 105 105 unsigned long size; 106 106 }; 107 107 108 - struct dentry *debugfs_create_blob(const char *name, mode_t mode, 108 + struct dentry *debugfs_create_blob(const char *name, umode_t mode, 109 109 struct dentry *parent, 110 110 struct debugfs_blob_wrapper *blob); 111 111
+1 -1
Documentation/filesystems/sysfs.txt
··· 70 70 struct attribute { 71 71 char * name; 72 72 struct module *owner; 73 - mode_t mode; 73 + umode_t mode; 74 74 }; 75 75 76 76
+4 -4
Documentation/filesystems/vfs.txt
··· 225 225 void (*clear_inode) (struct inode *); 226 226 void (*umount_begin) (struct super_block *); 227 227 228 - int (*show_options)(struct seq_file *, struct vfsmount *); 228 + int (*show_options)(struct seq_file *, struct dentry *); 229 229 230 230 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); 231 231 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); ··· 341 341 filesystem. As of kernel 2.6.22, the following members are defined: 342 342 343 343 struct inode_operations { 344 - int (*create) (struct inode *,struct dentry *,int, struct nameidata *); 344 + int (*create) (struct inode *,struct dentry *, umode_t, struct nameidata *); 345 345 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); 346 346 int (*link) (struct dentry *,struct inode *,struct dentry *); 347 347 int (*unlink) (struct inode *,struct dentry *); 348 348 int (*symlink) (struct inode *,struct dentry *,const char *); 349 - int (*mkdir) (struct inode *,struct dentry *,int); 349 + int (*mkdir) (struct inode *,struct dentry *,umode_t); 350 350 int (*rmdir) (struct inode *,struct dentry *); 351 - int (*mknod) (struct inode *,struct dentry *,int,dev_t); 351 + int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); 352 352 int (*rename) (struct inode *, struct dentry *, 353 353 struct inode *, struct dentry *); 354 354 int (*readlink) (struct dentry *, char __user *,int);
+1 -28
arch/alpha/include/asm/ipcbuf.h
··· 1 - #ifndef _ALPHA_IPCBUF_H 2 - #define _ALPHA_IPCBUF_H 3 - 4 - /* 5 - * The ipc64_perm structure for alpha architecture. 6 - * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 8 - * 9 - * Pad space is left for: 10 - * - 32-bit seq 11 - * - 2 miscellaneous 64-bit values 12 - */ 13 - 14 - struct ipc64_perm 15 - { 16 - __kernel_key_t key; 17 - __kernel_uid_t uid; 18 - __kernel_gid_t gid; 19 - __kernel_uid_t cuid; 20 - __kernel_gid_t cgid; 21 - __kernel_mode_t mode; 22 - unsigned short seq; 23 - unsigned short __pad1; 24 - unsigned long __unused1; 25 - unsigned long __unused2; 26 - }; 27 - 28 - #endif /* _ALPHA_IPCBUF_H */ 1 + #include <asm-generic/ipcbuf.h>
-5
arch/alpha/include/asm/types.h
··· 15 15 #include <asm-generic/int-l64.h> 16 16 #endif 17 17 18 - #ifndef __ASSEMBLY__ 19 - 20 - typedef unsigned int umode_t; 21 - 22 - #endif /* __ASSEMBLY__ */ 23 18 #endif /* _ALPHA_TYPES_H */
+1 -29
arch/arm/include/asm/ipcbuf.h
··· 1 - #ifndef __ASMARM_IPCBUF_H 2 - #define __ASMARM_IPCBUF_H 3 - 4 - /* 5 - * The ipc64_perm structure for arm architecture. 6 - * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 8 - * 9 - * Pad space is left for: 10 - * - 32-bit mode_t and seq 11 - * - 2 miscellaneous 32-bit values 12 - */ 13 - 14 - struct ipc64_perm 15 - { 16 - __kernel_key_t key; 17 - __kernel_uid32_t uid; 18 - __kernel_gid32_t gid; 19 - __kernel_uid32_t cuid; 20 - __kernel_gid32_t cgid; 21 - __kernel_mode_t mode; 22 - unsigned short __pad1; 23 - unsigned short seq; 24 - unsigned short __pad2; 25 - unsigned long __unused1; 26 - unsigned long __unused2; 27 - }; 28 - 29 - #endif /* __ASMARM_IPCBUF_H */ 1 + #include <asm-generic/ipcbuf.h>
-6
arch/arm/include/asm/types.h
··· 3 3 4 4 #include <asm-generic/int-ll64.h> 5 5 6 - #ifndef __ASSEMBLY__ 7 - 8 - typedef unsigned short umode_t; 9 - 10 - #endif /* __ASSEMBLY__ */ 11 - 12 6 /* 13 7 * These aren't exported outside the kernel to avoid name space clashes 14 8 */
+1 -1
arch/arm/mach-msm/smd_debug.c
··· 215 215 .llseek = default_llseek, 216 216 }; 217 217 218 - static void debug_create(const char *name, mode_t mode, 218 + static void debug_create(const char *name, umode_t mode, 219 219 struct dentry *dent, 220 220 int (*fill)(char *buf, int max)) 221 221 {
+1 -29
arch/avr32/include/asm/ipcbuf.h
··· 1 - #ifndef __ASM_AVR32_IPCBUF_H 2 - #define __ASM_AVR32_IPCBUF_H 3 - 4 - /* 5 - * The user_ipc_perm structure for AVR32 architecture. 6 - * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 8 - * 9 - * Pad space is left for: 10 - * - 32-bit mode_t and seq 11 - * - 2 miscellaneous 32-bit values 12 - */ 13 - 14 - struct ipc64_perm 15 - { 16 - __kernel_key_t key; 17 - __kernel_uid32_t uid; 18 - __kernel_gid32_t gid; 19 - __kernel_uid32_t cuid; 20 - __kernel_gid32_t cgid; 21 - __kernel_mode_t mode; 22 - unsigned short __pad1; 23 - unsigned short seq; 24 - unsigned short __pad2; 25 - unsigned long __unused1; 26 - unsigned long __unused2; 27 - }; 28 - 29 - #endif /* __ASM_AVR32_IPCBUF_H */ 1 + #include <asm-generic/ipcbuf.h>
-6
arch/avr32/include/asm/types.h
··· 10 10 11 11 #include <asm-generic/int-ll64.h> 12 12 13 - #ifndef __ASSEMBLY__ 14 - 15 - typedef unsigned short umode_t; 16 - 17 - #endif /* __ASSEMBLY__ */ 18 - 19 13 /* 20 14 * These aren't exported outside the kernel to avoid name space clashes 21 15 */
+1 -29
arch/cris/include/asm/ipcbuf.h
··· 1 - #ifndef __CRIS_IPCBUF_H__ 2 - #define __CRIS_IPCBUF_H__ 3 - 4 - /* 5 - * The user_ipc_perm structure for CRIS architecture. 6 - * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 8 - * 9 - * Pad space is left for: 10 - * - 32-bit mode_t and seq 11 - * - 2 miscellaneous 32-bit values 12 - */ 13 - 14 - struct ipc64_perm 15 - { 16 - __kernel_key_t key; 17 - __kernel_uid32_t uid; 18 - __kernel_gid32_t gid; 19 - __kernel_uid32_t cuid; 20 - __kernel_gid32_t cgid; 21 - __kernel_mode_t mode; 22 - unsigned short __pad1; 23 - unsigned short seq; 24 - unsigned short __pad2; 25 - unsigned long __unused1; 26 - unsigned long __unused2; 27 - }; 28 - 29 - #endif /* __CRIS_IPCBUF_H__ */ 1 + #include <asm-generic/ipcbuf.h>
-6
arch/cris/include/asm/types.h
··· 3 3 4 4 #include <asm-generic/int-ll64.h> 5 5 6 - #ifndef __ASSEMBLY__ 7 - 8 - typedef unsigned short umode_t; 9 - 10 - #endif /* __ASSEMBLY__ */ 11 - 12 6 /* 13 7 * These aren't exported outside the kernel to avoid name space clashes 14 8 */
+1 -30
arch/frv/include/asm/ipcbuf.h
··· 1 - #ifndef __ASM_IPCBUF_H__ 2 - #define __ASM_IPCBUF_H__ 3 - 4 - /* 5 - * The user_ipc_perm structure for FR-V architecture. 6 - * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 8 - * 9 - * Pad space is left for: 10 - * - 32-bit mode_t and seq 11 - * - 2 miscellaneous 32-bit values 12 - */ 13 - 14 - struct ipc64_perm 15 - { 16 - __kernel_key_t key; 17 - __kernel_uid32_t uid; 18 - __kernel_gid32_t gid; 19 - __kernel_uid32_t cuid; 20 - __kernel_gid32_t cgid; 21 - __kernel_mode_t mode; 22 - unsigned short __pad1; 23 - unsigned short seq; 24 - unsigned short __pad2; 25 - unsigned long __unused1; 26 - unsigned long __unused2; 27 - }; 28 - 29 - #endif /* __ASM_IPCBUF_H__ */ 30 - 1 + #include <asm-generic/ipcbuf.h>
-6
arch/frv/include/asm/types.h
··· 14 14 15 15 #include <asm-generic/int-ll64.h> 16 16 17 - #ifndef __ASSEMBLY__ 18 - 19 - typedef unsigned short umode_t; 20 - 21 - #endif /* __ASSEMBLY__ */ 22 - 23 17 /* 24 18 * These aren't exported outside the kernel to avoid name space clashes 25 19 */
+1 -29
arch/h8300/include/asm/ipcbuf.h
··· 1 - #ifndef __H8300_IPCBUF_H__ 2 - #define __H8300_IPCBUF_H__ 3 - 4 - /* 5 - * The user_ipc_perm structure for H8/300 architecture. 6 - * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 8 - * 9 - * Pad space is left for: 10 - * - 32-bit mode_t and seq 11 - * - 2 miscellaneous 32-bit values 12 - */ 13 - 14 - struct ipc64_perm 15 - { 16 - __kernel_key_t key; 17 - __kernel_uid32_t uid; 18 - __kernel_gid32_t gid; 19 - __kernel_uid32_t cuid; 20 - __kernel_gid32_t cgid; 21 - __kernel_mode_t mode; 22 - unsigned short __pad1; 23 - unsigned short seq; 24 - unsigned short __pad2; 25 - unsigned long __unused1; 26 - unsigned long __unused2; 27 - }; 28 - 29 - #endif /* __H8300_IPCBUF_H__ */ 1 + #include <asm-generic/ipcbuf.h>
-17
arch/h8300/include/asm/types.h
··· 3 3 4 4 #include <asm-generic/int-ll64.h> 5 5 6 - #if !defined(__ASSEMBLY__) 7 - 8 - /* 9 - * This file is never included by application software unless 10 - * explicitly requested (e.g., via linux/types.h) in which case the 11 - * application is Linux specific so (user-) name space pollution is 12 - * not a major issue. However, for interoperability, libraries still 13 - * need to be careful to avoid a name clashes. 14 - */ 15 - 16 - typedef unsigned short umode_t; 17 - 18 - /* 19 - * These aren't exported outside the kernel to avoid name space clashes 20 - */ 21 6 #ifdef __KERNEL__ 22 7 23 8 #define BITS_PER_LONG 32 24 9 25 10 #endif /* __KERNEL__ */ 26 - 27 - #endif /* __ASSEMBLY__ */ 28 11 29 12 #endif /* _H8300_TYPES_H */
+1 -28
arch/ia64/include/asm/ipcbuf.h
··· 1 - #ifndef _ASM_IA64_IPCBUF_H 2 - #define _ASM_IA64_IPCBUF_H 3 - 4 - /* 5 - * The ipc64_perm structure for IA-64 architecture. 6 - * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 8 - * 9 - * Pad space is left for: 10 - * - 32-bit seq 11 - * - 2 miscellaneous 64-bit values 12 - */ 13 - 14 - struct ipc64_perm 15 - { 16 - __kernel_key_t key; 17 - __kernel_uid_t uid; 18 - __kernel_gid_t gid; 19 - __kernel_uid_t cuid; 20 - __kernel_gid_t cgid; 21 - __kernel_mode_t mode; 22 - unsigned short seq; 23 - unsigned short __pad1; 24 - unsigned long __unused1; 25 - unsigned long __unused2; 26 - }; 27 - 28 - #endif /* _ASM_IA64_IPCBUF_H */ 1 + #include <asm-generic/ipcbuf.h>
-2
arch/ia64/include/asm/types.h
··· 28 28 # define __IA64_UL(x) ((unsigned long)(x)) 29 29 # define __IA64_UL_CONST(x) x##UL 30 30 31 - typedef unsigned int umode_t; 32 - 33 31 /* 34 32 * These aren't exported outside the kernel to avoid name space clashes 35 33 */
+1 -1
arch/ia64/kernel/perfmon.c
··· 2228 2228 /* 2229 2229 * allocate a new dcache entry 2230 2230 */ 2231 - path.dentry = d_alloc(pfmfs_mnt->mnt_sb->s_root, &this); 2231 + path.dentry = d_alloc(pfmfs_mnt->mnt_root, &this); 2232 2232 if (!path.dentry) { 2233 2233 iput(inode); 2234 2234 return ERR_PTR(-ENOMEM);
+1 -29
arch/m32r/include/asm/ipcbuf.h
··· 1 - #ifndef _ASM_M32R_IPCBUF_H 2 - #define _ASM_M32R_IPCBUF_H 3 - 4 - /* 5 - * The ipc64_perm structure for m32r architecture. 6 - * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 8 - * 9 - * Pad space is left for: 10 - * - 32-bit mode_t and seq 11 - * - 2 miscellaneous 32-bit values 12 - */ 13 - 14 - struct ipc64_perm 15 - { 16 - __kernel_key_t key; 17 - __kernel_uid32_t uid; 18 - __kernel_gid32_t gid; 19 - __kernel_uid32_t cuid; 20 - __kernel_gid32_t cgid; 21 - __kernel_mode_t mode; 22 - unsigned short __pad1; 23 - unsigned short seq; 24 - unsigned short __pad2; 25 - unsigned long __unused1; 26 - unsigned long __unused2; 27 - }; 28 - 29 - #endif /* _ASM_M32R_IPCBUF_H */ 1 + #include <asm-generic/ipcbuf.h>
-6
arch/m32r/include/asm/types.h
··· 3 3 4 4 #include <asm-generic/int-ll64.h> 5 5 6 - #ifndef __ASSEMBLY__ 7 - 8 - typedef unsigned short umode_t; 9 - 10 - #endif /* __ASSEMBLY__ */ 11 - 12 6 /* 13 7 * These aren't exported outside the kernel to avoid name space clashes 14 8 */
+1 -29
arch/m68k/include/asm/ipcbuf.h
··· 1 - #ifndef __m68k_IPCBUF_H__ 2 - #define __m68k_IPCBUF_H__ 3 - 4 - /* 5 - * The user_ipc_perm structure for m68k architecture. 6 - * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 8 - * 9 - * Pad space is left for: 10 - * - 32-bit mode_t and seq 11 - * - 2 miscellaneous 32-bit values 12 - */ 13 - 14 - struct ipc64_perm 15 - { 16 - __kernel_key_t key; 17 - __kernel_uid32_t uid; 18 - __kernel_gid32_t gid; 19 - __kernel_uid32_t cuid; 20 - __kernel_gid32_t cgid; 21 - __kernel_mode_t mode; 22 - unsigned short __pad1; 23 - unsigned short seq; 24 - unsigned short __pad2; 25 - unsigned long __unused1; 26 - unsigned long __unused2; 27 - }; 28 - 29 - #endif /* __m68k_IPCBUF_H__ */ 1 + #include <asm-generic/ipcbuf.h>
-6
arch/m68k/include/asm/types.h
··· 10 10 */ 11 11 #include <asm-generic/int-ll64.h> 12 12 13 - #ifndef __ASSEMBLY__ 14 - 15 - typedef unsigned short umode_t; 16 - 17 - #endif /* __ASSEMBLY__ */ 18 - 19 13 /* 20 14 * These aren't exported outside the kernel to avoid name space clashes 21 15 */
+1 -28
arch/mips/include/asm/ipcbuf.h
··· 1 - #ifndef _ASM_IPCBUF_H 2 - #define _ASM_IPCBUF_H 3 - 4 - /* 5 - * The ipc64_perm structure for alpha architecture. 6 - * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 8 - * 9 - * Pad space is left for: 10 - * - 32-bit seq 11 - * - 2 miscellaneous 64-bit values 12 - */ 13 - 14 - struct ipc64_perm 15 - { 16 - __kernel_key_t key; 17 - __kernel_uid_t uid; 18 - __kernel_gid_t gid; 19 - __kernel_uid_t cuid; 20 - __kernel_gid_t cgid; 21 - __kernel_mode_t mode; 22 - unsigned short seq; 23 - unsigned short __pad1; 24 - unsigned long __unused1; 25 - unsigned long __unused2; 26 - }; 27 - 28 - #endif /* _ASM_IPCBUF_H */ 1 + #include <asm-generic/ipcbuf.h>
-6
arch/mips/include/asm/types.h
··· 21 21 # include <asm-generic/int-ll64.h> 22 22 #endif 23 23 24 - #ifndef __ASSEMBLY__ 25 - 26 - typedef unsigned short umode_t; 27 - 28 - #endif /* __ASSEMBLY__ */ 29 - 30 24 /* 31 25 * These aren't exported outside the kernel to avoid name space clashes 32 26 */
+1 -29
arch/mn10300/include/asm/ipcbuf.h
··· 1 - #ifndef _ASM_IPCBUF_H 2 - #define _ASM_IPCBUF_H 3 - 4 - /* 5 - * The ipc64_perm structure for MN10300 architecture. 6 - * Note extra padding because this structure is passed back and forth 7 - * between kernel and user space. 8 - * 9 - * Pad space is left for: 10 - * - 32-bit mode_t and seq 11 - * - 2 miscellaneous 32-bit values 12 - */ 13 - 14 - struct ipc64_perm 15 - { 16 - __kernel_key_t key; 17 - __kernel_uid32_t uid; 18 - __kernel_gid32_t gid; 19 - __kernel_uid32_t cuid; 20 - __kernel_gid32_t cgid; 21 - __kernel_mode_t mode; 22 - unsigned short __pad1; 23 - unsigned short seq; 24 - unsigned short __pad2; 25 - unsigned long __unused1; 26 - unsigned long __unused2; 27 - }; 28 - 29 - #endif /* _ASM_IPCBUF_H */ 1 + #include <asm-generic/ipcbuf.h>
-6
arch/mn10300/include/asm/types.h
··· 13 13 14 14 #include <asm-generic/int-ll64.h> 15 15 16 - #ifndef __ASSEMBLY__ 17 - 18 - typedef unsigned short umode_t; 19 - 20 - #endif /* __ASSEMBLY__ */ 21 - 22 16 /* 23 17 * These aren't exported outside the kernel to avoid name space clashes 24 18 */
+1 -8
arch/parisc/hpux/sys_hpux.c
··· 136 136 */ 137 137 static int hpux_ustat(dev_t dev, struct hpux_ustat __user *ubuf) 138 138 { 139 - struct super_block *s; 140 139 struct hpux_ustat tmp; /* Changed to hpux_ustat */ 141 140 struct kstatfs sbuf; 142 - int err = -EINVAL; 143 - 144 - s = user_get_super(dev); 145 - if (s == NULL) 146 - goto out; 147 - err = statfs_by_dentry(s->s_root, &sbuf); 148 - drop_super(s); 141 + int err = vfs_ustat(dev, &sbuf); 149 142 if (err) 150 143 goto out; 151 144
-6
arch/parisc/include/asm/types.h
··· 3 3 4 4 #include <asm-generic/int-ll64.h> 5 5 6 - #ifndef __ASSEMBLY__ 7 - 8 - typedef unsigned short umode_t; 9 - 10 - #endif /* __ASSEMBLY__ */ 11 - 12 6 #endif
+1 -1
arch/powerpc/include/asm/spu.h
··· 237 237 struct file; 238 238 struct spufs_calls { 239 239 long (*create_thread)(const char __user *name, 240 - unsigned int flags, mode_t mode, 240 + unsigned int flags, umode_t mode, 241 241 struct file *neighbor); 242 242 long (*spu_run)(struct file *filp, __u32 __user *unpc, 243 243 __u32 __user *ustatus);
-6
arch/powerpc/include/asm/types.h
··· 30 30 * 2 of the License, or (at your option) any later version. 31 31 */ 32 32 33 - #ifdef __powerpc64__ 34 - typedef unsigned int umode_t; 35 - #else 36 - typedef unsigned short umode_t; 37 - #endif 38 - 39 33 typedef struct { 40 34 __u32 u[4]; 41 35 } __attribute__((aligned(16))) __vector128;
+1 -1
arch/powerpc/kernel/lparcfg.c
··· 783 783 static int __init lparcfg_init(void) 784 784 { 785 785 struct proc_dir_entry *ent; 786 - mode_t mode = S_IRUSR | S_IRGRP | S_IROTH; 786 + umode_t mode = S_IRUSR | S_IRGRP | S_IROTH; 787 787 788 788 /* Allow writing if we have FW_FEATURE_SPLPAR */ 789 789 if (firmware_has_feature(FW_FEATURE_SPLPAR) &&
+2 -2
arch/powerpc/platforms/cell/spu_syscalls.c
··· 65 65 66 66 #endif /* CONFIG_SPU_FS_MODULE */ 67 67 68 - asmlinkage long sys_spu_create(const char __user *name, 69 - unsigned int flags, mode_t mode, int neighbor_fd) 68 + SYSCALL_DEFINE4(spu_create, const char __user *, name, unsigned int, flags, 69 + umode_t, mode, int, neighbor_fd) 70 70 { 71 71 long ret; 72 72 struct file *neighbor;
+8 -9
arch/powerpc/platforms/cell/spufs/inode.c
··· 74 74 static void spufs_i_callback(struct rcu_head *head) 75 75 { 76 76 struct inode *inode = container_of(head, struct inode, i_rcu); 77 - INIT_LIST_HEAD(&inode->i_dentry); 78 77 kmem_cache_free(spufs_inode_cache, SPUFS_I(inode)); 79 78 } 80 79 ··· 91 92 } 92 93 93 94 static struct inode * 94 - spufs_new_inode(struct super_block *sb, int mode) 95 + spufs_new_inode(struct super_block *sb, umode_t mode) 95 96 { 96 97 struct inode *inode; 97 98 ··· 123 124 124 125 static int 125 126 spufs_new_file(struct super_block *sb, struct dentry *dentry, 126 - const struct file_operations *fops, int mode, 127 + const struct file_operations *fops, umode_t mode, 127 128 size_t size, struct spu_context *ctx) 128 129 { 129 130 static const struct inode_operations spufs_file_iops = { ··· 193 194 } 194 195 195 196 static int spufs_fill_dir(struct dentry *dir, 196 - const struct spufs_tree_descr *files, int mode, 197 + const struct spufs_tree_descr *files, umode_t mode, 197 198 struct spu_context *ctx) 198 199 { 199 200 struct dentry *dentry, *tmp; ··· 263 264 264 265 static int 265 266 spufs_mkdir(struct inode *dir, struct dentry *dentry, unsigned int flags, 266 - int mode) 267 + umode_t mode) 267 268 { 268 269 int ret; 269 270 struct inode *inode; ··· 446 447 447 448 static int 448 449 spufs_create_context(struct inode *inode, struct dentry *dentry, 449 - struct vfsmount *mnt, int flags, int mode, 450 + struct vfsmount *mnt, int flags, umode_t mode, 450 451 struct file *aff_filp) 451 452 { 452 453 int ret; ··· 520 521 } 521 522 522 523 static int 523 - spufs_mkgang(struct inode *dir, struct dentry *dentry, int mode) 524 + spufs_mkgang(struct inode *dir, struct dentry *dentry, umode_t mode) 524 525 { 525 526 int ret; 526 527 struct inode *inode; ··· 583 584 584 585 static int spufs_create_gang(struct inode *inode, 585 586 struct dentry *dentry, 586 - struct vfsmount *mnt, int mode) 587 + struct vfsmount *mnt, umode_t mode) 587 588 { 588 589 int ret; 589 590 ··· 611 612 static struct file_system_type spufs_type; 612 613 613 614 long spufs_create(struct path *path, struct dentry *dentry, 614 - unsigned int flags, mode_t mode, struct file *filp) 615 + unsigned int flags, umode_t mode, struct file *filp) 615 616 { 616 617 int ret; 617 618
+2 -2
arch/powerpc/platforms/cell/spufs/spufs.h
··· 237 237 struct spufs_tree_descr { 238 238 const char *name; 239 239 const struct file_operations *ops; 240 - int mode; 240 + umode_t mode; 241 241 size_t size; 242 242 }; 243 243 ··· 249 249 extern struct spufs_calls spufs_calls; 250 250 long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status); 251 251 long spufs_create(struct path *nd, struct dentry *dentry, unsigned int flags, 252 - mode_t mode, struct file *filp); 252 + umode_t mode, struct file *filp); 253 253 /* ELF coredump callbacks for writing SPU ELF notes */ 254 254 extern int spufs_coredump_extra_notes_size(void); 255 255 extern int spufs_coredump_extra_notes_write(struct file *file, loff_t *foffset);
+1 -1
arch/powerpc/platforms/cell/spufs/syscalls.c
··· 60 60 } 61 61 62 62 static long do_spu_create(const char __user *pathname, unsigned int flags, 63 - mode_t mode, struct file *neighbor) 63 + umode_t mode, struct file *neighbor) 64 64 { 65 65 struct path path; 66 66 struct dentry *dentry;
-1
arch/powerpc/sysdev/axonram.c
··· 25 25 26 26 #include <linux/bio.h> 27 27 #include <linux/blkdev.h> 28 - #include <linux/buffer_head.h> 29 28 #include <linux/device.h> 30 29 #include <linux/errno.h> 31 30 #include <linux/fs.h>
+7 -7
arch/s390/hypfs/inode.c
··· 97 97 } 98 98 } 99 99 100 - static struct inode *hypfs_make_inode(struct super_block *sb, int mode) 100 + static struct inode *hypfs_make_inode(struct super_block *sb, umode_t mode) 101 101 { 102 102 struct inode *ret = new_inode(sb); 103 103 ··· 107 107 ret->i_uid = hypfs_info->uid; 108 108 ret->i_gid = hypfs_info->gid; 109 109 ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; 110 - if (mode & S_IFDIR) 110 + if (S_ISDIR(mode)) 111 111 set_nlink(ret, 2); 112 112 } 113 113 return ret; ··· 259 259 return 0; 260 260 } 261 261 262 - static int hypfs_show_options(struct seq_file *s, struct vfsmount *mnt) 262 + static int hypfs_show_options(struct seq_file *s, struct dentry *root) 263 263 { 264 - struct hypfs_sb_info *hypfs_info = mnt->mnt_sb->s_fs_info; 264 + struct hypfs_sb_info *hypfs_info = root->d_sb->s_fs_info; 265 265 266 266 seq_printf(s, ",uid=%u", hypfs_info->uid); 267 267 seq_printf(s, ",gid=%u", hypfs_info->gid); ··· 333 333 334 334 static struct dentry *hypfs_create_file(struct super_block *sb, 335 335 struct dentry *parent, const char *name, 336 - char *data, mode_t mode) 336 + char *data, umode_t mode) 337 337 { 338 338 struct dentry *dentry; 339 339 struct inode *inode; ··· 350 350 dentry = ERR_PTR(-ENOMEM); 351 351 goto fail; 352 352 } 353 - if (mode & S_IFREG) { 353 + if (S_ISREG(mode)) { 354 354 inode->i_fop = &hypfs_file_ops; 355 355 if (data) 356 356 inode->i_size = strlen(data); 357 357 else 358 358 inode->i_size = 0; 359 - } else if (mode & S_IFDIR) { 359 + } else if (S_ISDIR(mode)) { 360 360 inode->i_op = &simple_dir_inode_operations; 361 361 inode->i_fop = &simple_dir_operations; 362 362 inc_nlink(parent->d_inode);
+2 -2
arch/s390/include/asm/debug.h
··· 73 73 struct dentry* debugfs_entries[DEBUG_MAX_VIEWS]; 74 74 struct debug_view* views[DEBUG_MAX_VIEWS]; 75 75 char name[DEBUG_MAX_NAME_LEN]; 76 - mode_t mode; 76 + umode_t mode; 77 77 } debug_info_t; 78 78 79 79 typedef int (debug_header_proc_t) (debug_info_t* id, ··· 124 124 int buf_size); 125 125 126 126 debug_info_t *debug_register_mode(const char *name, int pages, int nr_areas, 127 - int buf_size, mode_t mode, uid_t uid, 127 + int buf_size, umode_t mode, uid_t uid, 128 128 gid_t gid); 129 129 130 130 void debug_unregister(debug_info_t* id);
-2
arch/s390/include/asm/types.h
··· 13 13 14 14 #ifndef __ASSEMBLY__ 15 15 16 - typedef unsigned short umode_t; 17 - 18 16 /* A address type so that arithmetic can be done on it & it can be upgraded to 19 17 64 bit when necessary 20 18 */
+4 -4
arch/s390/kernel/debug.c
··· 74 74 static int debug_open(struct inode *inode, struct file *file); 75 75 static int debug_close(struct inode *inode, struct file *file); 76 76 static debug_info_t *debug_info_create(const char *name, int pages_per_area, 77 - int nr_areas, int buf_size, mode_t mode); 77 + int nr_areas, int buf_size, umode_t mode); 78 78 static void debug_info_get(debug_info_t *); 79 79 static void debug_info_put(debug_info_t *); 80 80 static int debug_prolog_level_fn(debug_info_t * id, ··· 330 330 331 331 static debug_info_t* 332 332 debug_info_create(const char *name, int pages_per_area, int nr_areas, 333 - int buf_size, mode_t mode) 333 + int buf_size, umode_t mode) 334 334 { 335 335 debug_info_t* rc; 336 336 ··· 688 688 */ 689 689 690 690 debug_info_t *debug_register_mode(const char *name, int pages_per_area, 691 - int nr_areas, int buf_size, mode_t mode, 691 + int nr_areas, int buf_size, umode_t mode, 692 692 uid_t uid, gid_t gid) 693 693 { 694 694 debug_info_t *rc = NULL; ··· 1090 1090 int rc = 0; 1091 1091 int i; 1092 1092 unsigned long flags; 1093 - mode_t mode; 1093 + umode_t mode; 1094 1094 struct dentry *pde; 1095 1095 1096 1096 if (!id)
-2
arch/sparc/include/asm/posix_types.h
··· 20 20 typedef unsigned int __kernel_gid_t; 21 21 typedef unsigned long __kernel_ino_t; 22 22 typedef unsigned int __kernel_mode_t; 23 - typedef unsigned short __kernel_umode_t; 24 23 typedef unsigned int __kernel_nlink_t; 25 24 typedef int __kernel_daddr_t; 26 25 typedef long __kernel_off_t; ··· 54 55 typedef unsigned short __kernel_gid_t; 55 56 typedef unsigned long __kernel_ino_t; 56 57 typedef unsigned short __kernel_mode_t; 57 - typedef unsigned short __kernel_umode_t; 58 58 typedef short __kernel_nlink_t; 59 59 typedef long __kernel_daddr_t; 60 60 typedef long __kernel_off_t;
-6
arch/sparc/include/asm/types.h
··· 12 12 13 13 #include <asm-generic/int-ll64.h> 14 14 15 - #ifndef __ASSEMBLY__ 16 - 17 - typedef unsigned short umode_t; 18 - 19 - #endif /* __ASSEMBLY__ */ 20 - 21 15 #endif /* defined(__sparc__) */ 22 16 23 17 #endif /* defined(_SPARC_TYPES_H) */
+1 -1
arch/x86/kernel/cpuid.c
··· 177 177 .notifier_call = cpuid_class_cpu_callback, 178 178 }; 179 179 180 - static char *cpuid_devnode(struct device *dev, mode_t *mode) 180 + static char *cpuid_devnode(struct device *dev, umode_t *mode) 181 181 { 182 182 return kasprintf(GFP_KERNEL, "cpu/%u/cpuid", MINOR(dev->devt)); 183 183 }
+1 -1
arch/x86/kernel/msr.c
··· 236 236 .notifier_call = msr_class_cpu_callback, 237 237 }; 238 238 239 - static char *msr_devnode(struct device *dev, mode_t *mode) 239 + static char *msr_devnode(struct device *dev, umode_t *mode) 240 240 { 241 241 return kasprintf(GFP_KERNEL, "cpu/%u/msr", MINOR(dev->devt)); 242 242 }
+1 -1
arch/x86/xen/debugfs.c
··· 109 109 .llseek = no_llseek, 110 110 }; 111 111 112 - struct dentry *xen_debugfs_create_u32_array(const char *name, mode_t mode, 112 + struct dentry *xen_debugfs_create_u32_array(const char *name, umode_t mode, 113 113 struct dentry *parent, 114 114 u32 *array, unsigned elements) 115 115 {
+1 -1
arch/x86/xen/debugfs.h
··· 3 3 4 4 struct dentry * __init xen_init_debugfs(void); 5 5 6 - struct dentry *xen_debugfs_create_u32_array(const char *name, mode_t mode, 6 + struct dentry *xen_debugfs_create_u32_array(const char *name, umode_t mode, 7 7 struct dentry *parent, 8 8 u32 *array, unsigned elements); 9 9
-2
arch/xtensa/include/asm/types.h
··· 23 23 24 24 #ifndef __ASSEMBLY__ 25 25 26 - typedef unsigned short umode_t; 27 - 28 26 /* 29 27 * These aren't exported outside the kernel to avoid name space clashes 30 28 */
+6
block/Kconfig
··· 99 99 100 100 See Documentation/cgroups/blkio-controller.txt for more information. 101 101 102 + menu "Partition Types" 103 + 104 + source "block/partitions/Kconfig" 105 + 106 + endmenu 107 + 102 108 endif # BLOCK 103 109 104 110 config BLOCK_COMPAT
+2 -1
block/Makefile
··· 5 5 obj-$(CONFIG_BLOCK) := elevator.o blk-core.o blk-tag.o blk-sysfs.o \ 6 6 blk-flush.o blk-settings.o blk-ioc.o blk-map.o \ 7 7 blk-exec.o blk-merge.o blk-softirq.o blk-timeout.o \ 8 - blk-iopoll.o blk-lib.o ioctl.o genhd.o scsi_ioctl.o 8 + blk-iopoll.o blk-lib.o ioctl.o genhd.o scsi_ioctl.o \ 9 + partition-generic.o partitions/ 9 10 10 11 obj-$(CONFIG_BLK_DEV_BSG) += bsg.o 11 12 obj-$(CONFIG_BLK_DEV_BSGLIB) += bsg-lib.o
+1 -1
block/bsg.c
··· 1070 1070 1071 1071 static struct cdev bsg_cdev; 1072 1072 1073 - static char *bsg_devnode(struct device *dev, mode_t *mode) 1073 + static char *bsg_devnode(struct device *dev, umode_t *mode) 1074 1074 { 1075 1075 return kasprintf(GFP_KERNEL, "bsg/%s", dev_name(dev)); 1076 1076 }
+2 -3
block/genhd.c
··· 15 15 #include <linux/slab.h> 16 16 #include <linux/kmod.h> 17 17 #include <linux/kobj_map.h> 18 - #include <linux/buffer_head.h> 19 18 #include <linux/mutex.h> 20 19 #include <linux/idr.h> 21 20 #include <linux/log2.h> ··· 506 507 return 0; 507 508 } 508 509 509 - void register_disk(struct gendisk *disk) 510 + static void register_disk(struct gendisk *disk) 510 511 { 511 512 struct device *ddev = disk_to_dev(disk); 512 513 struct block_device *bdev; ··· 1108 1109 .name = "block", 1109 1110 }; 1110 1111 1111 - static char *block_devnode(struct device *dev, mode_t *mode) 1112 + static char *block_devnode(struct device *dev, umode_t *mode) 1112 1113 { 1113 1114 struct gendisk *disk = dev_to_disk(dev); 1114 1115
+1 -1
block/ioctl.c
··· 5 5 #include <linux/blkpg.h> 6 6 #include <linux/hdreg.h> 7 7 #include <linux/backing-dev.h> 8 - #include <linux/buffer_head.h> 8 + #include <linux/fs.h> 9 9 #include <linux/blktrace_api.h> 10 10 #include <asm/uaccess.h> 11 11
+166
block/partitions/check.c
··· 1 + /* 2 + * fs/partitions/check.c 3 + * 4 + * Code extracted from drivers/block/genhd.c 5 + * Copyright (C) 1991-1998 Linus Torvalds 6 + * Re-organised Feb 1998 Russell King 7 + * 8 + * We now have independent partition support from the 9 + * block drivers, which allows all the partition code to 10 + * be grouped in one location, and it to be mostly self 11 + * contained. 12 + * 13 + * Added needed MAJORS for new pairs, {hdi,hdj}, {hdk,hdl} 14 + */ 15 + 16 + #include <linux/slab.h> 17 + #include <linux/ctype.h> 18 + #include <linux/genhd.h> 19 + 20 + #include "check.h" 21 + 22 + #include "acorn.h" 23 + #include "amiga.h" 24 + #include "atari.h" 25 + #include "ldm.h" 26 + #include "mac.h" 27 + #include "msdos.h" 28 + #include "osf.h" 29 + #include "sgi.h" 30 + #include "sun.h" 31 + #include "ibm.h" 32 + #include "ultrix.h" 33 + #include "efi.h" 34 + #include "karma.h" 35 + #include "sysv68.h" 36 + 37 + int warn_no_part = 1; /*This is ugly: should make genhd removable media aware*/ 38 + 39 + static int (*check_part[])(struct parsed_partitions *) = { 40 + /* 41 + * Probe partition formats with tables at disk address 0 42 + * that also have an ADFS boot block at 0xdc0. 43 + */ 44 + #ifdef CONFIG_ACORN_PARTITION_ICS 45 + adfspart_check_ICS, 46 + #endif 47 + #ifdef CONFIG_ACORN_PARTITION_POWERTEC 48 + adfspart_check_POWERTEC, 49 + #endif 50 + #ifdef CONFIG_ACORN_PARTITION_EESOX 51 + adfspart_check_EESOX, 52 + #endif 53 + 54 + /* 55 + * Now move on to formats that only have partition info at 56 + * disk address 0xdc0. Since these may also have stale 57 + * PC/BIOS partition tables, they need to come before 58 + * the msdos entry. 59 + */ 60 + #ifdef CONFIG_ACORN_PARTITION_CUMANA 61 + adfspart_check_CUMANA, 62 + #endif 63 + #ifdef CONFIG_ACORN_PARTITION_ADFS 64 + adfspart_check_ADFS, 65 + #endif 66 + 67 + #ifdef CONFIG_EFI_PARTITION 68 + efi_partition, /* this must come before msdos */ 69 + #endif 70 + #ifdef CONFIG_SGI_PARTITION 71 + sgi_partition, 72 + #endif 73 + #ifdef CONFIG_LDM_PARTITION 74 + ldm_partition, /* this must come before msdos */ 75 + #endif 76 + #ifdef CONFIG_MSDOS_PARTITION 77 + msdos_partition, 78 + #endif 79 + #ifdef CONFIG_OSF_PARTITION 80 + osf_partition, 81 + #endif 82 + #ifdef CONFIG_SUN_PARTITION 83 + sun_partition, 84 + #endif 85 + #ifdef CONFIG_AMIGA_PARTITION 86 + amiga_partition, 87 + #endif 88 + #ifdef CONFIG_ATARI_PARTITION 89 + atari_partition, 90 + #endif 91 + #ifdef CONFIG_MAC_PARTITION 92 + mac_partition, 93 + #endif 94 + #ifdef CONFIG_ULTRIX_PARTITION 95 + ultrix_partition, 96 + #endif 97 + #ifdef CONFIG_IBM_PARTITION 98 + ibm_partition, 99 + #endif 100 + #ifdef CONFIG_KARMA_PARTITION 101 + karma_partition, 102 + #endif 103 + #ifdef CONFIG_SYSV68_PARTITION 104 + sysv68_partition, 105 + #endif 106 + NULL 107 + }; 108 + 109 + struct parsed_partitions * 110 + check_partition(struct gendisk *hd, struct block_device *bdev) 111 + { 112 + struct parsed_partitions *state; 113 + int i, res, err; 114 + 115 + state = kzalloc(sizeof(struct parsed_partitions), GFP_KERNEL); 116 + if (!state) 117 + return NULL; 118 + state->pp_buf = (char *)__get_free_page(GFP_KERNEL); 119 + if (!state->pp_buf) { 120 + kfree(state); 121 + return NULL; 122 + } 123 + state->pp_buf[0] = '\0'; 124 + 125 + state->bdev = bdev; 126 + disk_name(hd, 0, state->name); 127 + snprintf(state->pp_buf, PAGE_SIZE, " %s:", state->name); 128 + if (isdigit(state->name[strlen(state->name)-1])) 129 + sprintf(state->name, "p"); 130 + 131 + state->limit = disk_max_parts(hd); 132 + i = res = err = 0; 133 + while (!res && check_part[i]) { 134 + memset(&state->parts, 0, sizeof(state->parts)); 135 + res = check_part[i++](state); 136 + if (res < 0) { 137 + /* We have hit an I/O error which we don't report now. 138 + * But record it, and let the others do their job. 139 + */ 140 + err = res; 141 + res = 0; 142 + } 143 + 144 + } 145 + if (res > 0) { 146 + printk(KERN_INFO "%s", state->pp_buf); 147 + 148 + free_page((unsigned long)state->pp_buf); 149 + return state; 150 + } 151 + if (state->access_beyond_eod) 152 + err = -ENOSPC; 153 + if (err) 154 + /* The partition is unrecognized. So report I/O errors if there were any */ 155 + res = err; 156 + if (!res) 157 + strlcat(state->pp_buf, " unknown partition table\n", PAGE_SIZE); 158 + else if (warn_no_part) 159 + strlcat(state->pp_buf, " unable to read partition table\n", PAGE_SIZE); 160 + 161 + printk(KERN_INFO "%s", state->pp_buf); 162 + 163 + free_page((unsigned long)state->pp_buf); 164 + kfree(state); 165 + return ERR_PTR(res); 166 + }
+1 -1
drivers/acpi/battery.c
··· 873 873 874 874 static const struct battery_file { 875 875 struct file_operations ops; 876 - mode_t mode; 876 + umode_t mode; 877 877 const char *name; 878 878 } acpi_battery_file[] = { 879 879 FILE_DESCRIPTION_RO(info),
+1 -1
drivers/acpi/ec_sys.c
··· 105 105 { 106 106 struct dentry *dev_dir; 107 107 char name[64]; 108 - mode_t mode = 0400; 108 + umode_t mode = 0400; 109 109 110 110 if (ec_device_count == 0) { 111 111 acpi_ec_debugfs_dir = debugfs_create_dir("ec", NULL);
+2 -2
drivers/base/core.c
··· 248 248 if (MAJOR(dev->devt)) { 249 249 const char *tmp; 250 250 const char *name; 251 - mode_t mode = 0; 251 + umode_t mode = 0; 252 252 253 253 add_uevent_var(env, "MAJOR=%u", MAJOR(dev->devt)); 254 254 add_uevent_var(env, "MINOR=%u", MINOR(dev->devt)); ··· 1235 1235 * freed by the caller. 1236 1236 */ 1237 1237 const char *device_get_devnode(struct device *dev, 1238 - mode_t *mode, const char **tmp) 1238 + umode_t *mode, const char **tmp) 1239 1239 { 1240 1240 char *s; 1241 1241
+4 -4
drivers/base/devtmpfs.c
··· 40 40 struct completion done; 41 41 int err; 42 42 const char *name; 43 - mode_t mode; /* 0 => delete */ 43 + umode_t mode; /* 0 => delete */ 44 44 struct device *dev; 45 45 } *requests; 46 46 ··· 142 142 return req.err; 143 143 } 144 144 145 - static int dev_mkdir(const char *name, mode_t mode) 145 + static int dev_mkdir(const char *name, umode_t mode) 146 146 { 147 147 struct dentry *dentry; 148 148 struct path path; ··· 189 189 return err; 190 190 } 191 191 192 - static int handle_create(const char *nodename, mode_t mode, struct device *dev) 192 + static int handle_create(const char *nodename, umode_t mode, struct device *dev) 193 193 { 194 194 struct dentry *dentry; 195 195 struct path path; ··· 378 378 379 379 static DECLARE_COMPLETION(setup_done); 380 380 381 - static int handle(const char *name, mode_t mode, struct device *dev) 381 + static int handle(const char *name, umode_t mode, struct device *dev) 382 382 { 383 383 if (mode) 384 384 return handle_create(name, mode, dev);
+1 -1
drivers/block/amiflop.c
··· 63 63 #include <linux/mutex.h> 64 64 #include <linux/amifdreg.h> 65 65 #include <linux/amifd.h> 66 - #include <linux/buffer_head.h> 66 + #include <linux/fs.h> 67 67 #include <linux/blkdev.h> 68 68 #include <linux/elevator.h> 69 69 #include <linux/interrupt.h>
+1 -1
drivers/block/aoe/aoechr.c
··· 270 270 .llseek = noop_llseek, 271 271 }; 272 272 273 - static char *aoe_devnode(struct device *dev, mode_t *mode) 273 + static char *aoe_devnode(struct device *dev, umode_t *mode) 274 274 { 275 275 return kasprintf(GFP_KERNEL, "etherd/%s", dev_name(dev)); 276 276 }
+4 -5
drivers/block/brd.c
··· 17 17 #include <linux/highmem.h> 18 18 #include <linux/mutex.h> 19 19 #include <linux/radix-tree.h> 20 - #include <linux/buffer_head.h> /* invalidate_bh_lrus() */ 20 + #include <linux/fs.h> 21 21 #include <linux/slab.h> 22 22 23 23 #include <asm/uaccess.h> ··· 402 402 error = -EBUSY; 403 403 if (bdev->bd_openers <= 1) { 404 404 /* 405 - * Invalidate the cache first, so it isn't written 406 - * back to the device. 405 + * Kill the cache first, so it isn't written back to the 406 + * device. 407 407 * 408 408 * Another thread might instantiate more buffercache here, 409 409 * but there is not much we can do to close that race. 410 410 */ 411 - invalidate_bh_lrus(); 412 - truncate_inode_pages(bdev->bd_inode->i_mapping, 0); 411 + kill_bdev(bdev); 413 412 brd_free_pages(brd); 414 413 error = 0; 415 414 }
-1
drivers/block/floppy.c
··· 188 188 #include <linux/init.h> 189 189 #include <linux/platform_device.h> 190 190 #include <linux/mod_devicetable.h> 191 - #include <linux/buffer_head.h> /* for invalidate_buffers() */ 192 191 #include <linux/mutex.h> 193 192 #include <linux/io.h> 194 193 #include <linux/uaccess.h>
-1
drivers/block/loop.c
··· 69 69 #include <linux/freezer.h> 70 70 #include <linux/mutex.h> 71 71 #include <linux/writeback.h> 72 - #include <linux/buffer_head.h> /* for invalidate_bdev() */ 73 72 #include <linux/completion.h> 74 73 #include <linux/highmem.h> 75 74 #include <linux/kthread.h>
+1 -1
drivers/block/pktcdvd.c
··· 2817 2817 .check_events = pkt_check_events, 2818 2818 }; 2819 2819 2820 - static char *pktcdvd_devnode(struct gendisk *gd, mode_t *mode) 2820 + static char *pktcdvd_devnode(struct gendisk *gd, umode_t *mode) 2821 2821 { 2822 2822 return kasprintf(GFP_KERNEL, "pktcdvd/%s", gd->disk_name); 2823 2823 }
-1
drivers/cdrom/cdrom.c
··· 267 267 268 268 #include <linux/module.h> 269 269 #include <linux/fs.h> 270 - #include <linux/buffer_head.h> 271 270 #include <linux/major.h> 272 271 #include <linux/types.h> 273 272 #include <linux/errno.h>
+2 -2
drivers/char/mem.c
··· 847 847 848 848 static const struct memdev { 849 849 const char *name; 850 - mode_t mode; 850 + umode_t mode; 851 851 const struct file_operations *fops; 852 852 struct backing_dev_info *dev_info; 853 853 } devlist[] = { ··· 901 901 .llseek = noop_llseek, 902 902 }; 903 903 904 - static char *mem_devnode(struct device *dev, mode_t *mode) 904 + static char *mem_devnode(struct device *dev, umode_t *mode) 905 905 { 906 906 if (mode && devlist[MINOR(dev->devt)].mode) 907 907 *mode = devlist[MINOR(dev->devt)].mode;
+1 -1
drivers/char/misc.c
··· 258 258 EXPORT_SYMBOL(misc_register); 259 259 EXPORT_SYMBOL(misc_deregister); 260 260 261 - static char *misc_devnode(struct device *dev, mode_t *mode) 261 + static char *misc_devnode(struct device *dev, umode_t *mode) 262 262 { 263 263 struct miscdevice *c = dev_get_drvdata(dev); 264 264
+1 -1
drivers/char/raw.c
··· 308 308 309 309 static struct cdev raw_cdev; 310 310 311 - static char *raw_devnode(struct device *dev, mode_t *mode) 311 + static char *raw_devnode(struct device *dev, umode_t *mode) 312 312 { 313 313 return kasprintf(GFP_KERNEL, "raw/%s", dev_name(dev)); 314 314 }
+1 -1
drivers/char/tile-srom.c
··· 329 329 __ATTR_NULL 330 330 }; 331 331 332 - static char *srom_devnode(struct device *dev, mode_t *mode) 332 + static char *srom_devnode(struct device *dev, umode_t *mode) 333 333 { 334 334 *mode = S_IRUGO | S_IWUSR; 335 335 return kasprintf(GFP_KERNEL, "srom/%s", dev_name(dev));
+6 -6
drivers/firmware/iscsi_ibft.c
··· 433 433 * Helper routiners to check to determine if the entry is valid 434 434 * in the proper iBFT structure. 435 435 */ 436 - static mode_t ibft_check_nic_for(void *data, int type) 436 + static umode_t ibft_check_nic_for(void *data, int type) 437 437 { 438 438 struct ibft_kobject *entry = data; 439 439 struct ibft_nic *nic = entry->nic; 440 - mode_t rc = 0; 440 + umode_t rc = 0; 441 441 442 442 switch (type) { 443 443 case ISCSI_BOOT_ETH_INDEX: ··· 488 488 return rc; 489 489 } 490 490 491 - static mode_t __init ibft_check_tgt_for(void *data, int type) 491 + static umode_t __init ibft_check_tgt_for(void *data, int type) 492 492 { 493 493 struct ibft_kobject *entry = data; 494 494 struct ibft_tgt *tgt = entry->tgt; 495 - mode_t rc = 0; 495 + umode_t rc = 0; 496 496 497 497 switch (type) { 498 498 case ISCSI_BOOT_TGT_INDEX: ··· 524 524 return rc; 525 525 } 526 526 527 - static mode_t __init ibft_check_initiator_for(void *data, int type) 527 + static umode_t __init ibft_check_initiator_for(void *data, int type) 528 528 { 529 529 struct ibft_kobject *entry = data; 530 530 struct ibft_initiator *init = entry->initiator; 531 - mode_t rc = 0; 531 + umode_t rc = 0; 532 532 533 533 switch (type) { 534 534 case ISCSI_BOOT_INI_INDEX:
+1 -1
drivers/gpu/drm/drm_sysfs.c
··· 72 72 return 0; 73 73 } 74 74 75 - static char *drm_devnode(struct device *dev, mode_t *mode) 75 + static char *drm_devnode(struct device *dev, umode_t *mode) 76 76 { 77 77 return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev)); 78 78 }
+1 -1
drivers/hid/usbhid/hiddev.c
··· 859 859 .llseek = noop_llseek, 860 860 }; 861 861 862 - static char *hiddev_devnode(struct device *dev, mode_t *mode) 862 + static char *hiddev_devnode(struct device *dev, umode_t *mode) 863 863 { 864 864 return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); 865 865 }
+3 -3
drivers/hwmon/dme1737.c
··· 1223 1223 } 1224 1224 1225 1225 static struct attribute *dme1737_pwm_chmod_attr[]; 1226 - static void dme1737_chmod_file(struct device*, struct attribute*, mode_t); 1226 + static void dme1737_chmod_file(struct device*, struct attribute*, umode_t); 1227 1227 1228 1228 static ssize_t set_pwm(struct device *dev, struct device_attribute *attr, 1229 1229 const char *buf, size_t count) ··· 1961 1961 static int dme1737_i2c_get_features(int, struct dme1737_data*); 1962 1962 1963 1963 static void dme1737_chmod_file(struct device *dev, 1964 - struct attribute *attr, mode_t mode) 1964 + struct attribute *attr, umode_t mode) 1965 1965 { 1966 1966 if (sysfs_chmod_file(&dev->kobj, attr, mode)) { 1967 1967 dev_warn(dev, "Failed to change permissions of %s.\n", ··· 1971 1971 1972 1972 static void dme1737_chmod_group(struct device *dev, 1973 1973 const struct attribute_group *group, 1974 - mode_t mode) 1974 + umode_t mode) 1975 1975 { 1976 1976 struct attribute **attr; 1977 1977
+1 -1
drivers/hwmon/jc42.c
··· 413 413 NULL 414 414 }; 415 415 416 - static mode_t jc42_attribute_mode(struct kobject *kobj, 416 + static umode_t jc42_attribute_mode(struct kobject *kobj, 417 417 struct attribute *attr, int index) 418 418 { 419 419 struct device *dev = container_of(kobj, struct device, kobj);
+2 -2
drivers/hwmon/max1668.c
··· 335 335 NULL 336 336 }; 337 337 338 - static mode_t max1668_attribute_mode(struct kobject *kobj, 338 + static umode_t max1668_attribute_mode(struct kobject *kobj, 339 339 struct attribute *attr, int index) 340 340 { 341 - int ret = S_IRUGO; 341 + umode_t ret = S_IRUGO; 342 342 if (read_only) 343 343 return ret; 344 344 if (attr == &sensor_dev_attr_temp1_max.dev_attr.attr ||
+1 -1
drivers/hwmon/max6650.c
··· 464 464 static SENSOR_DEVICE_ATTR(gpio2_alarm, S_IRUGO, get_alarm, NULL, 465 465 MAX6650_ALRM_GPIO2); 466 466 467 - static mode_t max6650_attrs_visible(struct kobject *kobj, struct attribute *a, 467 + static umode_t max6650_attrs_visible(struct kobject *kobj, struct attribute *a, 468 468 int n) 469 469 { 470 470 struct device *dev = container_of(kobj, struct device, kobj);
+1 -1
drivers/hwmon/tmp421.c
··· 157 157 return sprintf(buf, "0\n"); 158 158 } 159 159 160 - static mode_t tmp421_is_visible(struct kobject *kobj, struct attribute *a, 160 + static umode_t tmp421_is_visible(struct kobject *kobj, struct attribute *a, 161 161 int n) 162 162 { 163 163 struct device *dev = container_of(kobj, struct device, kobj);
+1 -1
drivers/infiniband/core/cm.c
··· 3659 3659 .release = cm_release_port_obj 3660 3660 }; 3661 3661 3662 - static char *cm_devnode(struct device *dev, mode_t *mode) 3662 + static char *cm_devnode(struct device *dev, umode_t *mode) 3663 3663 { 3664 3664 if (mode) 3665 3665 *mode = 0666;
+1 -1
drivers/infiniband/core/user_mad.c
··· 1175 1175 kref_put(&umad_dev->ref, ib_umad_release_dev); 1176 1176 } 1177 1177 1178 - static char *umad_devnode(struct device *dev, mode_t *mode) 1178 + static char *umad_devnode(struct device *dev, umode_t *mode) 1179 1179 { 1180 1180 return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev)); 1181 1181 }
+1 -1
drivers/infiniband/core/uverbs_main.c
··· 846 846 kfree(uverbs_dev); 847 847 } 848 848 849 - static char *uverbs_devnode(struct device *dev, mode_t *mode) 849 + static char *uverbs_devnode(struct device *dev, umode_t *mode) 850 850 { 851 851 if (mode) 852 852 *mode = 0666;
+3 -3
drivers/infiniband/hw/ipath/ipath_fs.c
··· 46 46 static struct super_block *ipath_super; 47 47 48 48 static int ipathfs_mknod(struct inode *dir, struct dentry *dentry, 49 - int mode, const struct file_operations *fops, 49 + umode_t mode, const struct file_operations *fops, 50 50 void *data) 51 51 { 52 52 int error; ··· 61 61 inode->i_mode = mode; 62 62 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 63 63 inode->i_private = data; 64 - if ((mode & S_IFMT) == S_IFDIR) { 64 + if (S_ISDIR(mode)) { 65 65 inode->i_op = &simple_dir_inode_operations; 66 66 inc_nlink(inode); 67 67 inc_nlink(dir); ··· 76 76 return error; 77 77 } 78 78 79 - static int create_file(const char *name, mode_t mode, 79 + static int create_file(const char *name, umode_t mode, 80 80 struct dentry *parent, struct dentry **dentry, 81 81 const struct file_operations *fops, void *data) 82 82 {
+3 -3
drivers/infiniband/hw/qib/qib_fs.c
··· 47 47 #define private2dd(file) ((file)->f_dentry->d_inode->i_private) 48 48 49 49 static int qibfs_mknod(struct inode *dir, struct dentry *dentry, 50 - int mode, const struct file_operations *fops, 50 + umode_t mode, const struct file_operations *fops, 51 51 void *data) 52 52 { 53 53 int error; ··· 67 67 inode->i_mtime = inode->i_atime; 68 68 inode->i_ctime = inode->i_atime; 69 69 inode->i_private = data; 70 - if ((mode & S_IFMT) == S_IFDIR) { 70 + if (S_ISDIR(mode)) { 71 71 inode->i_op = &simple_dir_inode_operations; 72 72 inc_nlink(inode); 73 73 inc_nlink(dir); ··· 82 82 return error; 83 83 } 84 84 85 - static int create_file(const char *name, mode_t mode, 85 + static int create_file(const char *name, umode_t mode, 86 86 struct dentry *parent, struct dentry **dentry, 87 87 const struct file_operations *fops, void *data) 88 88 {
+1 -1
drivers/infiniband/ulp/iser/iscsi_iser.c
··· 638 638 iser_conn_terminate(ib_conn); 639 639 } 640 640 641 - static mode_t iser_attr_is_visible(int param_type, int param) 641 + static umode_t iser_attr_is_visible(int param_type, int param) 642 642 { 643 643 switch (param_type) { 644 644 case ISCSI_HOST_PARAM:
+1 -1
drivers/input/input.c
··· 1624 1624 #endif 1625 1625 }; 1626 1626 1627 - static char *input_devnode(struct device *dev, mode_t *mode) 1627 + static char *input_devnode(struct device *dev, umode_t *mode) 1628 1628 { 1629 1629 return kasprintf(GFP_KERNEL, "input/%s", dev_name(dev)); 1630 1630 }
+2 -2
drivers/input/touchscreen/ad7877.c
··· 612 612 NULL 613 613 }; 614 614 615 - static mode_t ad7877_attr_is_visible(struct kobject *kobj, 615 + static umode_t ad7877_attr_is_visible(struct kobject *kobj, 616 616 struct attribute *attr, int n) 617 617 { 618 - mode_t mode = attr->mode; 618 + umode_t mode = attr->mode; 619 619 620 620 if (attr == &dev_attr_aux3.attr) { 621 621 if (gpio3)
+2 -2
drivers/input/touchscreen/tsc2005.c
··· 450 450 NULL 451 451 }; 452 452 453 - static mode_t tsc2005_attr_is_visible(struct kobject *kobj, 453 + static umode_t tsc2005_attr_is_visible(struct kobject *kobj, 454 454 struct attribute *attr, int n) 455 455 { 456 456 struct device *dev = container_of(kobj, struct device, kobj); 457 457 struct spi_device *spi = to_spi_device(dev); 458 458 struct tsc2005 *ts = spi_get_drvdata(spi); 459 - mode_t mode = attr->mode; 459 + umode_t mode = attr->mode; 460 460 461 461 if (attr == &dev_attr_selftest.attr) { 462 462 if (!ts->set_reset)
-1
drivers/md/dm.c
··· 14 14 #include <linux/moduleparam.h> 15 15 #include <linux/blkpg.h> 16 16 #include <linux/bio.h> 17 - #include <linux/buffer_head.h> 18 17 #include <linux/mempool.h> 19 18 #include <linux/slab.h> 20 19 #include <linux/idr.h>
+1 -2
drivers/md/md.c
··· 36 36 #include <linux/blkdev.h> 37 37 #include <linux/sysctl.h> 38 38 #include <linux/seq_file.h> 39 - #include <linux/mutex.h> 40 - #include <linux/buffer_head.h> /* for invalidate_bdev */ 39 + #include <linux/fs.h> 41 40 #include <linux/poll.h> 42 41 #include <linux/ctype.h> 43 42 #include <linux/string.h>
+1 -1
drivers/media/dvb/ddbridge/ddbridge-core.c
··· 1480 1480 .open = ddb_open, 1481 1481 }; 1482 1482 1483 - static char *ddb_devnode(struct device *device, mode_t *mode) 1483 + static char *ddb_devnode(struct device *device, umode_t *mode) 1484 1484 { 1485 1485 struct ddb *dev = dev_get_drvdata(device); 1486 1486
+1 -1
drivers/media/dvb/dvb-core/dvbdev.c
··· 450 450 return 0; 451 451 } 452 452 453 - static char *dvb_devnode(struct device *dev, mode_t *mode) 453 + static char *dvb_devnode(struct device *dev, umode_t *mode) 454 454 { 455 455 struct dvb_device *dvbdev = dev_get_drvdata(dev); 456 456
+1 -1
drivers/media/rc/rc-main.c
··· 715 715 } 716 716 717 717 /* class for /sys/class/rc */ 718 - static char *ir_devnode(struct device *dev, mode_t *mode) 718 + static char *ir_devnode(struct device *dev, umode_t *mode) 719 719 { 720 720 return kasprintf(GFP_KERNEL, "rc/%s", dev_name(dev)); 721 721 }
+1 -1
drivers/message/i2o/i2o_proc.c
··· 56 56 /* Structure used to define /proc entries */ 57 57 typedef struct _i2o_proc_entry_t { 58 58 char *name; /* entry name */ 59 - mode_t mode; /* mode */ 59 + umode_t mode; /* mode */ 60 60 const struct file_operations *fops; /* open function */ 61 61 } i2o_proc_entry; 62 62
+1 -1
drivers/misc/sgi-gru/gruprocfs.c
··· 324 324 325 325 static struct proc_entry { 326 326 char *name; 327 - int mode; 327 + umode_t mode; 328 328 const struct file_operations *fops; 329 329 struct proc_dir_entry *entry; 330 330 } proc_files[] = {
+1 -1
drivers/mmc/card/mmc_test.c
··· 2949 2949 } 2950 2950 2951 2951 static int __mmc_test_register_dbgfs_file(struct mmc_card *card, 2952 - const char *name, mode_t mode, const struct file_operations *fops) 2952 + const char *name, umode_t mode, const struct file_operations *fops) 2953 2953 { 2954 2954 struct dentry *file = NULL; 2955 2955 struct mmc_test_dbgfs_file *df;
-1
drivers/mtd/devices/block2mtd.c
··· 14 14 #include <linux/list.h> 15 15 #include <linux/init.h> 16 16 #include <linux/mtd/mtd.h> 17 - #include <linux/buffer_head.h> 18 17 #include <linux/mutex.h> 19 18 #include <linux/mount.h> 20 19 #include <linux/slab.h>
+1 -1
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
··· 2003 2003 */ 2004 2004 struct cxgb4vf_debugfs_entry { 2005 2005 const char *name; /* name of debugfs node */ 2006 - mode_t mode; /* file system mode */ 2006 + umode_t mode; /* file system mode */ 2007 2007 const struct file_operations *fops; 2008 2008 }; 2009 2009
+1 -1
drivers/net/wireless/ath/carl9170/debug.c
··· 56 56 57 57 struct carl9170_debugfs_fops { 58 58 unsigned int read_bufsize; 59 - mode_t attr; 59 + umode_t attr; 60 60 char *(*read)(struct ar9170 *ar, char *buf, size_t bufsize, 61 61 ssize_t *len); 62 62 ssize_t (*write)(struct ar9170 *aru, const char *buf, size_t size);
+1 -1
drivers/net/wireless/libertas/debugfs.c
··· 704 704 705 705 struct lbs_debugfs_files { 706 706 const char *name; 707 - int perm; 707 + umode_t perm; 708 708 struct file_operations fops; 709 709 }; 710 710
+2 -2
drivers/pci/pci-label.c
··· 89 89 return 0; 90 90 } 91 91 92 - static mode_t 92 + static umode_t 93 93 smbios_instance_string_exist(struct kobject *kobj, struct attribute *attr, 94 94 int n) 95 95 { ··· 275 275 return FALSE; 276 276 } 277 277 278 - static mode_t 278 + static umode_t 279 279 acpi_index_string_exist(struct kobject *kobj, struct attribute *attr, int n) 280 280 { 281 281 struct device *dev;
+1 -1
drivers/platform/x86/asus-laptop.c
··· 1477 1477 NULL 1478 1478 }; 1479 1479 1480 - static mode_t asus_sysfs_is_visible(struct kobject *kobj, 1480 + static umode_t asus_sysfs_is_visible(struct kobject *kobj, 1481 1481 struct attribute *attr, 1482 1482 int idx) 1483 1483 {
+2 -2
drivers/platform/x86/asus-wmi.c
··· 992 992 NULL 993 993 }; 994 994 995 - static mode_t asus_hwmon_sysfs_is_visible(struct kobject *kobj, 995 + static umode_t asus_hwmon_sysfs_is_visible(struct kobject *kobj, 996 996 struct attribute *attr, int idx) 997 997 { 998 998 struct device *dev = container_of(kobj, struct device, kobj); ··· 1357 1357 NULL 1358 1358 }; 1359 1359 1360 - static mode_t asus_sysfs_is_visible(struct kobject *kobj, 1360 + static umode_t asus_sysfs_is_visible(struct kobject *kobj, 1361 1361 struct attribute *attr, int idx) 1362 1362 { 1363 1363 struct device *dev = container_of(kobj, struct device, kobj);
+2 -2
drivers/platform/x86/asus_acpi.c
··· 1053 1053 }; 1054 1054 1055 1055 static int 1056 - asus_proc_add(char *name, const struct file_operations *proc_fops, mode_t mode, 1056 + asus_proc_add(char *name, const struct file_operations *proc_fops, umode_t mode, 1057 1057 struct acpi_device *device) 1058 1058 { 1059 1059 struct proc_dir_entry *proc; ··· 1072 1072 static int asus_hotk_add_fs(struct acpi_device *device) 1073 1073 { 1074 1074 struct proc_dir_entry *proc; 1075 - mode_t mode; 1075 + umode_t mode; 1076 1076 1077 1077 if ((asus_uid == 0) && (asus_gid == 0)) { 1078 1078 mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP;
+1 -1
drivers/platform/x86/ideapad-laptop.c
··· 368 368 NULL 369 369 }; 370 370 371 - static mode_t ideapad_is_visible(struct kobject *kobj, 371 + static umode_t ideapad_is_visible(struct kobject *kobj, 372 372 struct attribute *attr, 373 373 int idx) 374 374 {
+1 -1
drivers/platform/x86/intel_menlow.c
··· 389 389 return sprintf(buf, "%s\n", bios_enabled ? "enabled" : "disabled"); 390 390 } 391 391 392 - static int intel_menlow_add_one_attribute(char *name, int mode, void *show, 392 + static int intel_menlow_add_one_attribute(char *name, umode_t mode, void *show, 393 393 void *store, struct device *dev, 394 394 acpi_handle handle) 395 395 {
+2 -2
drivers/platform/x86/thinkpad_acpi.c
··· 297 297 char param[32]; 298 298 299 299 int (*init) (struct ibm_init_struct *); 300 - mode_t base_procfs_mode; 300 + umode_t base_procfs_mode; 301 301 struct ibm_struct *data; 302 302 }; 303 303 ··· 8542 8542 "%s installed\n", ibm->name); 8543 8543 8544 8544 if (ibm->read) { 8545 - mode_t mode = iibm->base_procfs_mode; 8545 + umode_t mode = iibm->base_procfs_mode; 8546 8546 8547 8547 if (!mode) 8548 8548 mode = S_IRUGO;
+2 -2
drivers/power/power_supply_sysfs.c
··· 176 176 static struct attribute * 177 177 __power_supply_attrs[ARRAY_SIZE(power_supply_attrs) + 1]; 178 178 179 - static mode_t power_supply_attr_is_visible(struct kobject *kobj, 179 + static umode_t power_supply_attr_is_visible(struct kobject *kobj, 180 180 struct attribute *attr, 181 181 int attrno) 182 182 { 183 183 struct device *dev = container_of(kobj, struct device, kobj); 184 184 struct power_supply *psy = dev_get_drvdata(dev); 185 - mode_t mode = S_IRUSR | S_IRGRP | S_IROTH; 185 + umode_t mode = S_IRUSR | S_IRGRP | S_IROTH; 186 186 int i; 187 187 188 188 if (attrno == POWER_SUPPLY_PROP_TYPE)
+2 -3
drivers/s390/block/dasd.c
··· 17 17 #include <linux/ctype.h> 18 18 #include <linux/major.h> 19 19 #include <linux/slab.h> 20 - #include <linux/buffer_head.h> 21 20 #include <linux/hdreg.h> 22 21 #include <linux/async.h> 23 22 #include <linux/mutex.h> ··· 1072 1073 static void dasd_profile_init(struct dasd_profile *profile, 1073 1074 struct dentry *base_dentry) 1074 1075 { 1075 - mode_t mode; 1076 + umode_t mode; 1076 1077 struct dentry *pde; 1077 1078 1078 1079 if (!base_dentry) ··· 1111 1112 1112 1113 static void dasd_statistics_createroot(void) 1113 1114 { 1114 - mode_t mode; 1115 + umode_t mode; 1115 1116 struct dentry *pde; 1116 1117 1117 1118 dasd_debugfs_root_entry = NULL;
+1 -1
drivers/scsi/be2iscsi/be_iscsi.c
··· 733 733 iscsi_destroy_endpoint(beiscsi_ep->openiscsi_ep); 734 734 } 735 735 736 - mode_t be2iscsi_attr_is_visible(int param_type, int param) 736 + umode_t be2iscsi_attr_is_visible(int param_type, int param) 737 737 { 738 738 switch (param_type) { 739 739 case ISCSI_HOST_PARAM:
+1 -1
drivers/scsi/be2iscsi/be_iscsi.h
··· 26 26 #define BE2_IPV4 0x1 27 27 #define BE2_IPV6 0x10 28 28 29 - mode_t be2iscsi_attr_is_visible(int param_type, int param); 29 + umode_t be2iscsi_attr_is_visible(int param_type, int param); 30 30 31 31 void beiscsi_offload_connection(struct beiscsi_conn *beiscsi_conn, 32 32 struct beiscsi_offload_params *params);
+6 -6
drivers/scsi/be2iscsi/be_main.c
··· 325 325 } 326 326 327 327 328 - static mode_t beiscsi_tgt_get_attr_visibility(void *data, int type) 328 + static umode_t beiscsi_tgt_get_attr_visibility(void *data, int type) 329 329 { 330 - int rc; 330 + umode_t rc; 331 331 332 332 switch (type) { 333 333 case ISCSI_BOOT_TGT_NAME: ··· 348 348 return rc; 349 349 } 350 350 351 - static mode_t beiscsi_ini_get_attr_visibility(void *data, int type) 351 + static umode_t beiscsi_ini_get_attr_visibility(void *data, int type) 352 352 { 353 - int rc; 353 + umode_t rc; 354 354 355 355 switch (type) { 356 356 case ISCSI_BOOT_INI_INITIATOR_NAME: ··· 364 364 } 365 365 366 366 367 - static mode_t beiscsi_eth_get_attr_visibility(void *data, int type) 367 + static umode_t beiscsi_eth_get_attr_visibility(void *data, int type) 368 368 { 369 - int rc; 369 + umode_t rc; 370 370 371 371 switch (type) { 372 372 case ISCSI_BOOT_ETH_FLAGS:
+1 -1
drivers/scsi/bfa/bfad_debugfs.c
··· 472 472 473 473 struct bfad_debugfs_entry { 474 474 const char *name; 475 - mode_t mode; 475 + umode_t mode; 476 476 const struct file_operations *fops; 477 477 }; 478 478
+1 -1
drivers/scsi/bnx2i/bnx2i_iscsi.c
··· 2177 2177 return 0; 2178 2178 } 2179 2179 2180 - static mode_t bnx2i_attr_is_visible(int param_type, int param) 2180 + static umode_t bnx2i_attr_is_visible(int param_type, int param) 2181 2181 { 2182 2182 switch (param_type) { 2183 2183 case ISCSI_HOST_PARAM:
+1 -1
drivers/scsi/cxgbi/libcxgbi.c
··· 2575 2575 } 2576 2576 EXPORT_SYMBOL_GPL(cxgbi_iscsi_cleanup); 2577 2577 2578 - mode_t cxgbi_attr_is_visible(int param_type, int param) 2578 + umode_t cxgbi_attr_is_visible(int param_type, int param) 2579 2579 { 2580 2580 switch (param_type) { 2581 2581 case ISCSI_HOST_PARAM:
+1 -1
drivers/scsi/cxgbi/libcxgbi.h
··· 709 709 710 710 void cxgbi_cleanup_task(struct iscsi_task *task); 711 711 712 - mode_t cxgbi_attr_is_visible(int param_type, int param); 712 + umode_t cxgbi_attr_is_visible(int param_type, int param); 713 713 void cxgbi_get_conn_stats(struct iscsi_cls_conn *, struct iscsi_stats *); 714 714 int cxgbi_set_conn_param(struct iscsi_cls_conn *, 715 715 enum iscsi_param, char *, int);
+7 -7
drivers/scsi/iscsi_boot_sysfs.c
··· 112 112 NULL 113 113 }; 114 114 115 - static mode_t iscsi_boot_tgt_attr_is_visible(struct kobject *kobj, 115 + static umode_t iscsi_boot_tgt_attr_is_visible(struct kobject *kobj, 116 116 struct attribute *attr, int i) 117 117 { 118 118 struct iscsi_boot_kobj *boot_kobj = ··· 193 193 NULL 194 194 }; 195 195 196 - static mode_t iscsi_boot_eth_attr_is_visible(struct kobject *kobj, 196 + static umode_t iscsi_boot_eth_attr_is_visible(struct kobject *kobj, 197 197 struct attribute *attr, int i) 198 198 { 199 199 struct iscsi_boot_kobj *boot_kobj = ··· 265 265 NULL 266 266 }; 267 267 268 - static mode_t iscsi_boot_ini_attr_is_visible(struct kobject *kobj, 268 + static umode_t iscsi_boot_ini_attr_is_visible(struct kobject *kobj, 269 269 struct attribute *attr, int i) 270 270 { 271 271 struct iscsi_boot_kobj *boot_kobj = ··· 306 306 struct attribute_group *attr_group, 307 307 const char *name, int index, void *data, 308 308 ssize_t (*show) (void *data, int type, char *buf), 309 - mode_t (*is_visible) (void *data, int type), 309 + umode_t (*is_visible) (void *data, int type), 310 310 void (*release) (void *data)) 311 311 { 312 312 struct iscsi_boot_kobj *boot_kobj; ··· 369 369 iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index, 370 370 void *data, 371 371 ssize_t (*show) (void *data, int type, char *buf), 372 - mode_t (*is_visible) (void *data, int type), 372 + umode_t (*is_visible) (void *data, int type), 373 373 void (*release) (void *data)) 374 374 { 375 375 return iscsi_boot_create_kobj(boot_kset, &iscsi_boot_target_attr_group, ··· 394 394 iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index, 395 395 void *data, 396 396 ssize_t (*show) (void *data, int type, char *buf), 397 - mode_t (*is_visible) (void *data, int type), 397 + umode_t (*is_visible) (void *data, int type), 398 398 void (*release) (void *data)) 399 399 { 400 400 return iscsi_boot_create_kobj(boot_kset, ··· 420 420 iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index, 421 421 void *data, 422 422 ssize_t (*show) (void *data, int type, char *buf), 423 - mode_t (*is_visible) (void *data, int type), 423 + umode_t (*is_visible) (void *data, int type), 424 424 void (*release) (void *data)) 425 425 { 426 426 return iscsi_boot_create_kobj(boot_kset,
+1 -1
drivers/scsi/iscsi_tcp.c
··· 873 873 iscsi_host_free(shost); 874 874 } 875 875 876 - static mode_t iscsi_sw_tcp_attr_is_visible(int param_type, int param) 876 + static umode_t iscsi_sw_tcp_attr_is_visible(int param_type, int param) 877 877 { 878 878 switch (param_type) { 879 879 case ISCSI_HOST_PARAM:
+5 -5
drivers/scsi/qla4xxx/ql4_os.c
··· 128 128 static int qla4xxx_slave_alloc(struct scsi_device *device); 129 129 static int qla4xxx_slave_configure(struct scsi_device *device); 130 130 static void qla4xxx_slave_destroy(struct scsi_device *sdev); 131 - static mode_t ql4_attr_is_visible(int param_type, int param); 131 + static umode_t ql4_attr_is_visible(int param_type, int param); 132 132 static int qla4xxx_host_reset(struct Scsi_Host *shost, int reset_type); 133 133 134 134 static struct qla4_8xxx_legacy_intr_set legacy_intr[] = ··· 197 197 198 198 static struct scsi_transport_template *qla4xxx_scsi_transport; 199 199 200 - static mode_t ql4_attr_is_visible(int param_type, int param) 200 + static umode_t ql4_attr_is_visible(int param_type, int param) 201 201 { 202 202 switch (param_type) { 203 203 case ISCSI_HOST_PARAM: ··· 3039 3039 return rc; 3040 3040 } 3041 3041 3042 - static mode_t qla4xxx_eth_get_attr_visibility(void *data, int type) 3042 + static umode_t qla4xxx_eth_get_attr_visibility(void *data, int type) 3043 3043 { 3044 3044 int rc; 3045 3045 ··· 3073 3073 return rc; 3074 3074 } 3075 3075 3076 - static mode_t qla4xxx_ini_get_attr_visibility(void *data, int type) 3076 + static umode_t qla4xxx_ini_get_attr_visibility(void *data, int type) 3077 3077 { 3078 3078 int rc; 3079 3079 ··· 3160 3160 return qla4xxx_show_boot_tgt_info(boot_sess, type, buf); 3161 3161 } 3162 3162 3163 - static mode_t qla4xxx_tgt_get_attr_visibility(void *data, int type) 3163 + static umode_t qla4xxx_tgt_get_attr_visibility(void *data, int type) 3164 3164 { 3165 3165 int rc; 3166 3166
+4 -4
drivers/scsi/scsi_transport_iscsi.c
··· 328 328 iscsi_iface_net_attr(iface, mtu, ISCSI_NET_PARAM_MTU); 329 329 iscsi_iface_net_attr(iface, port, ISCSI_NET_PARAM_PORT); 330 330 331 - static mode_t iscsi_iface_attr_is_visible(struct kobject *kobj, 331 + static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj, 332 332 struct attribute *attr, int i) 333 333 { 334 334 struct device *dev = container_of(kobj, struct device, kobj); ··· 2199 2199 NULL, 2200 2200 }; 2201 2201 2202 - static mode_t iscsi_conn_attr_is_visible(struct kobject *kobj, 2202 + static umode_t iscsi_conn_attr_is_visible(struct kobject *kobj, 2203 2203 struct attribute *attr, int i) 2204 2204 { 2205 2205 struct device *cdev = container_of(kobj, struct device, kobj); ··· 2370 2370 NULL, 2371 2371 }; 2372 2372 2373 - static mode_t iscsi_session_attr_is_visible(struct kobject *kobj, 2373 + static umode_t iscsi_session_attr_is_visible(struct kobject *kobj, 2374 2374 struct attribute *attr, int i) 2375 2375 { 2376 2376 struct device *cdev = container_of(kobj, struct device, kobj); ··· 2468 2468 NULL, 2469 2469 }; 2470 2470 2471 - static mode_t iscsi_host_attr_is_visible(struct kobject *kobj, 2471 + static umode_t iscsi_host_attr_is_visible(struct kobject *kobj, 2472 2472 struct attribute *attr, int i) 2473 2473 { 2474 2474 struct device *cdev = container_of(kobj, struct device, kobj);
+1 -1
drivers/scsi/scsi_transport_spi.c
··· 1434 1434 (si->f->show_##name ? S_IRUGO : 0) | \ 1435 1435 (si->f->set_##name ? S_IWUSR : 0) 1436 1436 1437 - static mode_t target_attribute_is_visible(struct kobject *kobj, 1437 + static umode_t target_attribute_is_visible(struct kobject *kobj, 1438 1438 struct attribute *attr, int i) 1439 1439 { 1440 1440 struct device *cdev = container_of(kobj, struct device, kobj);
-1
drivers/scsi/scsicam.c
··· 16 16 #include <linux/genhd.h> 17 17 #include <linux/kernel.h> 18 18 #include <linux/blkdev.h> 19 - #include <linux/buffer_head.h> 20 19 #include <asm/unaligned.h> 21 20 22 21 #include <scsi/scsicam.h>
+3 -4
drivers/scsi/sg.c
··· 2325 2325 static int 2326 2326 sg_proc_init(void) 2327 2327 { 2328 - int k, mask; 2329 2328 int num_leaves = ARRAY_SIZE(sg_proc_leaf_arr); 2330 - struct sg_proc_leaf * leaf; 2329 + int k; 2331 2330 2332 2331 sg_proc_sgp = proc_mkdir(sg_proc_sg_dirname, NULL); 2333 2332 if (!sg_proc_sgp) 2334 2333 return 1; 2335 2334 for (k = 0; k < num_leaves; ++k) { 2336 - leaf = &sg_proc_leaf_arr[k]; 2337 - mask = leaf->fops->write ? S_IRUGO | S_IWUSR : S_IRUGO; 2335 + struct sg_proc_leaf *leaf = &sg_proc_leaf_arr[k]; 2336 + umode_t mask = leaf->fops->write ? S_IRUGO | S_IWUSR : S_IRUGO; 2338 2337 proc_create(leaf->name, mask, sg_proc_sgp, leaf->fops); 2339 2338 } 2340 2339 return 0;
+2 -2
drivers/staging/iio/adc/ad7192.c
··· 838 838 NULL 839 839 }; 840 840 841 - static mode_t ad7192_attr_is_visible(struct kobject *kobj, 841 + static umode_t ad7192_attr_is_visible(struct kobject *kobj, 842 842 struct attribute *attr, int n) 843 843 { 844 844 struct device *dev = container_of(kobj, struct device, kobj); 845 845 struct iio_dev *indio_dev = dev_get_drvdata(dev); 846 846 struct ad7192_state *st = iio_priv(indio_dev); 847 847 848 - mode_t mode = attr->mode; 848 + umode_t mode = attr->mode; 849 849 850 850 if ((st->devid != ID_AD7195) && 851 851 (attr == &iio_dev_attr_ac_excitation_en.dev_attr.attr))
+2 -2
drivers/staging/iio/adc/ad7606_core.c
··· 205 205 NULL, 206 206 }; 207 207 208 - static mode_t ad7606_attr_is_visible(struct kobject *kobj, 208 + static umode_t ad7606_attr_is_visible(struct kobject *kobj, 209 209 struct attribute *attr, int n) 210 210 { 211 211 struct device *dev = container_of(kobj, struct device, kobj); 212 212 struct iio_dev *indio_dev = dev_get_drvdata(dev); 213 213 struct ad7606_state *st = iio_priv(indio_dev); 214 214 215 - mode_t mode = attr->mode; 215 + umode_t mode = attr->mode; 216 216 217 217 if (!(gpio_is_valid(st->pdata->gpio_os0) && 218 218 gpio_is_valid(st->pdata->gpio_os1) &&
+2 -2
drivers/staging/iio/dac/ad5446.c
··· 197 197 NULL, 198 198 }; 199 199 200 - static mode_t ad5446_attr_is_visible(struct kobject *kobj, 200 + static umode_t ad5446_attr_is_visible(struct kobject *kobj, 201 201 struct attribute *attr, int n) 202 202 { 203 203 struct device *dev = container_of(kobj, struct device, kobj); 204 204 struct iio_dev *indio_dev = dev_get_drvdata(dev); 205 205 struct ad5446_state *st = iio_priv(indio_dev); 206 206 207 - mode_t mode = attr->mode; 207 + umode_t mode = attr->mode; 208 208 209 209 if (!st->chip_info->store_pwr_down && 210 210 (attr == &iio_dev_attr_out_voltage0_powerdown.dev_attr.attr ||
+2 -2
drivers/staging/iio/dds/ad9834.c
··· 281 281 NULL, 282 282 }; 283 283 284 - static mode_t ad9834_attr_is_visible(struct kobject *kobj, 284 + static umode_t ad9834_attr_is_visible(struct kobject *kobj, 285 285 struct attribute *attr, int n) 286 286 { 287 287 struct device *dev = container_of(kobj, struct device, kobj); 288 288 struct iio_dev *indio_dev = dev_get_drvdata(dev); 289 289 struct ad9834_state *st = iio_priv(indio_dev); 290 290 291 - mode_t mode = attr->mode; 291 + umode_t mode = attr->mode; 292 292 293 293 if (((st->devid == ID_AD9833) || (st->devid == ID_AD9837)) && 294 294 ((attr == &iio_dev_attr_dds0_out1_enable.dev_attr.attr) ||
+6 -5
drivers/staging/pohmelfs/dir.c
··· 590 590 * during writeback for given inode. 591 591 */ 592 592 struct pohmelfs_inode *pohmelfs_create_entry_local(struct pohmelfs_sb *psb, 593 - struct pohmelfs_inode *parent, struct qstr *str, u64 start, int mode) 593 + struct pohmelfs_inode *parent, struct qstr *str, u64 start, umode_t mode) 594 594 { 595 595 struct pohmelfs_inode *npi; 596 596 int err = -ENOMEM; 597 597 struct netfs_inode_info info; 598 598 599 - dprintk("%s: name: '%s', mode: %o, start: %llu.\n", 599 + dprintk("%s: name: '%s', mode: %ho, start: %llu.\n", 600 600 __func__, str->name, mode, start); 601 601 602 602 info.mode = mode; ··· 630 630 /* 631 631 * Create local object and bind it to dentry. 632 632 */ 633 - static int pohmelfs_create_entry(struct inode *dir, struct dentry *dentry, u64 start, int mode) 633 + static int pohmelfs_create_entry(struct inode *dir, struct dentry *dentry, 634 + u64 start, umode_t mode) 634 635 { 635 636 struct pohmelfs_sb *psb = POHMELFS_SB(dir->i_sb); 636 637 struct pohmelfs_inode *npi, *parent; ··· 662 661 /* 663 662 * VFS create and mkdir callbacks. 664 663 */ 665 - static int pohmelfs_create(struct inode *dir, struct dentry *dentry, int mode, 664 + static int pohmelfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 666 665 struct nameidata *nd) 667 666 { 668 667 return pohmelfs_create_entry(dir, dentry, 0, mode); 669 668 } 670 669 671 - static int pohmelfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 670 + static int pohmelfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 672 671 { 673 672 int err; 674 673
+4 -5
drivers/staging/pohmelfs/inode.c
··· 830 830 static void pohmelfs_i_callback(struct rcu_head *head) 831 831 { 832 832 struct inode *inode = container_of(head, struct inode, i_rcu); 833 - INIT_LIST_HEAD(&inode->i_dentry); 834 833 kmem_cache_free(pohmelfs_inode_cache, POHMELFS_I(inode)); 835 834 } 836 835 ··· 1369 1370 return 0; 1370 1371 } 1371 1372 1372 - static int pohmelfs_show_options(struct seq_file *seq, struct vfsmount *vfs) 1373 + static int pohmelfs_show_options(struct seq_file *seq, struct dentry *root) 1373 1374 { 1374 - struct pohmelfs_sb *psb = POHMELFS_SB(vfs->mnt_sb); 1375 + struct pohmelfs_sb *psb = POHMELFS_SB(root->d_sb); 1375 1376 1376 1377 seq_printf(seq, ",idx=%u", psb->idx); 1377 1378 seq_printf(seq, ",trans_scan_timeout=%u", jiffies_to_msecs(psb->trans_scan_timeout)); ··· 1759 1760 return err; 1760 1761 } 1761 1762 1762 - static int pohmelfs_show_stats(struct seq_file *m, struct vfsmount *mnt) 1763 + static int pohmelfs_show_stats(struct seq_file *m, struct dentry *root) 1763 1764 { 1764 1765 struct netfs_state *st; 1765 1766 struct pohmelfs_ctl *ctl; 1766 - struct pohmelfs_sb *psb = POHMELFS_SB(mnt->mnt_sb); 1767 + struct pohmelfs_sb *psb = POHMELFS_SB(root->d_sb); 1767 1768 struct pohmelfs_config *c; 1768 1769 1769 1770 mutex_lock(&psb->state_lock);
+1 -1
drivers/staging/pohmelfs/netfs.h
··· 776 776 void pohmelfs_inode_del_inode(struct pohmelfs_sb *psb, struct pohmelfs_inode *pi); 777 777 778 778 struct pohmelfs_inode *pohmelfs_create_entry_local(struct pohmelfs_sb *psb, 779 - struct pohmelfs_inode *parent, struct qstr *str, u64 start, int mode); 779 + struct pohmelfs_inode *parent, struct qstr *str, u64 start, umode_t mode); 780 780 781 781 int pohmelfs_write_create_inode(struct pohmelfs_inode *pi); 782 782
+1 -1
drivers/tty/sysrq.c
··· 32 32 #include <linux/module.h> 33 33 #include <linux/suspend.h> 34 34 #include <linux/writeback.h> 35 - #include <linux/buffer_head.h> /* for fsync_bdev() */ 36 35 #include <linux/swap.h> 37 36 #include <linux/spinlock.h> 38 37 #include <linux/vt_kern.h> ··· 40 41 #include <linux/oom.h> 41 42 #include <linux/slab.h> 42 43 #include <linux/input.h> 44 + #include <linux/uaccess.h> 43 45 44 46 #include <asm/ptrace.h> 45 47 #include <asm/irq_regs.h>
+1 -1
drivers/tty/tty_io.c
··· 3267 3267 } 3268 3268 } 3269 3269 3270 - static char *tty_devnode(struct device *dev, mode_t *mode) 3270 + static char *tty_devnode(struct device *dev, umode_t *mode) 3271 3271 { 3272 3272 if (!mode) 3273 3273 return NULL;
+1 -1
drivers/usb/class/usblp.c
··· 1045 1045 .llseek = noop_llseek, 1046 1046 }; 1047 1047 1048 - static char *usblp_devnode(struct device *dev, mode_t *mode) 1048 + static char *usblp_devnode(struct device *dev, umode_t *mode) 1049 1049 { 1050 1050 return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); 1051 1051 }
+1 -1
drivers/usb/core/file.c
··· 66 66 struct class *class; 67 67 } *usb_class; 68 68 69 - static char *usb_devnode(struct device *dev, mode_t *mode) 69 + static char *usb_devnode(struct device *dev, umode_t *mode) 70 70 { 71 71 struct usb_class_driver *drv; 72 72
+14 -17
drivers/usb/core/inode.c
··· 65 65 static umode_t busmode = USBFS_DEFAULT_BUSMODE; 66 66 static umode_t listmode = USBFS_DEFAULT_LISTMODE; 67 67 68 - static int usbfs_show_options(struct seq_file *seq, struct vfsmount *mnt) 68 + static int usbfs_show_options(struct seq_file *seq, struct dentry *root) 69 69 { 70 70 if (devuid != 0) 71 71 seq_printf(seq, ",devuid=%u", devuid); ··· 264 264 return -EINVAL; 265 265 } 266 266 267 - if (usbfs_mount && usbfs_mount->mnt_sb) 267 + if (usbfs_mount) 268 268 update_sb(usbfs_mount->mnt_sb); 269 269 270 270 return 0; 271 271 } 272 272 273 - static struct inode *usbfs_get_inode (struct super_block *sb, int mode, dev_t dev) 273 + static struct inode *usbfs_get_inode (struct super_block *sb, umode_t mode, dev_t dev) 274 274 { 275 275 struct inode *inode = new_inode(sb); 276 276 277 277 if (inode) { 278 278 inode->i_ino = get_next_ino(); 279 - inode->i_mode = mode; 280 - inode->i_uid = current_fsuid(); 281 - inode->i_gid = current_fsgid(); 279 + inode_init_owner(inode, NULL, mode); 282 280 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 283 281 switch (mode & S_IFMT) { 284 282 default: ··· 298 300 } 299 301 300 302 /* SMP-safe */ 301 - static int usbfs_mknod (struct inode *dir, struct dentry *dentry, int mode, 303 + static int usbfs_mknod (struct inode *dir, struct dentry *dentry, umode_t mode, 302 304 dev_t dev) 303 305 { 304 306 struct inode *inode = usbfs_get_inode(dir->i_sb, mode, dev); ··· 315 317 return error; 316 318 } 317 319 318 - static int usbfs_mkdir (struct inode *dir, struct dentry *dentry, int mode) 320 + static int usbfs_mkdir (struct inode *dir, struct dentry *dentry, umode_t mode) 319 321 { 320 322 int res; 321 323 ··· 326 328 return res; 327 329 } 328 330 329 - static int usbfs_create (struct inode *dir, struct dentry *dentry, int mode) 331 + static int usbfs_create (struct inode *dir, struct dentry *dentry, umode_t mode) 330 332 { 331 333 mode = (mode & S_IALLUGO) | S_IFREG; 332 334 return usbfs_mknod (dir, dentry, mode, 0); ··· 487 489 * 488 490 * This function handles both regular files and directories. 489 491 */ 490 - static int fs_create_by_name (const char *name, mode_t mode, 492 + static int fs_create_by_name (const char *name, umode_t mode, 491 493 struct dentry *parent, struct dentry **dentry) 492 494 { 493 495 int error = 0; ··· 498 500 * have around. 499 501 */ 500 502 if (!parent ) { 501 - if (usbfs_mount && usbfs_mount->mnt_sb) { 502 - parent = usbfs_mount->mnt_sb->s_root; 503 - } 503 + if (usbfs_mount) 504 + parent = usbfs_mount->mnt_root; 504 505 } 505 506 506 507 if (!parent) { ··· 511 514 mutex_lock(&parent->d_inode->i_mutex); 512 515 *dentry = lookup_one_len(name, parent, strlen(name)); 513 516 if (!IS_ERR(*dentry)) { 514 - if ((mode & S_IFMT) == S_IFDIR) 517 + if (S_ISDIR(mode)) 515 518 error = usbfs_mkdir (parent->d_inode, *dentry, mode); 516 519 else 517 520 error = usbfs_create (parent->d_inode, *dentry, mode); ··· 522 525 return error; 523 526 } 524 527 525 - static struct dentry *fs_create_file (const char *name, mode_t mode, 528 + static struct dentry *fs_create_file (const char *name, umode_t mode, 526 529 struct dentry *parent, void *data, 527 530 const struct file_operations *fops, 528 531 uid_t uid, gid_t gid) ··· 605 608 606 609 ignore_mount = 0; 607 610 608 - parent = usbfs_mount->mnt_sb->s_root; 611 + parent = usbfs_mount->mnt_root; 609 612 devices_usbfs_dentry = fs_create_file ("devices", 610 613 listmode | S_IFREG, parent, 611 614 NULL, &usbfs_devices_fops, ··· 659 662 660 663 sprintf (name, "%03d", bus->busnum); 661 664 662 - parent = usbfs_mount->mnt_sb->s_root; 665 + parent = usbfs_mount->mnt_root; 663 666 bus->usbfs_dentry = fs_create_file (name, busmode | S_IFDIR, parent, 664 667 bus, NULL, busuid, busgid); 665 668 if (bus->usbfs_dentry == NULL) {
+2 -2
drivers/usb/core/sysfs.c
··· 642 642 NULL 643 643 }; 644 644 645 - static mode_t dev_string_attrs_are_visible(struct kobject *kobj, 645 + static umode_t dev_string_attrs_are_visible(struct kobject *kobj, 646 646 struct attribute *a, int n) 647 647 { 648 648 struct device *dev = container_of(kobj, struct device, kobj); ··· 877 877 NULL, 878 878 }; 879 879 880 - static mode_t intf_assoc_attrs_are_visible(struct kobject *kobj, 880 + static umode_t intf_assoc_attrs_are_visible(struct kobject *kobj, 881 881 struct attribute *a, int n) 882 882 { 883 883 struct device *dev = container_of(kobj, struct device, kobj);
+1 -1
drivers/usb/core/usb.c
··· 326 326 #endif /* CONFIG_PM */ 327 327 328 328 329 - static char *usb_devnode(struct device *dev, mode_t *mode) 329 + static char *usb_devnode(struct device *dev, umode_t *mode) 330 330 { 331 331 struct usb_device *usb_dev; 332 332
+1 -1
drivers/usb/misc/iowarrior.c
··· 734 734 .llseek = noop_llseek, 735 735 }; 736 736 737 - static char *iowarrior_devnode(struct device *dev, mode_t *mode) 737 + static char *iowarrior_devnode(struct device *dev, umode_t *mode) 738 738 { 739 739 return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); 740 740 }
+1 -1
drivers/usb/misc/legousbtower.c
··· 269 269 .llseek = tower_llseek, 270 270 }; 271 271 272 - static char *legousbtower_devnode(struct device *dev, mode_t *mode) 272 + static char *legousbtower_devnode(struct device *dev, umode_t *mode) 273 273 { 274 274 return kasprintf(GFP_KERNEL, "usb/%s", dev_name(dev)); 275 275 }
+2 -2
fs/9p/v9fs_vfs.h
··· 54 54 55 55 struct inode *v9fs_alloc_inode(struct super_block *sb); 56 56 void v9fs_destroy_inode(struct inode *inode); 57 - struct inode *v9fs_get_inode(struct super_block *sb, int mode, dev_t); 57 + struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode, dev_t); 58 58 int v9fs_init_inode(struct v9fs_session_info *v9ses, 59 - struct inode *inode, int mode, dev_t); 59 + struct inode *inode, umode_t mode, dev_t); 60 60 void v9fs_evict_inode(struct inode *inode); 61 61 ino_t v9fs_qid2ino(struct p9_qid *qid); 62 62 void v9fs_stat2inode(struct p9_wstat *, struct inode *, struct super_block *);
+21 -25
fs/9p/vfs_inode.c
··· 59 59 * 60 60 */ 61 61 62 - static int unixmode2p9mode(struct v9fs_session_info *v9ses, int mode) 62 + static u32 unixmode2p9mode(struct v9fs_session_info *v9ses, umode_t mode) 63 63 { 64 64 int res; 65 65 res = mode & 0777; 66 66 if (S_ISDIR(mode)) 67 67 res |= P9_DMDIR; 68 68 if (v9fs_proto_dotu(v9ses)) { 69 - if (S_ISLNK(mode)) 70 - res |= P9_DMSYMLINK; 71 69 if (v9ses->nodev == 0) { 72 70 if (S_ISSOCK(mode)) 73 71 res |= P9_DMSOCKET; ··· 83 85 res |= P9_DMSETGID; 84 86 if ((mode & S_ISVTX) == S_ISVTX) 85 87 res |= P9_DMSETVTX; 86 - if ((mode & P9_DMLINK)) 87 - res |= P9_DMLINK; 88 88 } 89 - 90 89 return res; 91 90 } 92 91 ··· 94 99 * @rdev: major number, minor number in case of device files. 95 100 * 96 101 */ 97 - static int p9mode2unixmode(struct v9fs_session_info *v9ses, 98 - struct p9_wstat *stat, dev_t *rdev) 102 + static umode_t p9mode2unixmode(struct v9fs_session_info *v9ses, 103 + struct p9_wstat *stat, dev_t *rdev) 99 104 { 100 105 int res; 101 - int mode = stat->mode; 106 + u32 mode = stat->mode; 102 107 103 108 res = mode & S_IALLUGO; 104 109 *rdev = 0; ··· 246 251 static void v9fs_i_callback(struct rcu_head *head) 247 252 { 248 253 struct inode *inode = container_of(head, struct inode, i_rcu); 249 - INIT_LIST_HEAD(&inode->i_dentry); 250 254 kmem_cache_free(v9fs_inode_cache, V9FS_I(inode)); 251 255 } 252 256 ··· 255 261 } 256 262 257 263 int v9fs_init_inode(struct v9fs_session_info *v9ses, 258 - struct inode *inode, int mode, dev_t rdev) 264 + struct inode *inode, umode_t mode, dev_t rdev) 259 265 { 260 266 int err = 0; 261 267 ··· 329 335 330 336 break; 331 337 default: 332 - P9_DPRINTK(P9_DEBUG_ERROR, "BAD mode 0x%x S_IFMT 0x%x\n", 338 + P9_DPRINTK(P9_DEBUG_ERROR, "BAD mode 0x%hx S_IFMT 0x%x\n", 333 339 mode, mode & S_IFMT); 334 340 err = -EINVAL; 335 341 goto error; ··· 346 352 * 347 353 */ 348 354 349 - struct inode *v9fs_get_inode(struct super_block *sb, int mode, dev_t rdev) 355 + struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode, dev_t rdev) 350 356 { 351 357 int err; 352 358 struct inode *inode; 353 359 struct v9fs_session_info *v9ses = sb->s_fs_info; 354 360 355 - P9_DPRINTK(P9_DEBUG_VFS, "super block: %p mode: %o\n", sb, mode); 361 + P9_DPRINTK(P9_DEBUG_VFS, "super block: %p mode: %ho\n", sb, mode); 356 362 357 363 inode = new_inode(sb); 358 364 if (!inode) { ··· 486 492 int new) 487 493 { 488 494 dev_t rdev; 489 - int retval, umode; 495 + int retval; 496 + umode_t umode; 490 497 unsigned long i_ino; 491 498 struct inode *inode; 492 499 struct v9fs_session_info *v9ses = sb->s_fs_info; ··· 698 703 */ 699 704 700 705 static int 701 - v9fs_vfs_create(struct inode *dir, struct dentry *dentry, int mode, 706 + v9fs_vfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 702 707 struct nameidata *nd) 703 708 { 704 709 int err; ··· 781 786 * 782 787 */ 783 788 784 - static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 789 + static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 785 790 { 786 791 int err; 787 792 u32 perm; ··· 1126 1131 v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode, 1127 1132 struct super_block *sb) 1128 1133 { 1129 - mode_t mode; 1134 + umode_t mode; 1130 1135 char ext[32]; 1131 1136 char tag_name[14]; 1132 1137 unsigned int i_nlink; ··· 1299 1304 */ 1300 1305 1301 1306 static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry, 1302 - int mode, const char *extension) 1307 + u32 perm, const char *extension) 1303 1308 { 1304 - u32 perm; 1305 1309 struct p9_fid *fid; 1306 1310 struct v9fs_session_info *v9ses; 1307 1311 ··· 1310 1316 return -EPERM; 1311 1317 } 1312 1318 1313 - perm = unixmode2p9mode(v9ses, mode); 1314 1319 fid = v9fs_create(v9ses, dir, dentry, (char *) extension, perm, 1315 1320 P9_OREAD); 1316 1321 if (IS_ERR(fid)) ··· 1336 1343 P9_DPRINTK(P9_DEBUG_VFS, " %lu,%s,%s\n", dir->i_ino, 1337 1344 dentry->d_name.name, symname); 1338 1345 1339 - return v9fs_vfs_mkspecial(dir, dentry, S_IFLNK, symname); 1346 + return v9fs_vfs_mkspecial(dir, dentry, P9_DMSYMLINK, symname); 1340 1347 } 1341 1348 1342 1349 /** ··· 1391 1398 */ 1392 1399 1393 1400 static int 1394 - v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) 1401 + v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) 1395 1402 { 1403 + struct v9fs_session_info *v9ses = v9fs_inode2v9ses(dir); 1396 1404 int retval; 1397 1405 char *name; 1406 + u32 perm; 1398 1407 1399 1408 P9_DPRINTK(P9_DEBUG_VFS, 1400 - " %lu,%s mode: %x MAJOR: %u MINOR: %u\n", dir->i_ino, 1409 + " %lu,%s mode: %hx MAJOR: %u MINOR: %u\n", dir->i_ino, 1401 1410 dentry->d_name.name, mode, MAJOR(rdev), MINOR(rdev)); 1402 1411 1403 1412 if (!new_valid_dev(rdev)) ··· 1422 1427 return -EINVAL; 1423 1428 } 1424 1429 1425 - retval = v9fs_vfs_mkspecial(dir, dentry, mode, name); 1430 + perm = unixmode2p9mode(v9ses, mode); 1431 + retval = v9fs_vfs_mkspecial(dir, dentry, perm, name); 1426 1432 __putname(name); 1427 1433 1428 1434 return retval;
+7 -7
fs/9p/vfs_inode_dotl.c
··· 48 48 #include "acl.h" 49 49 50 50 static int 51 - v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode, 51 + v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode, 52 52 dev_t rdev); 53 53 54 54 /** ··· 253 253 */ 254 254 255 255 static int 256 - v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode, 256 + v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, umode_t omode, 257 257 struct nameidata *nd) 258 258 { 259 259 int err = 0; ··· 284 284 285 285 name = (char *) dentry->d_name.name; 286 286 P9_DPRINTK(P9_DEBUG_VFS, "v9fs_vfs_create_dotl: name:%s flags:0x%x " 287 - "mode:0x%x\n", name, flags, omode); 287 + "mode:0x%hx\n", name, flags, omode); 288 288 289 289 dfid = v9fs_fid_lookup(dentry->d_parent); 290 290 if (IS_ERR(dfid)) { ··· 395 395 */ 396 396 397 397 static int v9fs_vfs_mkdir_dotl(struct inode *dir, 398 - struct dentry *dentry, int omode) 398 + struct dentry *dentry, umode_t omode) 399 399 { 400 400 int err; 401 401 struct v9fs_session_info *v9ses; ··· 594 594 void 595 595 v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode) 596 596 { 597 - mode_t mode; 597 + umode_t mode; 598 598 struct v9fs_inode *v9inode = V9FS_I(inode); 599 599 600 600 if ((stat->st_result_mask & P9_STATS_BASIC) == P9_STATS_BASIC) { ··· 799 799 * 800 800 */ 801 801 static int 802 - v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode, 802 + v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode, 803 803 dev_t rdev) 804 804 { 805 805 int err; ··· 814 814 struct posix_acl *dacl = NULL, *pacl = NULL; 815 815 816 816 P9_DPRINTK(P9_DEBUG_VFS, 817 - " %lu,%s mode: %x MAJOR: %u MINOR: %u\n", dir->i_ino, 817 + " %lu,%s mode: %hx MAJOR: %u MINOR: %u\n", dir->i_ino, 818 818 dentry->d_name.name, omode, MAJOR(rdev), MINOR(rdev)); 819 819 820 820 if (!new_valid_dev(rdev))
+1 -1
fs/9p/vfs_super.c
··· 117 117 struct inode *inode = NULL; 118 118 struct dentry *root = NULL; 119 119 struct v9fs_session_info *v9ses = NULL; 120 - int mode = S_IRWXUGO | S_ISVTX; 120 + umode_t mode = S_IRWXUGO | S_ISVTX; 121 121 struct p9_fid *fid; 122 122 int retval = 0; 123 123
-8
fs/Kconfig
··· 266 266 267 267 endif # NETWORK_FILESYSTEMS 268 268 269 - if BLOCK 270 - menu "Partition Types" 271 - 272 - source "fs/partitions/Kconfig" 273 - 274 - endmenu 275 - endif 276 - 277 269 source "fs/nls/Kconfig" 278 270 source "fs/dlm/Kconfig" 279 271
+2 -1
fs/Makefile
··· 19 19 obj-y += no-block.o 20 20 endif 21 21 22 + obj-$(CONFIG_PROC_FS) += proc_namespace.o 23 + 22 24 obj-$(CONFIG_BLK_DEV_INTEGRITY) += bio-integrity.o 23 25 obj-y += notify/ 24 26 obj-$(CONFIG_EPOLL) += eventpoll.o ··· 54 52 obj-y += quota/ 55 53 56 54 obj-$(CONFIG_PROC_FS) += proc/ 57 - obj-y += partitions/ 58 55 obj-$(CONFIG_SYSFS) += sysfs/ 59 56 obj-$(CONFIG_CONFIGFS_FS) += configfs/ 60 57 obj-y += devpts/
+2 -2
fs/adfs/super.c
··· 126 126 sb->s_fs_info = NULL; 127 127 } 128 128 129 - static int adfs_show_options(struct seq_file *seq, struct vfsmount *mnt) 129 + static int adfs_show_options(struct seq_file *seq, struct dentry *root) 130 130 { 131 - struct adfs_sb_info *asb = ADFS_SB(mnt->mnt_sb); 131 + struct adfs_sb_info *asb = ADFS_SB(root->d_sb); 132 132 133 133 if (asb->s_uid != 0) 134 134 seq_printf(seq, ",uid=%u", asb->s_uid);
+3 -3
fs/affs/affs.h
··· 136 136 extern u32 affs_checksum_block(struct super_block *sb, struct buffer_head *bh); 137 137 extern void affs_fix_checksum(struct super_block *sb, struct buffer_head *bh); 138 138 extern void secs_to_datestamp(time_t secs, struct affs_date *ds); 139 - extern mode_t prot_to_mode(u32 prot); 139 + extern umode_t prot_to_mode(u32 prot); 140 140 extern void mode_to_prot(struct inode *inode); 141 141 extern void affs_error(struct super_block *sb, const char *function, const char *fmt, ...); 142 142 extern void affs_warning(struct super_block *sb, const char *function, const char *fmt, ...); ··· 156 156 extern int affs_hash_name(struct super_block *sb, const u8 *name, unsigned int len); 157 157 extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *); 158 158 extern int affs_unlink(struct inode *dir, struct dentry *dentry); 159 - extern int affs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *); 160 - extern int affs_mkdir(struct inode *dir, struct dentry *dentry, int mode); 159 + extern int affs_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *); 160 + extern int affs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode); 161 161 extern int affs_rmdir(struct inode *dir, struct dentry *dentry); 162 162 extern int affs_link(struct dentry *olddentry, struct inode *dir, 163 163 struct dentry *dentry);
+3 -3
fs/affs/amigaffs.c
··· 390 390 ds->ticks = cpu_to_be32(secs * 50); 391 391 } 392 392 393 - mode_t 393 + umode_t 394 394 prot_to_mode(u32 prot) 395 395 { 396 - int mode = 0; 396 + umode_t mode = 0; 397 397 398 398 if (!(prot & FIBF_NOWRITE)) 399 399 mode |= S_IWUSR; ··· 421 421 mode_to_prot(struct inode *inode) 422 422 { 423 423 u32 prot = AFFS_I(inode)->i_protect; 424 - mode_t mode = inode->i_mode; 424 + umode_t mode = inode->i_mode; 425 425 426 426 if (!(mode & S_IXUSR)) 427 427 prot |= FIBF_NOEXECUTE;
+4 -4
fs/affs/namei.c
··· 255 255 } 256 256 257 257 int 258 - affs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd) 258 + affs_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *nd) 259 259 { 260 260 struct super_block *sb = dir->i_sb; 261 261 struct inode *inode; 262 262 int error; 263 263 264 - pr_debug("AFFS: create(%lu,\"%.*s\",0%o)\n",dir->i_ino,(int)dentry->d_name.len, 264 + pr_debug("AFFS: create(%lu,\"%.*s\",0%ho)\n",dir->i_ino,(int)dentry->d_name.len, 265 265 dentry->d_name.name,mode); 266 266 267 267 inode = affs_new_inode(dir); ··· 285 285 } 286 286 287 287 int 288 - affs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 288 + affs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 289 289 { 290 290 struct inode *inode; 291 291 int error; 292 292 293 - pr_debug("AFFS: mkdir(%lu,\"%.*s\",0%o)\n",dir->i_ino, 293 + pr_debug("AFFS: mkdir(%lu,\"%.*s\",0%ho)\n",dir->i_ino, 294 294 (int)dentry->d_name.len,dentry->d_name.name,mode); 295 295 296 296 inode = affs_new_inode(dir);
-1
fs/affs/super.c
··· 98 98 static void affs_i_callback(struct rcu_head *head) 99 99 { 100 100 struct inode *inode = container_of(head, struct inode, i_rcu); 101 - INIT_LIST_HEAD(&inode->i_dentry); 102 101 kmem_cache_free(affs_inode_cachep, AFFS_I(inode)); 103 102 } 104 103
+6 -6
fs/afs/dir.c
··· 28 28 static void afs_d_release(struct dentry *dentry); 29 29 static int afs_lookup_filldir(void *_cookie, const char *name, int nlen, 30 30 loff_t fpos, u64 ino, unsigned dtype); 31 - static int afs_create(struct inode *dir, struct dentry *dentry, int mode, 31 + static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 32 32 struct nameidata *nd); 33 - static int afs_mkdir(struct inode *dir, struct dentry *dentry, int mode); 33 + static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode); 34 34 static int afs_rmdir(struct inode *dir, struct dentry *dentry); 35 35 static int afs_unlink(struct inode *dir, struct dentry *dentry); 36 36 static int afs_link(struct dentry *from, struct inode *dir, ··· 764 764 /* 765 765 * create a directory on an AFS filesystem 766 766 */ 767 - static int afs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 767 + static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 768 768 { 769 769 struct afs_file_status status; 770 770 struct afs_callback cb; ··· 777 777 778 778 dvnode = AFS_FS_I(dir); 779 779 780 - _enter("{%x:%u},{%s},%o", 780 + _enter("{%x:%u},{%s},%ho", 781 781 dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name, mode); 782 782 783 783 ret = -ENAMETOOLONG; ··· 948 948 /* 949 949 * create a regular file on an AFS filesystem 950 950 */ 951 - static int afs_create(struct inode *dir, struct dentry *dentry, int mode, 951 + static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 952 952 struct nameidata *nd) 953 953 { 954 954 struct afs_file_status status; ··· 962 962 963 963 dvnode = AFS_FS_I(dir); 964 964 965 - _enter("{%x:%u},{%s},%o,", 965 + _enter("{%x:%u},{%s},%ho,", 966 966 dvnode->fid.vid, dvnode->fid.vnode, dentry->d_name.name, mode); 967 967 968 968 ret = -ENAMETOOLONG;
+2 -2
fs/afs/mntpt.c
··· 242 242 { 243 243 struct vfsmount *newmnt; 244 244 245 - _enter("{%s,%s}", path->mnt->mnt_devname, path->dentry->d_name.name); 245 + _enter("{%s}", path->dentry->d_name.name); 246 246 247 247 newmnt = afs_mntpt_do_automount(path->dentry); 248 248 if (IS_ERR(newmnt)) ··· 252 252 mnt_set_expiry(newmnt, &afs_vfsmounts); 253 253 queue_delayed_work(afs_wq, &afs_mntpt_expiry_timer, 254 254 afs_mntpt_expiry_timeout * HZ); 255 - _leave(" = %p {%s}", newmnt, newmnt->mnt_devname); 255 + _leave(" = %p", newmnt); 256 256 return newmnt; 257 257 } 258 258
-1
fs/afs/super.c
··· 495 495 { 496 496 struct inode *inode = container_of(head, struct inode, i_rcu); 497 497 struct afs_vnode *vnode = AFS_FS_I(inode); 498 - INIT_LIST_HEAD(&inode->i_dentry); 499 498 kmem_cache_free(afs_inode_cachep, vnode); 500 499 } 501 500
+2 -2
fs/attr.c
··· 166 166 int notify_change(struct dentry * dentry, struct iattr * attr) 167 167 { 168 168 struct inode *inode = dentry->d_inode; 169 - mode_t mode = inode->i_mode; 169 + umode_t mode = inode->i_mode; 170 170 int error; 171 171 struct timespec now; 172 172 unsigned int ia_valid = attr->ia_valid; ··· 177 177 } 178 178 179 179 if ((ia_valid & ATTR_MODE)) { 180 - mode_t amode = attr->ia_mode; 180 + umode_t amode = attr->ia_mode; 181 181 /* Flag setting protected by i_mutex */ 182 182 if (is_sxid(amode)) 183 183 inode->i_flags &= ~S_NOSEC;
+1 -1
fs/autofs4/autofs_i.h
··· 155 155 return 0; 156 156 } 157 157 158 - struct inode *autofs4_get_inode(struct super_block *, mode_t); 158 + struct inode *autofs4_get_inode(struct super_block *, umode_t); 159 159 void autofs4_free_ino(struct autofs_info *); 160 160 161 161 /* Expiration */
+5 -5
fs/autofs4/dev-ioctl.c
··· 194 194 return err; 195 195 err = -ENOENT; 196 196 while (path.dentry == path.mnt->mnt_root) { 197 - if (path.mnt->mnt_sb->s_magic == AUTOFS_SUPER_MAGIC) { 197 + if (path.dentry->d_sb->s_magic == AUTOFS_SUPER_MAGIC) { 198 198 if (test(&path, data)) { 199 199 path_get(&path); 200 200 if (!err) /* already found some */ ··· 212 212 213 213 static int test_by_dev(struct path *path, void *p) 214 214 { 215 - return path->mnt->mnt_sb->s_dev == *(dev_t *)p; 215 + return path->dentry->d_sb->s_dev == *(dev_t *)p; 216 216 } 217 217 218 218 static int test_by_type(struct path *path, void *p) ··· 538 538 err = find_autofs_mount(name, &path, test_by_type, &type); 539 539 if (err) 540 540 goto out; 541 - devid = new_encode_dev(path.mnt->mnt_sb->s_dev); 541 + devid = new_encode_dev(path.dentry->d_sb->s_dev); 542 542 err = 0; 543 543 if (path.mnt->mnt_root == path.dentry) { 544 544 err = 1; 545 - magic = path.mnt->mnt_sb->s_magic; 545 + magic = path.dentry->d_sb->s_magic; 546 546 } 547 547 } else { 548 548 dev_t dev = sbi->sb->s_dev; ··· 556 556 err = have_submounts(path.dentry); 557 557 558 558 if (follow_down_one(&path)) 559 - magic = path.mnt->mnt_sb->s_magic; 559 + magic = path.dentry->d_sb->s_magic; 560 560 } 561 561 562 562 param->ismountpoint.out.devid = devid;
+4 -4
fs/autofs4/inode.c
··· 70 70 kill_litter_super(sb); 71 71 } 72 72 73 - static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt) 73 + static int autofs4_show_options(struct seq_file *m, struct dentry *root) 74 74 { 75 - struct autofs_sb_info *sbi = autofs4_sbi(mnt->mnt_sb); 76 - struct inode *root_inode = mnt->mnt_sb->s_root->d_inode; 75 + struct autofs_sb_info *sbi = autofs4_sbi(root->d_sb); 76 + struct inode *root_inode = root->d_sb->s_root->d_inode; 77 77 78 78 if (!sbi) 79 79 return 0; ··· 326 326 return -EINVAL; 327 327 } 328 328 329 - struct inode *autofs4_get_inode(struct super_block *sb, mode_t mode) 329 + struct inode *autofs4_get_inode(struct super_block *sb, umode_t mode) 330 330 { 331 331 struct inode *inode = new_inode(sb); 332 332
+2 -2
fs/autofs4/root.c
··· 26 26 static int autofs4_dir_symlink(struct inode *,struct dentry *,const char *); 27 27 static int autofs4_dir_unlink(struct inode *,struct dentry *); 28 28 static int autofs4_dir_rmdir(struct inode *,struct dentry *); 29 - static int autofs4_dir_mkdir(struct inode *,struct dentry *,int); 29 + static int autofs4_dir_mkdir(struct inode *,struct dentry *,umode_t); 30 30 static long autofs4_root_ioctl(struct file *,unsigned int,unsigned long); 31 31 #ifdef CONFIG_COMPAT 32 32 static long autofs4_root_compat_ioctl(struct file *,unsigned int,unsigned long); ··· 699 699 return 0; 700 700 } 701 701 702 - static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, int mode) 702 + static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 703 703 { 704 704 struct autofs_sb_info *sbi = autofs4_sbi(dir->i_sb); 705 705 struct autofs_info *ino = autofs4_dentry_ino(dentry);
+3 -3
fs/bad_inode.c
··· 173 173 }; 174 174 175 175 static int bad_inode_create (struct inode *dir, struct dentry *dentry, 176 - int mode, struct nameidata *nd) 176 + umode_t mode, struct nameidata *nd) 177 177 { 178 178 return -EIO; 179 179 } ··· 202 202 } 203 203 204 204 static int bad_inode_mkdir(struct inode *dir, struct dentry *dentry, 205 - int mode) 205 + umode_t mode) 206 206 { 207 207 return -EIO; 208 208 } ··· 213 213 } 214 214 215 215 static int bad_inode_mknod (struct inode *dir, struct dentry *dentry, 216 - int mode, dev_t rdev) 216 + umode_t mode, dev_t rdev) 217 217 { 218 218 return -EIO; 219 219 }
-1
fs/befs/linuxvfs.c
··· 286 286 static void befs_i_callback(struct rcu_head *head) 287 287 { 288 288 struct inode *inode = container_of(head, struct inode, i_rcu); 289 - INIT_LIST_HEAD(&inode->i_dentry); 290 289 kmem_cache_free(befs_inode_cachep, BEFS_I(inode)); 291 290 } 292 291
+1 -1
fs/bfs/dir.c
··· 84 84 85 85 extern void dump_imap(const char *, struct super_block *); 86 86 87 - static int bfs_create(struct inode *dir, struct dentry *dentry, int mode, 87 + static int bfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 88 88 struct nameidata *nd) 89 89 { 90 90 int err;
-1
fs/bfs/inode.c
··· 251 251 static void bfs_i_callback(struct rcu_head *head) 252 252 { 253 253 struct inode *inode = container_of(head, struct inode, i_rcu); 254 - INIT_LIST_HEAD(&inode->i_dentry); 255 254 kmem_cache_free(bfs_inode_cachep, BFS_I(inode)); 256 255 } 257 256
+3 -3
fs/binfmt_misc.c
··· 560 560 break; 561 561 case 2: set_bit(Enabled, &e->flags); 562 562 break; 563 - case 3: root = dget(file->f_path.mnt->mnt_sb->s_root); 563 + case 3: root = dget(file->f_path.dentry->d_sb->s_root); 564 564 mutex_lock(&root->d_inode->i_mutex); 565 565 566 566 kill_node(e); ··· 587 587 Node *e; 588 588 struct inode *inode; 589 589 struct dentry *root, *dentry; 590 - struct super_block *sb = file->f_path.mnt->mnt_sb; 590 + struct super_block *sb = file->f_path.dentry->d_sb; 591 591 int err = 0; 592 592 593 593 e = create_entry(buffer, count); ··· 666 666 switch (res) { 667 667 case 1: enabled = 0; break; 668 668 case 2: enabled = 1; break; 669 - case 3: root = dget(file->f_path.mnt->mnt_sb->s_root); 669 + case 3: root = dget(file->f_path.dentry->d_sb->s_root); 670 670 mutex_lock(&root->d_inode->i_mutex); 671 671 672 672 while (!list_empty(&entries))
+33 -5
fs/block_dev.c
··· 17 17 #include <linux/module.h> 18 18 #include <linux/blkpg.h> 19 19 #include <linux/buffer_head.h> 20 + #include <linux/swap.h> 20 21 #include <linux/pagevec.h> 21 22 #include <linux/writeback.h> 22 23 #include <linux/mpage.h> ··· 26 25 #include <linux/namei.h> 27 26 #include <linux/log2.h> 28 27 #include <linux/kmemleak.h> 28 + #include <linux/cleancache.h> 29 29 #include <asm/uaccess.h> 30 30 #include "internal.h" 31 31 ··· 84 82 } 85 83 86 84 /* Kill _all_ buffers and pagecache , dirty or not.. */ 87 - static void kill_bdev(struct block_device *bdev) 85 + void kill_bdev(struct block_device *bdev) 88 86 { 89 - if (bdev->bd_inode->i_mapping->nrpages == 0) 87 + struct address_space *mapping = bdev->bd_inode->i_mapping; 88 + 89 + if (mapping->nrpages == 0) 90 90 return; 91 + 91 92 invalidate_bh_lrus(); 92 - truncate_inode_pages(bdev->bd_inode->i_mapping, 0); 93 + truncate_inode_pages(mapping, 0); 93 94 } 95 + EXPORT_SYMBOL(kill_bdev); 96 + 97 + /* Invalidate clean unused buffers and pagecache. */ 98 + void invalidate_bdev(struct block_device *bdev) 99 + { 100 + struct address_space *mapping = bdev->bd_inode->i_mapping; 101 + 102 + if (mapping->nrpages == 0) 103 + return; 104 + 105 + invalidate_bh_lrus(); 106 + lru_add_drain_all(); /* make sure all lru add caches are flushed */ 107 + invalidate_mapping_pages(mapping, 0, -1); 108 + /* 99% of the time, we don't need to flush the cleancache on the bdev. 109 + * But, for the strange corners, lets be cautious 110 + */ 111 + cleancache_flush_inode(mapping); 112 + } 113 + EXPORT_SYMBOL(invalidate_bdev); 94 114 95 115 int set_blocksize(struct block_device *bdev, int size) 96 116 { ··· 449 425 struct inode *inode = container_of(head, struct inode, i_rcu); 450 426 struct bdev_inode *bdi = BDEV_I(inode); 451 427 452 - INIT_LIST_HEAD(&inode->i_dentry); 453 428 kmem_cache_free(bdev_cachep, bdi); 454 429 } 455 430 ··· 516 493 .kill_sb = kill_anon_super, 517 494 }; 518 495 519 - struct super_block *blockdev_superblock __read_mostly; 496 + static struct super_block *blockdev_superblock __read_mostly; 520 497 521 498 void __init bdev_cache_init(void) 522 499 { ··· 660 637 spin_unlock(&bdev_lock); 661 638 } 662 639 return bdev; 640 + } 641 + 642 + static inline int sb_is_blkdev_sb(struct super_block *sb) 643 + { 644 + return sb == blockdev_superblock; 663 645 } 664 646 665 647 /* Call when you free inode */
+5 -6
fs/btrfs/inode.c
··· 4412 4412 struct btrfs_root *root, 4413 4413 struct inode *dir, 4414 4414 const char *name, int name_len, 4415 - u64 ref_objectid, u64 objectid, int mode, 4416 - u64 *index) 4415 + u64 ref_objectid, u64 objectid, 4416 + umode_t mode, u64 *index) 4417 4417 { 4418 4418 struct inode *inode; 4419 4419 struct btrfs_inode_item *inode_item; ··· 4596 4596 } 4597 4597 4598 4598 static int btrfs_mknod(struct inode *dir, struct dentry *dentry, 4599 - int mode, dev_t rdev) 4599 + umode_t mode, dev_t rdev) 4600 4600 { 4601 4601 struct btrfs_trans_handle *trans; 4602 4602 struct btrfs_root *root = BTRFS_I(dir)->root; ··· 4665 4665 } 4666 4666 4667 4667 static int btrfs_create(struct inode *dir, struct dentry *dentry, 4668 - int mode, struct nameidata *nd) 4668 + umode_t mode, struct nameidata *nd) 4669 4669 { 4670 4670 struct btrfs_trans_handle *trans; 4671 4671 struct btrfs_root *root = BTRFS_I(dir)->root; ··· 4792 4792 return err; 4793 4793 } 4794 4794 4795 - static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 4795 + static int btrfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 4796 4796 { 4797 4797 struct inode *inode = NULL; 4798 4798 struct btrfs_trans_handle *trans; ··· 6761 6761 static void btrfs_i_callback(struct rcu_head *head) 6762 6762 { 6763 6763 struct inode *inode = container_of(head, struct inode, i_rcu); 6764 - INIT_LIST_HEAD(&inode->i_dentry); 6765 6764 kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); 6766 6765 } 6767 6766
+11 -11
fs/btrfs/ioctl.c
··· 201 201 } 202 202 } 203 203 204 - ret = mnt_want_write(file->f_path.mnt); 204 + ret = mnt_want_write_file(file); 205 205 if (ret) 206 206 goto out_unlock; 207 207 ··· 259 259 260 260 btrfs_end_transaction(trans, root); 261 261 262 - mnt_drop_write(file->f_path.mnt); 262 + mnt_drop_write_file(file); 263 263 264 264 ret = 0; 265 265 out_unlock: ··· 1855 1855 goto out; 1856 1856 } 1857 1857 1858 - err = mnt_want_write(file->f_path.mnt); 1858 + err = mnt_want_write_file(file); 1859 1859 if (err) 1860 1860 goto out; 1861 1861 ··· 1971 1971 dput(dentry); 1972 1972 out_unlock_dir: 1973 1973 mutex_unlock(&dir->i_mutex); 1974 - mnt_drop_write(file->f_path.mnt); 1974 + mnt_drop_write_file(file); 1975 1975 out: 1976 1976 kfree(vol_args); 1977 1977 return err; ··· 1987 1987 if (btrfs_root_readonly(root)) 1988 1988 return -EROFS; 1989 1989 1990 - ret = mnt_want_write(file->f_path.mnt); 1990 + ret = mnt_want_write_file(file); 1991 1991 if (ret) 1992 1992 return ret; 1993 1993 ··· 2040 2040 ret = -EINVAL; 2041 2041 } 2042 2042 out: 2043 - mnt_drop_write(file->f_path.mnt); 2043 + mnt_drop_write_file(file); 2044 2044 return ret; 2045 2045 } 2046 2046 ··· 2195 2195 if (btrfs_root_readonly(root)) 2196 2196 return -EROFS; 2197 2197 2198 - ret = mnt_want_write(file->f_path.mnt); 2198 + ret = mnt_want_write_file(file); 2199 2199 if (ret) 2200 2200 return ret; 2201 2201 ··· 2510 2510 out_fput: 2511 2511 fput(src_file); 2512 2512 out_drop_write: 2513 - mnt_drop_write(file->f_path.mnt); 2513 + mnt_drop_write_file(file); 2514 2514 return ret; 2515 2515 } 2516 2516 ··· 2549 2549 if (btrfs_root_readonly(root)) 2550 2550 goto out; 2551 2551 2552 - ret = mnt_want_write(file->f_path.mnt); 2552 + ret = mnt_want_write_file(file); 2553 2553 if (ret) 2554 2554 goto out; 2555 2555 ··· 2565 2565 2566 2566 out_drop: 2567 2567 atomic_dec(&root->fs_info->open_ioctl_trans); 2568 - mnt_drop_write(file->f_path.mnt); 2568 + mnt_drop_write_file(file); 2569 2569 out: 2570 2570 return ret; 2571 2571 } ··· 2800 2800 2801 2801 atomic_dec(&root->fs_info->open_ioctl_trans); 2802 2802 2803 - mnt_drop_write(file->f_path.mnt); 2803 + mnt_drop_write_file(file); 2804 2804 return 0; 2805 2805 } 2806 2806
+2 -3
fs/btrfs/super.c
··· 40 40 #include <linux/magic.h> 41 41 #include <linux/slab.h> 42 42 #include <linux/cleancache.h> 43 - #include <linux/mnt_namespace.h> 44 43 #include <linux/ratelimit.h> 45 44 #include "compat.h" 46 45 #include "delayed-inode.h" ··· 661 662 return ret; 662 663 } 663 664 664 - static int btrfs_show_options(struct seq_file *seq, struct vfsmount *vfs) 665 + static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry) 665 666 { 666 - struct btrfs_root *root = btrfs_sb(vfs->mnt_sb); 667 + struct btrfs_root *root = btrfs_sb(dentry->d_sb); 667 668 struct btrfs_fs_info *info = root->fs_info; 668 669 char *compress_type; 669 670
-50
fs/buffer.c
··· 41 41 #include <linux/bitops.h> 42 42 #include <linux/mpage.h> 43 43 #include <linux/bit_spinlock.h> 44 - #include <linux/cleancache.h> 45 44 46 45 static int fsync_buffers_list(spinlock_t *lock, struct list_head *list); 47 46 ··· 229 230 out: 230 231 return ret; 231 232 } 232 - 233 - /* If invalidate_buffers() will trash dirty buffers, it means some kind 234 - of fs corruption is going on. Trashing dirty data always imply losing 235 - information that was supposed to be just stored on the physical layer 236 - by the user. 237 - 238 - Thus invalidate_buffers in general usage is not allwowed to trash 239 - dirty buffers. For example ioctl(FLSBLKBUF) expects dirty data to 240 - be preserved. These buffers are simply skipped. 241 - 242 - We also skip buffers which are still in use. For example this can 243 - happen if a userspace program is reading the block device. 244 - 245 - NOTE: In the case where the user removed a removable-media-disk even if 246 - there's still dirty data not synced on disk (due a bug in the device driver 247 - or due an error of the user), by not destroying the dirty buffers we could 248 - generate corruption also on the next media inserted, thus a parameter is 249 - necessary to handle this case in the most safe way possible (trying 250 - to not corrupt also the new disk inserted with the data belonging to 251 - the old now corrupted disk). Also for the ramdisk the natural thing 252 - to do in order to release the ramdisk memory is to destroy dirty buffers. 253 - 254 - These are two special cases. Normal usage imply the device driver 255 - to issue a sync on the device (without waiting I/O completion) and 256 - then an invalidate_buffers call that doesn't trash dirty buffers. 257 - 258 - For handling cache coherency with the blkdev pagecache the 'update' case 259 - is been introduced. It is needed to re-read from disk any pinned 260 - buffer. NOTE: re-reading from disk is destructive so we can do it only 261 - when we assume nobody is changing the buffercache under our I/O and when 262 - we think the disk contains more recent information than the buffercache. 263 - The update == 1 pass marks the buffers we need to update, the update == 2 264 - pass does the actual I/O. */ 265 - void invalidate_bdev(struct block_device *bdev) 266 - { 267 - struct address_space *mapping = bdev->bd_inode->i_mapping; 268 - 269 - if (mapping->nrpages == 0) 270 - return; 271 - 272 - invalidate_bh_lrus(); 273 - lru_add_drain_all(); /* make sure all lru add caches are flushed */ 274 - invalidate_mapping_pages(mapping, 0, -1); 275 - /* 99% of the time, we don't need to flush the cleancache on the bdev. 276 - * But, for the strange corners, lets be cautious 277 - */ 278 - cleancache_flush_inode(mapping); 279 - } 280 - EXPORT_SYMBOL(invalidate_bdev); 281 233 282 234 /* 283 235 * Kick the writeback threads then try to free up some ZONE_NORMAL memory.
-1
fs/cachefiles/interface.c
··· 11 11 12 12 #include <linux/slab.h> 13 13 #include <linux/mount.h> 14 - #include <linux/buffer_head.h> 15 14 #include "internal.h" 16 15 17 16 #define list_to_page(head) (list_entry((head)->prev, struct page, lru))
+2 -2
fs/ceph/caps.c
··· 928 928 u64 size, u64 max_size, 929 929 struct timespec *mtime, struct timespec *atime, 930 930 u64 time_warp_seq, 931 - uid_t uid, gid_t gid, mode_t mode, 931 + uid_t uid, gid_t gid, umode_t mode, 932 932 u64 xattr_version, 933 933 struct ceph_buffer *xattrs_buf, 934 934 u64 follows) ··· 1078 1078 u64 size, max_size; 1079 1079 struct timespec mtime, atime; 1080 1080 int wake = 0; 1081 - mode_t mode; 1081 + umode_t mode; 1082 1082 uid_t uid; 1083 1083 gid_t gid; 1084 1084 struct ceph_mds_session *session;
+6 -6
fs/ceph/dir.c
··· 666 666 } 667 667 668 668 static int ceph_mknod(struct inode *dir, struct dentry *dentry, 669 - int mode, dev_t rdev) 669 + umode_t mode, dev_t rdev) 670 670 { 671 671 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); 672 672 struct ceph_mds_client *mdsc = fsc->mdsc; ··· 676 676 if (ceph_snap(dir) != CEPH_NOSNAP) 677 677 return -EROFS; 678 678 679 - dout("mknod in dir %p dentry %p mode 0%o rdev %d\n", 679 + dout("mknod in dir %p dentry %p mode 0%ho rdev %d\n", 680 680 dir, dentry, mode, rdev); 681 681 req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_MKNOD, USE_AUTH_MDS); 682 682 if (IS_ERR(req)) { ··· 699 699 return err; 700 700 } 701 701 702 - static int ceph_create(struct inode *dir, struct dentry *dentry, int mode, 702 + static int ceph_create(struct inode *dir, struct dentry *dentry, umode_t mode, 703 703 struct nameidata *nd) 704 704 { 705 705 dout("create in dir %p dentry %p name '%.*s'\n", ··· 753 753 return err; 754 754 } 755 755 756 - static int ceph_mkdir(struct inode *dir, struct dentry *dentry, int mode) 756 + static int ceph_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 757 757 { 758 758 struct ceph_fs_client *fsc = ceph_sb_to_client(dir->i_sb); 759 759 struct ceph_mds_client *mdsc = fsc->mdsc; ··· 767 767 dout("mksnap dir %p snap '%.*s' dn %p\n", dir, 768 768 dentry->d_name.len, dentry->d_name.name, dentry); 769 769 } else if (ceph_snap(dir) == CEPH_NOSNAP) { 770 - dout("mkdir dir %p dn %p mode 0%o\n", dir, dentry, mode); 770 + dout("mkdir dir %p dn %p mode 0%ho\n", dir, dentry, mode); 771 771 op = CEPH_MDS_OP_MKDIR; 772 772 } else { 773 773 goto out; ··· 870 870 } else if (ceph_snap(dir) == CEPH_NOSNAP) { 871 871 dout("unlink/rmdir dir %p dn %p inode %p\n", 872 872 dir, dentry, inode); 873 - op = ((dentry->d_inode->i_mode & S_IFMT) == S_IFDIR) ? 873 + op = S_ISDIR(dentry->d_inode->i_mode) ? 874 874 CEPH_MDS_OP_RMDIR : CEPH_MDS_OP_UNLINK; 875 875 } else 876 876 goto out;
-1
fs/ceph/inode.c
··· 384 384 struct inode *inode = container_of(head, struct inode, i_rcu); 385 385 struct ceph_inode_info *ci = ceph_inode(inode); 386 386 387 - INIT_LIST_HEAD(&inode->i_dentry); 388 387 kmem_cache_free(ceph_inode_cachep, ci); 389 388 } 390 389
+3 -3
fs/ceph/super.c
··· 341 341 /** 342 342 * ceph_show_options - Show mount options in /proc/mounts 343 343 * @m: seq_file to write to 344 - * @mnt: mount descriptor 344 + * @root: root of that (sub)tree 345 345 */ 346 - static int ceph_show_options(struct seq_file *m, struct vfsmount *mnt) 346 + static int ceph_show_options(struct seq_file *m, struct dentry *root) 347 347 { 348 - struct ceph_fs_client *fsc = ceph_sb_to_client(mnt->mnt_sb); 348 + struct ceph_fs_client *fsc = ceph_sb_to_client(root->d_sb); 349 349 struct ceph_mount_options *fsopt = fsc->mount_options; 350 350 struct ceph_options *opt = fsc->client->options; 351 351
+1 -1
fs/ceph/super.h
··· 136 136 int issued, dirty; 137 137 struct ceph_snap_context *context; 138 138 139 - mode_t mode; 139 + umode_t mode; 140 140 uid_t uid; 141 141 gid_t gid; 142 142
+2 -2
fs/cifs/cifs_fs_sb.h
··· 59 59 gid_t mnt_gid; 60 60 uid_t mnt_backupuid; 61 61 gid_t mnt_backupgid; 62 - mode_t mnt_file_mode; 63 - mode_t mnt_dir_mode; 62 + umode_t mnt_file_mode; 63 + umode_t mnt_dir_mode; 64 64 unsigned int mnt_cifs_flags; 65 65 char *mountdata; /* options received at mount time or via DFS refs */ 66 66 struct backing_dev_info bdi;
+5 -5
fs/cifs/cifsfs.c
··· 343 343 * ones are. 344 344 */ 345 345 static int 346 - cifs_show_options(struct seq_file *s, struct vfsmount *m) 346 + cifs_show_options(struct seq_file *s, struct dentry *root) 347 347 { 348 - struct cifs_sb_info *cifs_sb = CIFS_SB(m->mnt_sb); 348 + struct cifs_sb_info *cifs_sb = CIFS_SB(root->d_sb); 349 349 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); 350 350 struct sockaddr *srcaddr; 351 351 srcaddr = (struct sockaddr *)&tcon->ses->server->srcaddr; ··· 393 393 cifs_show_address(s, tcon->ses->server); 394 394 395 395 if (!tcon->unix_ext) 396 - seq_printf(s, ",file_mode=0%o,dir_mode=0%o", 396 + seq_printf(s, ",file_mode=0%ho,dir_mode=0%ho", 397 397 cifs_sb->mnt_file_mode, 398 398 cifs_sb->mnt_dir_mode); 399 399 if (tcon->seal) ··· 430 430 seq_printf(s, ",cifsacl"); 431 431 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) 432 432 seq_printf(s, ",dynperm"); 433 - if (m->mnt_sb->s_flags & MS_POSIXACL) 433 + if (root->d_sb->s_flags & MS_POSIXACL) 434 434 seq_printf(s, ",acl"); 435 435 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) 436 436 seq_printf(s, ",mfsymlinks"); ··· 488 488 } 489 489 490 490 #ifdef CONFIG_CIFS_STATS2 491 - static int cifs_show_stats(struct seq_file *s, struct vfsmount *mnt) 491 + static int cifs_show_stats(struct seq_file *s, struct dentry *root) 492 492 { 493 493 /* BB FIXME */ 494 494 return 0;
+3 -3
fs/cifs/cifsfs.h
··· 44 44 /* Functions related to inodes */ 45 45 extern const struct inode_operations cifs_dir_inode_ops; 46 46 extern struct inode *cifs_root_iget(struct super_block *); 47 - extern int cifs_create(struct inode *, struct dentry *, int, 47 + extern int cifs_create(struct inode *, struct dentry *, umode_t, 48 48 struct nameidata *); 49 49 extern struct dentry *cifs_lookup(struct inode *, struct dentry *, 50 50 struct nameidata *); 51 51 extern int cifs_unlink(struct inode *dir, struct dentry *dentry); 52 52 extern int cifs_hardlink(struct dentry *, struct inode *, struct dentry *); 53 - extern int cifs_mknod(struct inode *, struct dentry *, int, dev_t); 54 - extern int cifs_mkdir(struct inode *, struct dentry *, int); 53 + extern int cifs_mknod(struct inode *, struct dentry *, umode_t, dev_t); 54 + extern int cifs_mkdir(struct inode *, struct dentry *, umode_t); 55 55 extern int cifs_rmdir(struct inode *, struct dentry *); 56 56 extern int cifs_rename(struct inode *, struct dentry *, struct inode *, 57 57 struct dentry *);
+2 -2
fs/cifs/cifsglob.h
··· 169 169 gid_t linux_gid; 170 170 uid_t backupuid; 171 171 gid_t backupgid; 172 - mode_t file_mode; 173 - mode_t dir_mode; 172 + umode_t file_mode; 173 + umode_t dir_mode; 174 174 unsigned secFlg; 175 175 bool retry:1; 176 176 bool intr:1;
+1 -1
fs/cifs/connect.c
··· 2819 2819 cifs_sb->mnt_backupgid = pvolume_info->backupgid; 2820 2820 cifs_sb->mnt_file_mode = pvolume_info->file_mode; 2821 2821 cifs_sb->mnt_dir_mode = pvolume_info->dir_mode; 2822 - cFYI(1, "file mode: 0x%x dir mode: 0x%x", 2822 + cFYI(1, "file mode: 0x%hx dir mode: 0x%hx", 2823 2823 cifs_sb->mnt_file_mode, cifs_sb->mnt_dir_mode); 2824 2824 2825 2825 cifs_sb->actimeo = pvolume_info->actimeo;
+2 -2
fs/cifs/dir.c
··· 136 136 /* Inode operations in similar order to how they appear in Linux file fs.h */ 137 137 138 138 int 139 - cifs_create(struct inode *inode, struct dentry *direntry, int mode, 139 + cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode, 140 140 struct nameidata *nd) 141 141 { 142 142 int rc = -ENOENT; ··· 355 355 return rc; 356 356 } 357 357 358 - int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, 358 + int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, 359 359 dev_t device_number) 360 360 { 361 361 int rc = -EPERM;
+2 -2
fs/cifs/inode.c
··· 1264 1264 return rc; 1265 1265 } 1266 1266 1267 - int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) 1267 + int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) 1268 1268 { 1269 1269 int rc = 0, tmprc; 1270 1270 int xid; ··· 1275 1275 struct inode *newinode = NULL; 1276 1276 struct cifs_fattr fattr; 1277 1277 1278 - cFYI(1, "In cifs_mkdir, mode = 0x%x inode = 0x%p", mode, inode); 1278 + cFYI(1, "In cifs_mkdir, mode = 0x%hx inode = 0x%p", mode, inode); 1279 1279 1280 1280 cifs_sb = CIFS_SB(inode->i_sb); 1281 1281 tlink = cifs_sb_tlink(cifs_sb);
+4 -4
fs/coda/dir.c
··· 30 30 #include "coda_int.h" 31 31 32 32 /* dir inode-ops */ 33 - static int coda_create(struct inode *dir, struct dentry *new, int mode, struct nameidata *nd); 33 + static int coda_create(struct inode *dir, struct dentry *new, umode_t mode, struct nameidata *nd); 34 34 static struct dentry *coda_lookup(struct inode *dir, struct dentry *target, struct nameidata *nd); 35 35 static int coda_link(struct dentry *old_dentry, struct inode *dir_inode, 36 36 struct dentry *entry); 37 37 static int coda_unlink(struct inode *dir_inode, struct dentry *entry); 38 38 static int coda_symlink(struct inode *dir_inode, struct dentry *entry, 39 39 const char *symname); 40 - static int coda_mkdir(struct inode *dir_inode, struct dentry *entry, int mode); 40 + static int coda_mkdir(struct inode *dir_inode, struct dentry *entry, umode_t mode); 41 41 static int coda_rmdir(struct inode *dir_inode, struct dentry *entry); 42 42 static int coda_rename(struct inode *old_inode, struct dentry *old_dentry, 43 43 struct inode *new_inode, struct dentry *new_dentry); ··· 191 191 } 192 192 193 193 /* creation routines: create, mknod, mkdir, link, symlink */ 194 - static int coda_create(struct inode *dir, struct dentry *de, int mode, struct nameidata *nd) 194 + static int coda_create(struct inode *dir, struct dentry *de, umode_t mode, struct nameidata *nd) 195 195 { 196 196 int error; 197 197 const char *name=de->d_name.name; ··· 223 223 return error; 224 224 } 225 225 226 - static int coda_mkdir(struct inode *dir, struct dentry *de, int mode) 226 + static int coda_mkdir(struct inode *dir, struct dentry *de, umode_t mode) 227 227 { 228 228 struct inode *inode; 229 229 struct coda_vattr attrs;
-1
fs/coda/inode.c
··· 58 58 static void coda_i_callback(struct rcu_head *head) 59 59 { 60 60 struct inode *inode = container_of(head, struct inode, i_rcu); 61 - INIT_LIST_HEAD(&inode->i_dentry); 62 61 kmem_cache_free(coda_inode_cachep, ITOC(inode)); 63 62 } 64 63
+3 -10
fs/compat.c
··· 342 342 */ 343 343 asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u) 344 344 { 345 - struct super_block *sb; 346 345 struct compat_ustat tmp; 347 346 struct kstatfs sbuf; 348 - int err; 349 - 350 - sb = user_get_super(new_decode_dev(dev)); 351 - if (!sb) 352 - return -EINVAL; 353 - err = statfs_by_dentry(sb->s_root, &sbuf); 354 - drop_super(sb); 347 + int err = vfs_ustat(new_decode_dev(dev), &sbuf); 355 348 if (err) 356 349 return err; 357 350 ··· 1281 1288 * O_LARGEFILE flag. 1282 1289 */ 1283 1290 asmlinkage long 1284 - compat_sys_open(const char __user *filename, int flags, int mode) 1291 + compat_sys_open(const char __user *filename, int flags, umode_t mode) 1285 1292 { 1286 1293 return do_sys_open(AT_FDCWD, filename, flags, mode); 1287 1294 } ··· 1291 1298 * O_LARGEFILE flag. 1292 1299 */ 1293 1300 asmlinkage long 1294 - compat_sys_openat(unsigned int dfd, const char __user *filename, int flags, int mode) 1301 + compat_sys_openat(unsigned int dfd, const char __user *filename, int flags, umode_t mode) 1295 1302 { 1296 1303 return do_sys_open(dfd, filename, flags, mode); 1297 1304 }
+2 -2
fs/configfs/configfs_internal.h
··· 63 63 64 64 extern int configfs_is_root(struct config_item *item); 65 65 66 - extern struct inode * configfs_new_inode(mode_t mode, struct configfs_dirent *); 67 - extern int configfs_create(struct dentry *, int mode, int (*init)(struct inode *)); 66 + extern struct inode * configfs_new_inode(umode_t mode, struct configfs_dirent *); 67 + extern int configfs_create(struct dentry *, umode_t mode, int (*init)(struct inode *)); 68 68 extern int configfs_inode_init(void); 69 69 extern void configfs_inode_exit(void); 70 70
+3 -3
fs/configfs/dir.c
··· 311 311 312 312 if (item->ci_parent) 313 313 parent = item->ci_parent->ci_dentry; 314 - else if (configfs_mount && configfs_mount->mnt_sb) 315 - parent = configfs_mount->mnt_sb->s_root; 314 + else if (configfs_mount) 315 + parent = configfs_mount->mnt_root; 316 316 else 317 317 return -EFAULT; 318 318 ··· 1170 1170 } 1171 1171 EXPORT_SYMBOL(configfs_undepend_item); 1172 1172 1173 - static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 1173 + static int configfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 1174 1174 { 1175 1175 int ret = 0; 1176 1176 int module_got = 0;
+3 -3
fs/configfs/inode.c
··· 116 116 return error; 117 117 } 118 118 119 - static inline void set_default_inode_attr(struct inode * inode, mode_t mode) 119 + static inline void set_default_inode_attr(struct inode * inode, umode_t mode) 120 120 { 121 121 inode->i_mode = mode; 122 122 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; ··· 132 132 inode->i_ctime = iattr->ia_ctime; 133 133 } 134 134 135 - struct inode * configfs_new_inode(mode_t mode, struct configfs_dirent * sd) 135 + struct inode *configfs_new_inode(umode_t mode, struct configfs_dirent * sd) 136 136 { 137 137 struct inode * inode = new_inode(configfs_sb); 138 138 if (inode) { ··· 185 185 186 186 #endif /* CONFIG_LOCKDEP */ 187 187 188 - int configfs_create(struct dentry * dentry, int mode, int (*init)(struct inode *)) 188 + int configfs_create(struct dentry * dentry, umode_t mode, int (*init)(struct inode *)) 189 189 { 190 190 int error = 0; 191 191 struct inode * inode = NULL;
+1 -2
fs/cramfs/inode.c
··· 20 20 #include <linux/cramfs_fs.h> 21 21 #include <linux/slab.h> 22 22 #include <linux/cramfs_fs_sb.h> 23 - #include <linux/buffer_head.h> 24 23 #include <linux/vfs.h> 25 24 #include <linux/mutex.h> 26 25 ··· 377 378 unsigned long nextoffset; 378 379 char *name; 379 380 ino_t ino; 380 - mode_t mode; 381 + umode_t mode; 381 382 int namelen, error; 382 383 383 384 mutex_lock(&read_mutex);
+7 -30
fs/dcache.c
··· 38 38 #include <linux/prefetch.h> 39 39 #include <linux/ratelimit.h> 40 40 #include "internal.h" 41 + #include "mount.h" 41 42 42 43 /* 43 44 * Usage: ··· 2452 2451 { 2453 2452 struct dentry *dentry = path->dentry; 2454 2453 struct vfsmount *vfsmnt = path->mnt; 2454 + struct mount *mnt = real_mount(vfsmnt); 2455 2455 bool slash = false; 2456 2456 int error = 0; 2457 2457 ··· 2462 2460 2463 2461 if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) { 2464 2462 /* Global root? */ 2465 - if (vfsmnt->mnt_parent == vfsmnt) { 2463 + if (!mnt_has_parent(mnt)) 2466 2464 goto global_root; 2467 - } 2468 - dentry = vfsmnt->mnt_mountpoint; 2469 - vfsmnt = vfsmnt->mnt_parent; 2465 + dentry = mnt->mnt_mountpoint; 2466 + mnt = mnt->mnt_parent; 2467 + vfsmnt = &mnt->mnt; 2470 2468 continue; 2471 2469 } 2472 2470 parent = dentry->d_parent; ··· 2503 2501 if (!slash) 2504 2502 error = prepend(buffer, buflen, "/", 1); 2505 2503 if (!error) 2506 - error = vfsmnt->mnt_ns ? 1 : 2; 2504 + error = real_mount(vfsmnt)->mnt_ns ? 1 : 2; 2507 2505 goto out; 2508 2506 } 2509 2507 ··· 2854 2852 2855 2853 return result; 2856 2854 } 2857 - 2858 - int path_is_under(struct path *path1, struct path *path2) 2859 - { 2860 - struct vfsmount *mnt = path1->mnt; 2861 - struct dentry *dentry = path1->dentry; 2862 - int res; 2863 - 2864 - br_read_lock(vfsmount_lock); 2865 - if (mnt != path2->mnt) { 2866 - for (;;) { 2867 - if (mnt->mnt_parent == mnt) { 2868 - br_read_unlock(vfsmount_lock); 2869 - return 0; 2870 - } 2871 - if (mnt->mnt_parent == path2->mnt) 2872 - break; 2873 - mnt = mnt->mnt_parent; 2874 - } 2875 - dentry = mnt->mnt_mountpoint; 2876 - } 2877 - res = is_subdir(dentry, path2->dentry); 2878 - br_read_unlock(vfsmount_lock); 2879 - return res; 2880 - } 2881 - EXPORT_SYMBOL(path_is_under); 2882 2855 2883 2856 void d_genocide(struct dentry *root) 2884 2857 {
+11 -11
fs/debugfs/file.c
··· 97 97 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling 98 98 * code. 99 99 */ 100 - struct dentry *debugfs_create_u8(const char *name, mode_t mode, 100 + struct dentry *debugfs_create_u8(const char *name, umode_t mode, 101 101 struct dentry *parent, u8 *value) 102 102 { 103 103 /* if there are no write bits set, make read only */ ··· 149 149 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling 150 150 * code. 151 151 */ 152 - struct dentry *debugfs_create_u16(const char *name, mode_t mode, 152 + struct dentry *debugfs_create_u16(const char *name, umode_t mode, 153 153 struct dentry *parent, u16 *value) 154 154 { 155 155 /* if there are no write bits set, make read only */ ··· 201 201 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling 202 202 * code. 203 203 */ 204 - struct dentry *debugfs_create_u32(const char *name, mode_t mode, 204 + struct dentry *debugfs_create_u32(const char *name, umode_t mode, 205 205 struct dentry *parent, u32 *value) 206 206 { 207 207 /* if there are no write bits set, make read only */ ··· 254 254 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling 255 255 * code. 256 256 */ 257 - struct dentry *debugfs_create_u64(const char *name, mode_t mode, 257 + struct dentry *debugfs_create_u64(const char *name, umode_t mode, 258 258 struct dentry *parent, u64 *value) 259 259 { 260 260 /* if there are no write bits set, make read only */ ··· 300 300 * @value: a pointer to the variable that the file should read to and write 301 301 * from. 302 302 */ 303 - struct dentry *debugfs_create_x8(const char *name, mode_t mode, 303 + struct dentry *debugfs_create_x8(const char *name, umode_t mode, 304 304 struct dentry *parent, u8 *value) 305 305 { 306 306 /* if there are no write bits set, make read only */ ··· 324 324 * @value: a pointer to the variable that the file should read to and write 325 325 * from. 326 326 */ 327 - struct dentry *debugfs_create_x16(const char *name, mode_t mode, 327 + struct dentry *debugfs_create_x16(const char *name, umode_t mode, 328 328 struct dentry *parent, u16 *value) 329 329 { 330 330 /* if there are no write bits set, make read only */ ··· 348 348 * @value: a pointer to the variable that the file should read to and write 349 349 * from. 350 350 */ 351 - struct dentry *debugfs_create_x32(const char *name, mode_t mode, 351 + struct dentry *debugfs_create_x32(const char *name, umode_t mode, 352 352 struct dentry *parent, u32 *value) 353 353 { 354 354 /* if there are no write bits set, make read only */ ··· 372 372 * @value: a pointer to the variable that the file should read to and write 373 373 * from. 374 374 */ 375 - struct dentry *debugfs_create_x64(const char *name, mode_t mode, 375 + struct dentry *debugfs_create_x64(const char *name, umode_t mode, 376 376 struct dentry *parent, u64 *value) 377 377 { 378 378 return debugfs_create_file(name, mode, parent, value, &fops_x64); ··· 403 403 * @value: a pointer to the variable that the file should read to and write 404 404 * from. 405 405 */ 406 - struct dentry *debugfs_create_size_t(const char *name, mode_t mode, 406 + struct dentry *debugfs_create_size_t(const char *name, umode_t mode, 407 407 struct dentry *parent, size_t *value) 408 408 { 409 409 return debugfs_create_file(name, mode, parent, value, &fops_size_t); ··· 475 475 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling 476 476 * code. 477 477 */ 478 - struct dentry *debugfs_create_bool(const char *name, mode_t mode, 478 + struct dentry *debugfs_create_bool(const char *name, umode_t mode, 479 479 struct dentry *parent, u32 *value) 480 480 { 481 481 return debugfs_create_file(name, mode, parent, value, &fops_bool); ··· 520 520 * %NULL or !%NULL instead as to eliminate the need for #ifdef in the calling 521 521 * code. 522 522 */ 523 - struct dentry *debugfs_create_blob(const char *name, mode_t mode, 523 + struct dentry *debugfs_create_blob(const char *name, umode_t mode, 524 524 struct dentry *parent, 525 525 struct debugfs_blob_wrapper *blob) 526 526 {
+8 -8
fs/debugfs/inode.c
··· 30 30 static int debugfs_mount_count; 31 31 static bool debugfs_registered; 32 32 33 - static struct inode *debugfs_get_inode(struct super_block *sb, int mode, dev_t dev, 33 + static struct inode *debugfs_get_inode(struct super_block *sb, umode_t mode, dev_t dev, 34 34 void *data, const struct file_operations *fops) 35 35 36 36 { ··· 69 69 70 70 /* SMP-safe */ 71 71 static int debugfs_mknod(struct inode *dir, struct dentry *dentry, 72 - int mode, dev_t dev, void *data, 72 + umode_t mode, dev_t dev, void *data, 73 73 const struct file_operations *fops) 74 74 { 75 75 struct inode *inode; ··· 87 87 return error; 88 88 } 89 89 90 - static int debugfs_mkdir(struct inode *dir, struct dentry *dentry, int mode, 90 + static int debugfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode, 91 91 void *data, const struct file_operations *fops) 92 92 { 93 93 int res; ··· 101 101 return res; 102 102 } 103 103 104 - static int debugfs_link(struct inode *dir, struct dentry *dentry, int mode, 104 + static int debugfs_link(struct inode *dir, struct dentry *dentry, umode_t mode, 105 105 void *data, const struct file_operations *fops) 106 106 { 107 107 mode = (mode & S_IALLUGO) | S_IFLNK; 108 108 return debugfs_mknod(dir, dentry, mode, 0, data, fops); 109 109 } 110 110 111 - static int debugfs_create(struct inode *dir, struct dentry *dentry, int mode, 111 + static int debugfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 112 112 void *data, const struct file_operations *fops) 113 113 { 114 114 int res; ··· 146 146 .kill_sb = kill_litter_super, 147 147 }; 148 148 149 - static int debugfs_create_by_name(const char *name, mode_t mode, 149 + static int debugfs_create_by_name(const char *name, umode_t mode, 150 150 struct dentry *parent, 151 151 struct dentry **dentry, 152 152 void *data, ··· 160 160 * have around. 161 161 */ 162 162 if (!parent) 163 - parent = debugfs_mount->mnt_sb->s_root; 163 + parent = debugfs_mount->mnt_root; 164 164 165 165 *dentry = NULL; 166 166 mutex_lock(&parent->d_inode->i_mutex); ··· 214 214 * If debugfs is not enabled in the kernel, the value -%ENODEV will be 215 215 * returned. 216 216 */ 217 - struct dentry *debugfs_create_file(const char *name, mode_t mode, 217 + struct dentry *debugfs_create_file(const char *name, umode_t mode, 218 218 struct dentry *parent, void *data, 219 219 const struct file_operations *fops) 220 220 {
+2 -2
fs/devpts/inode.c
··· 246 246 return err; 247 247 } 248 248 249 - static int devpts_show_options(struct seq_file *seq, struct vfsmount *vfs) 249 + static int devpts_show_options(struct seq_file *seq, struct dentry *root) 250 250 { 251 - struct pts_fs_info *fsi = DEVPTS_SB(vfs->mnt_sb); 251 + struct pts_fs_info *fsi = DEVPTS_SB(root->d_sb); 252 252 struct pts_mount_opts *opts = &fsi->mount_opts; 253 253 254 254 if (opts->setuid)
+5 -24
fs/ecryptfs/inode.c
··· 144 144 } 145 145 146 146 /** 147 - * ecryptfs_create_underlying_file 148 - * @lower_dir_inode: inode of the parent in the lower fs of the new file 149 - * @dentry: New file's dentry 150 - * @mode: The mode of the new file 151 - * 152 - * Creates the file in the lower file system. 153 - * 154 - * Returns zero on success; non-zero on error condition 155 - */ 156 - static int 157 - ecryptfs_create_underlying_file(struct inode *lower_dir_inode, 158 - struct dentry *dentry, int mode) 159 - { 160 - struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry); 161 - return vfs_create(lower_dir_inode, lower_dentry, mode, NULL); 162 - } 163 - 164 - /** 165 147 * ecryptfs_do_create 166 148 * @directory_inode: inode of the new file's dentry's parent in ecryptfs 167 149 * @ecryptfs_dentry: New file's dentry in ecryptfs ··· 158 176 */ 159 177 static struct inode * 160 178 ecryptfs_do_create(struct inode *directory_inode, 161 - struct dentry *ecryptfs_dentry, int mode) 179 + struct dentry *ecryptfs_dentry, umode_t mode) 162 180 { 163 181 int rc; 164 182 struct dentry *lower_dentry; ··· 173 191 inode = ERR_CAST(lower_dir_dentry); 174 192 goto out; 175 193 } 176 - rc = ecryptfs_create_underlying_file(lower_dir_dentry->d_inode, 177 - ecryptfs_dentry, mode); 194 + rc = vfs_create(lower_dir_dentry->d_inode, lower_dentry, mode, NULL); 178 195 if (rc) { 179 196 printk(KERN_ERR "%s: Failure to create dentry in lower fs; " 180 197 "rc = [%d]\n", __func__, rc); ··· 248 267 */ 249 268 static int 250 269 ecryptfs_create(struct inode *directory_inode, struct dentry *ecryptfs_dentry, 251 - int mode, struct nameidata *nd) 270 + umode_t mode, struct nameidata *nd) 252 271 { 253 272 struct inode *ecryptfs_inode; 254 273 int rc; ··· 540 559 return rc; 541 560 } 542 561 543 - static int ecryptfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 562 + static int ecryptfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 544 563 { 545 564 int rc; 546 565 struct dentry *lower_dentry; ··· 588 607 } 589 608 590 609 static int 591 - ecryptfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev) 610 + ecryptfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) 592 611 { 593 612 int rc; 594 613 struct dentry *lower_dentry;
+2 -3
fs/ecryptfs/super.c
··· 69 69 struct ecryptfs_inode_info *inode_info; 70 70 inode_info = ecryptfs_inode_to_private(inode); 71 71 72 - INIT_LIST_HEAD(&inode->i_dentry); 73 72 kmem_cache_free(ecryptfs_inode_info_cache, inode_info); 74 73 } 75 74 ··· 131 132 * Prints the mount options for a given superblock. 132 133 * Returns zero; does not fail. 133 134 */ 134 - static int ecryptfs_show_options(struct seq_file *m, struct vfsmount *mnt) 135 + static int ecryptfs_show_options(struct seq_file *m, struct dentry *root) 135 136 { 136 - struct super_block *sb = mnt->mnt_sb; 137 + struct super_block *sb = root->d_sb; 137 138 struct ecryptfs_mount_crypt_stat *mount_crypt_stat = 138 139 &ecryptfs_superblock_to_private(sb)->mount_crypt_stat; 139 140 struct ecryptfs_global_auth_tok *walker;
-1
fs/efs/super.c
··· 68 68 static void efs_i_callback(struct rcu_head *head) 69 69 { 70 70 struct inode *inode = container_of(head, struct inode, i_rcu); 71 - INIT_LIST_HEAD(&inode->i_dentry); 72 71 kmem_cache_free(efs_inode_cachep, INODE_INFO(inode)); 73 72 } 74 73
+1 -1
fs/exec.c
··· 1225 1225 * - the caller must hold ->cred_guard_mutex to protect against 1226 1226 * PTRACE_ATTACH 1227 1227 */ 1228 - int check_unsafe_exec(struct linux_binprm *bprm) 1228 + static int check_unsafe_exec(struct linux_binprm *bprm) 1229 1229 { 1230 1230 struct task_struct *p = current, *t; 1231 1231 unsigned n_fs;
+1 -1
fs/exofs/dir.c
··· 234 234 static inline 235 235 void exofs_set_de_type(struct exofs_dir_entry *de, struct inode *inode) 236 236 { 237 - mode_t mode = inode->i_mode; 237 + umode_t mode = inode->i_mode; 238 238 de->file_type = exofs_type_by_mode[(mode & S_IFMT) >> S_SHIFT]; 239 239 } 240 240
+1 -1
fs/exofs/exofs.h
··· 154 154 loff_t pos, unsigned len, unsigned flags, 155 155 struct page **pagep, void **fsdata); 156 156 extern struct inode *exofs_iget(struct super_block *, unsigned long); 157 - struct inode *exofs_new_inode(struct inode *, int); 157 + struct inode *exofs_new_inode(struct inode *, umode_t); 158 158 extern int exofs_write_inode(struct inode *, struct writeback_control *wbc); 159 159 extern void exofs_evict_inode(struct inode *); 160 160
+1 -1
fs/exofs/inode.c
··· 1276 1276 /* 1277 1277 * Set up a new inode and create an object for it on the OSD 1278 1278 */ 1279 - struct inode *exofs_new_inode(struct inode *dir, int mode) 1279 + struct inode *exofs_new_inode(struct inode *dir, umode_t mode) 1280 1280 { 1281 1281 struct super_block *sb = dir->i_sb; 1282 1282 struct exofs_sb_info *sbi = sb->s_fs_info;
+3 -3
fs/exofs/namei.c
··· 59 59 return d_splice_alias(inode, dentry); 60 60 } 61 61 62 - static int exofs_create(struct inode *dir, struct dentry *dentry, int mode, 62 + static int exofs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 63 63 struct nameidata *nd) 64 64 { 65 65 struct inode *inode = exofs_new_inode(dir, mode); ··· 74 74 return err; 75 75 } 76 76 77 - static int exofs_mknod(struct inode *dir, struct dentry *dentry, int mode, 77 + static int exofs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, 78 78 dev_t rdev) 79 79 { 80 80 struct inode *inode; ··· 153 153 return exofs_add_nondir(dentry, inode); 154 154 } 155 155 156 - static int exofs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 156 + static int exofs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 157 157 { 158 158 struct inode *inode; 159 159 int err = -EMLINK;
-1
fs/exofs/super.c
··· 166 166 static void exofs_i_callback(struct rcu_head *head) 167 167 { 168 168 struct inode *inode = container_of(head, struct inode, i_rcu); 169 - INIT_LIST_HEAD(&inode->i_dentry); 170 169 kmem_cache_free(exofs_inode_cachep, exofs_i(inode)); 171 170 } 172 171
+1 -1
fs/ext2/dir.c
··· 279 279 280 280 static inline void ext2_set_de_type(ext2_dirent *de, struct inode *inode) 281 281 { 282 - mode_t mode = inode->i_mode; 282 + umode_t mode = inode->i_mode; 283 283 if (EXT2_HAS_INCOMPAT_FEATURE(inode->i_sb, EXT2_FEATURE_INCOMPAT_FILETYPE)) 284 284 de->file_type = ext2_type_by_mode[(mode & S_IFMT)>>S_SHIFT]; 285 285 else
+1 -1
fs/ext2/ext2.h
··· 110 110 extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, struct inode *, int); 111 111 112 112 /* ialloc.c */ 113 - extern struct inode * ext2_new_inode (struct inode *, int, const struct qstr *); 113 + extern struct inode * ext2_new_inode (struct inode *, umode_t, const struct qstr *); 114 114 extern void ext2_free_inode (struct inode *); 115 115 extern unsigned long ext2_count_free_inodes (struct super_block *); 116 116 extern void ext2_check_inodes_bitmap (struct super_block *);
+1 -1
fs/ext2/ialloc.c
··· 429 429 return group; 430 430 } 431 431 432 - struct inode *ext2_new_inode(struct inode *dir, int mode, 432 + struct inode *ext2_new_inode(struct inode *dir, umode_t mode, 433 433 const struct qstr *qstr) 434 434 { 435 435 struct super_block *sb;
+6 -6
fs/ext2/ioctl.c
··· 35 35 case EXT2_IOC_SETFLAGS: { 36 36 unsigned int oldflags; 37 37 38 - ret = mnt_want_write(filp->f_path.mnt); 38 + ret = mnt_want_write_file(filp); 39 39 if (ret) 40 40 return ret; 41 41 ··· 83 83 inode->i_ctime = CURRENT_TIME_SEC; 84 84 mark_inode_dirty(inode); 85 85 setflags_out: 86 - mnt_drop_write(filp->f_path.mnt); 86 + mnt_drop_write_file(filp); 87 87 return ret; 88 88 } 89 89 case EXT2_IOC_GETVERSION: ··· 91 91 case EXT2_IOC_SETVERSION: 92 92 if (!inode_owner_or_capable(inode)) 93 93 return -EPERM; 94 - ret = mnt_want_write(filp->f_path.mnt); 94 + ret = mnt_want_write_file(filp); 95 95 if (ret) 96 96 return ret; 97 97 if (get_user(inode->i_generation, (int __user *) arg)) { ··· 100 100 inode->i_ctime = CURRENT_TIME_SEC; 101 101 mark_inode_dirty(inode); 102 102 } 103 - mnt_drop_write(filp->f_path.mnt); 103 + mnt_drop_write_file(filp); 104 104 return ret; 105 105 case EXT2_IOC_GETRSVSZ: 106 106 if (test_opt(inode->i_sb, RESERVATION) ··· 121 121 if (get_user(rsv_window_size, (int __user *)arg)) 122 122 return -EFAULT; 123 123 124 - ret = mnt_want_write(filp->f_path.mnt); 124 + ret = mnt_want_write_file(filp); 125 125 if (ret) 126 126 return ret; 127 127 ··· 145 145 rsv->rsv_goal_size = rsv_window_size; 146 146 } 147 147 mutex_unlock(&ei->truncate_mutex); 148 - mnt_drop_write(filp->f_path.mnt); 148 + mnt_drop_write_file(filp); 149 149 return 0; 150 150 } 151 151 default:
+3 -3
fs/ext2/namei.c
··· 94 94 * If the create succeeds, we fill in the inode information 95 95 * with d_instantiate(). 96 96 */ 97 - static int ext2_create (struct inode * dir, struct dentry * dentry, int mode, struct nameidata *nd) 97 + static int ext2_create (struct inode * dir, struct dentry * dentry, umode_t mode, struct nameidata *nd) 98 98 { 99 99 struct inode *inode; 100 100 ··· 119 119 return ext2_add_nondir(dentry, inode); 120 120 } 121 121 122 - static int ext2_mknod (struct inode * dir, struct dentry *dentry, int mode, dev_t rdev) 122 + static int ext2_mknod (struct inode * dir, struct dentry *dentry, umode_t mode, dev_t rdev) 123 123 { 124 124 struct inode * inode; 125 125 int err; ··· 214 214 return err; 215 215 } 216 216 217 - static int ext2_mkdir(struct inode * dir, struct dentry * dentry, int mode) 217 + static int ext2_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode) 218 218 { 219 219 struct inode * inode; 220 220 int err = -EMLINK;
+2 -3
fs/ext2/super.c
··· 173 173 static void ext2_i_callback(struct rcu_head *head) 174 174 { 175 175 struct inode *inode = container_of(head, struct inode, i_rcu); 176 - INIT_LIST_HEAD(&inode->i_dentry); 177 176 kmem_cache_free(ext2_inode_cachep, EXT2_I(inode)); 178 177 } 179 178 ··· 210 211 kmem_cache_destroy(ext2_inode_cachep); 211 212 } 212 213 213 - static int ext2_show_options(struct seq_file *seq, struct vfsmount *vfs) 214 + static int ext2_show_options(struct seq_file *seq, struct dentry *root) 214 215 { 215 - struct super_block *sb = vfs->mnt_sb; 216 + struct super_block *sb = root->d_sb; 216 217 struct ext2_sb_info *sbi = EXT2_SB(sb); 217 218 struct ext2_super_block *es = sbi->s_es; 218 219 unsigned long def_mount_opts;
+1 -1
fs/ext3/ialloc.c
··· 371 371 * group to find a free inode. 372 372 */ 373 373 struct inode *ext3_new_inode(handle_t *handle, struct inode * dir, 374 - const struct qstr *qstr, int mode) 374 + const struct qstr *qstr, umode_t mode) 375 375 { 376 376 struct super_block *sb; 377 377 struct buffer_head *bitmap_bh = NULL;
+10 -10
fs/ext3/ioctl.c
··· 44 44 if (get_user(flags, (int __user *) arg)) 45 45 return -EFAULT; 46 46 47 - err = mnt_want_write(filp->f_path.mnt); 47 + err = mnt_want_write_file(filp); 48 48 if (err) 49 49 return err; 50 50 ··· 110 110 err = ext3_change_inode_journal_flag(inode, jflag); 111 111 flags_out: 112 112 mutex_unlock(&inode->i_mutex); 113 - mnt_drop_write(filp->f_path.mnt); 113 + mnt_drop_write_file(filp); 114 114 return err; 115 115 } 116 116 case EXT3_IOC_GETVERSION: ··· 126 126 if (!inode_owner_or_capable(inode)) 127 127 return -EPERM; 128 128 129 - err = mnt_want_write(filp->f_path.mnt); 129 + err = mnt_want_write_file(filp); 130 130 if (err) 131 131 return err; 132 132 if (get_user(generation, (int __user *) arg)) { ··· 147 147 } 148 148 ext3_journal_stop(handle); 149 149 setversion_out: 150 - mnt_drop_write(filp->f_path.mnt); 150 + mnt_drop_write_file(filp); 151 151 return err; 152 152 } 153 153 case EXT3_IOC_GETRSVSZ: ··· 164 164 if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode)) 165 165 return -ENOTTY; 166 166 167 - err = mnt_want_write(filp->f_path.mnt); 167 + err = mnt_want_write_file(filp); 168 168 if (err) 169 169 return err; 170 170 ··· 195 195 } 196 196 mutex_unlock(&ei->truncate_mutex); 197 197 setrsvsz_out: 198 - mnt_drop_write(filp->f_path.mnt); 198 + mnt_drop_write_file(filp); 199 199 return err; 200 200 } 201 201 case EXT3_IOC_GROUP_EXTEND: { ··· 206 206 if (!capable(CAP_SYS_RESOURCE)) 207 207 return -EPERM; 208 208 209 - err = mnt_want_write(filp->f_path.mnt); 209 + err = mnt_want_write_file(filp); 210 210 if (err) 211 211 return err; 212 212 ··· 221 221 if (err == 0) 222 222 err = err2; 223 223 group_extend_out: 224 - mnt_drop_write(filp->f_path.mnt); 224 + mnt_drop_write_file(filp); 225 225 return err; 226 226 } 227 227 case EXT3_IOC_GROUP_ADD: { ··· 232 232 if (!capable(CAP_SYS_RESOURCE)) 233 233 return -EPERM; 234 234 235 - err = mnt_want_write(filp->f_path.mnt); 235 + err = mnt_want_write_file(filp); 236 236 if (err) 237 237 return err; 238 238 ··· 249 249 if (err == 0) 250 250 err = err2; 251 251 group_add_out: 252 - mnt_drop_write(filp->f_path.mnt); 252 + mnt_drop_write_file(filp); 253 253 return err; 254 254 } 255 255 case FITRIM: {
+3 -3
fs/ext3/namei.c
··· 1698 1698 * If the create succeeds, we fill in the inode information 1699 1699 * with d_instantiate(). 1700 1700 */ 1701 - static int ext3_create (struct inode * dir, struct dentry * dentry, int mode, 1701 + static int ext3_create (struct inode * dir, struct dentry * dentry, umode_t mode, 1702 1702 struct nameidata *nd) 1703 1703 { 1704 1704 handle_t *handle; ··· 1732 1732 } 1733 1733 1734 1734 static int ext3_mknod (struct inode * dir, struct dentry *dentry, 1735 - int mode, dev_t rdev) 1735 + umode_t mode, dev_t rdev) 1736 1736 { 1737 1737 handle_t *handle; 1738 1738 struct inode *inode; ··· 1768 1768 return err; 1769 1769 } 1770 1770 1771 - static int ext3_mkdir(struct inode * dir, struct dentry * dentry, int mode) 1771 + static int ext3_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode) 1772 1772 { 1773 1773 handle_t *handle; 1774 1774 struct inode * inode;
+3 -4
fs/ext3/super.c
··· 511 511 static void ext3_i_callback(struct rcu_head *head) 512 512 { 513 513 struct inode *inode = container_of(head, struct inode, i_rcu); 514 - INIT_LIST_HEAD(&inode->i_dentry); 515 514 kmem_cache_free(ext3_inode_cachep, EXT3_I(inode)); 516 515 } 517 516 ··· 610 611 * - it's set to a non-default value OR 611 612 * - if the per-sb default is different from the global default 612 613 */ 613 - static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs) 614 + static int ext3_show_options(struct seq_file *seq, struct dentry *root) 614 615 { 615 - struct super_block *sb = vfs->mnt_sb; 616 + struct super_block *sb = root->d_sb; 616 617 struct ext3_sb_info *sbi = EXT3_SB(sb); 617 618 struct ext3_super_block *es = sbi->s_es; 618 619 unsigned long def_mount_opts; ··· 2909 2910 return -EINVAL; 2910 2911 2911 2912 /* Quotafile not on the same filesystem? */ 2912 - if (path->mnt->mnt_sb != sb) 2913 + if (path->dentry->d_sb != sb) 2913 2914 return -EXDEV; 2914 2915 /* Journaling quota? */ 2915 2916 if (EXT3_SB(sb)->s_qf_names[type]) {
+1 -1
fs/ext4/ext4.h
··· 1819 1819 dx_hash_info *hinfo); 1820 1820 1821 1821 /* ialloc.c */ 1822 - extern struct inode *ext4_new_inode(handle_t *, struct inode *, int, 1822 + extern struct inode *ext4_new_inode(handle_t *, struct inode *, umode_t, 1823 1823 const struct qstr *qstr, __u32 goal, 1824 1824 uid_t *owner); 1825 1825 extern void ext4_free_inode(handle_t *, struct inode *);
+4 -4
fs/ext4/ialloc.c
··· 351 351 */ 352 352 353 353 static int find_group_orlov(struct super_block *sb, struct inode *parent, 354 - ext4_group_t *group, int mode, 354 + ext4_group_t *group, umode_t mode, 355 355 const struct qstr *qstr) 356 356 { 357 357 ext4_group_t parent_group = EXT4_I(parent)->i_block_group; ··· 497 497 } 498 498 499 499 static int find_group_other(struct super_block *sb, struct inode *parent, 500 - ext4_group_t *group, int mode) 500 + ext4_group_t *group, umode_t mode) 501 501 { 502 502 ext4_group_t parent_group = EXT4_I(parent)->i_block_group; 503 503 ext4_group_t i, last, ngroups = ext4_get_groups_count(sb); ··· 602 602 */ 603 603 static int ext4_claim_inode(struct super_block *sb, 604 604 struct buffer_head *inode_bitmap_bh, 605 - unsigned long ino, ext4_group_t group, int mode) 605 + unsigned long ino, ext4_group_t group, umode_t mode) 606 606 { 607 607 int free = 0, retval = 0, count; 608 608 struct ext4_sb_info *sbi = EXT4_SB(sb); ··· 690 690 * For other inodes, search forward from the parent directory's block 691 691 * group to find a free inode. 692 692 */ 693 - struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode, 693 + struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, umode_t mode, 694 694 const struct qstr *qstr, __u32 goal, uid_t *owner) 695 695 { 696 696 struct super_block *sb;
+14 -14
fs/ext4/ioctl.c
··· 45 45 if (get_user(flags, (int __user *) arg)) 46 46 return -EFAULT; 47 47 48 - err = mnt_want_write(filp->f_path.mnt); 48 + err = mnt_want_write_file(filp); 49 49 if (err) 50 50 return err; 51 51 ··· 134 134 err = ext4_ext_migrate(inode); 135 135 flags_out: 136 136 mutex_unlock(&inode->i_mutex); 137 - mnt_drop_write(filp->f_path.mnt); 137 + mnt_drop_write_file(filp); 138 138 return err; 139 139 } 140 140 case EXT4_IOC_GETVERSION: ··· 150 150 if (!inode_owner_or_capable(inode)) 151 151 return -EPERM; 152 152 153 - err = mnt_want_write(filp->f_path.mnt); 153 + err = mnt_want_write_file(filp); 154 154 if (err) 155 155 return err; 156 156 if (get_user(generation, (int __user *) arg)) { ··· 171 171 } 172 172 ext4_journal_stop(handle); 173 173 setversion_out: 174 - mnt_drop_write(filp->f_path.mnt); 174 + mnt_drop_write_file(filp); 175 175 return err; 176 176 } 177 177 case EXT4_IOC_GROUP_EXTEND: { ··· 192 192 return -EOPNOTSUPP; 193 193 } 194 194 195 - err = mnt_want_write(filp->f_path.mnt); 195 + err = mnt_want_write_file(filp); 196 196 if (err) 197 197 return err; 198 198 ··· 204 204 } 205 205 if (err == 0) 206 206 err = err2; 207 - mnt_drop_write(filp->f_path.mnt); 207 + mnt_drop_write_file(filp); 208 208 ext4_resize_end(sb); 209 209 210 210 return err; ··· 240 240 return -EOPNOTSUPP; 241 241 } 242 242 243 - err = mnt_want_write(filp->f_path.mnt); 243 + err = mnt_want_write_file(filp); 244 244 if (err) 245 245 goto mext_out; 246 246 247 247 err = ext4_move_extents(filp, donor_filp, me.orig_start, 248 248 me.donor_start, me.len, &me.moved_len); 249 - mnt_drop_write(filp->f_path.mnt); 249 + mnt_drop_write_file(filp); 250 250 if (me.moved_len > 0) 251 251 file_remove_suid(donor_filp); 252 252 ··· 277 277 return -EOPNOTSUPP; 278 278 } 279 279 280 - err = mnt_want_write(filp->f_path.mnt); 280 + err = mnt_want_write_file(filp); 281 281 if (err) 282 282 return err; 283 283 ··· 289 289 } 290 290 if (err == 0) 291 291 err = err2; 292 - mnt_drop_write(filp->f_path.mnt); 292 + mnt_drop_write_file(filp); 293 293 ext4_resize_end(sb); 294 294 295 295 return err; ··· 301 301 if (!inode_owner_or_capable(inode)) 302 302 return -EACCES; 303 303 304 - err = mnt_want_write(filp->f_path.mnt); 304 + err = mnt_want_write_file(filp); 305 305 if (err) 306 306 return err; 307 307 /* ··· 313 313 mutex_lock(&(inode->i_mutex)); 314 314 err = ext4_ext_migrate(inode); 315 315 mutex_unlock(&(inode->i_mutex)); 316 - mnt_drop_write(filp->f_path.mnt); 316 + mnt_drop_write_file(filp); 317 317 return err; 318 318 } 319 319 ··· 323 323 if (!inode_owner_or_capable(inode)) 324 324 return -EACCES; 325 325 326 - err = mnt_want_write(filp->f_path.mnt); 326 + err = mnt_want_write_file(filp); 327 327 if (err) 328 328 return err; 329 329 err = ext4_alloc_da_blocks(inode); 330 - mnt_drop_write(filp->f_path.mnt); 330 + mnt_drop_write_file(filp); 331 331 return err; 332 332 } 333 333
+3 -3
fs/ext4/namei.c
··· 1736 1736 * If the create succeeds, we fill in the inode information 1737 1737 * with d_instantiate(). 1738 1738 */ 1739 - static int ext4_create(struct inode *dir, struct dentry *dentry, int mode, 1739 + static int ext4_create(struct inode *dir, struct dentry *dentry, umode_t mode, 1740 1740 struct nameidata *nd) 1741 1741 { 1742 1742 handle_t *handle; ··· 1770 1770 } 1771 1771 1772 1772 static int ext4_mknod(struct inode *dir, struct dentry *dentry, 1773 - int mode, dev_t rdev) 1773 + umode_t mode, dev_t rdev) 1774 1774 { 1775 1775 handle_t *handle; 1776 1776 struct inode *inode; ··· 1806 1806 return err; 1807 1807 } 1808 1808 1809 - static int ext4_mkdir(struct inode *dir, struct dentry *dentry, int mode) 1809 + static int ext4_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 1810 1810 { 1811 1811 handle_t *handle; 1812 1812 struct inode *inode;
+3 -4
fs/ext4/super.c
··· 930 930 static void ext4_i_callback(struct rcu_head *head) 931 931 { 932 932 struct inode *inode = container_of(head, struct inode, i_rcu); 933 - INIT_LIST_HEAD(&inode->i_dentry); 934 933 kmem_cache_free(ext4_inode_cachep, EXT4_I(inode)); 935 934 } 936 935 ··· 1032 1033 * - it's set to a non-default value OR 1033 1034 * - if the per-sb default is different from the global default 1034 1035 */ 1035 - static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) 1036 + static int ext4_show_options(struct seq_file *seq, struct dentry *root) 1036 1037 { 1037 1038 int def_errors; 1038 1039 unsigned long def_mount_opts; 1039 - struct super_block *sb = vfs->mnt_sb; 1040 + struct super_block *sb = root->d_sb; 1040 1041 struct ext4_sb_info *sbi = EXT4_SB(sb); 1041 1042 struct ext4_super_block *es = sbi->s_es; 1042 1043 ··· 4781 4782 return -EINVAL; 4782 4783 4783 4784 /* Quotafile not on the same filesystem? */ 4784 - if (path->mnt->mnt_sb != sb) 4785 + if (path->dentry->d_sb != sb) 4785 4786 return -EXDEV; 4786 4787 /* Journaling quota? */ 4787 4788 if (EXT4_SB(sb)->s_qf_names[type]) {
+3 -3
fs/fat/fat.h
··· 141 141 static inline int fat_mode_can_hold_ro(struct inode *inode) 142 142 { 143 143 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); 144 - mode_t mask; 144 + umode_t mask; 145 145 146 146 if (S_ISDIR(inode->i_mode)) { 147 147 if (!sbi->options.rodir) ··· 156 156 } 157 157 158 158 /* Convert attribute bits and a mask to the UNIX mode. */ 159 - static inline mode_t fat_make_mode(struct msdos_sb_info *sbi, 160 - u8 attrs, mode_t mode) 159 + static inline umode_t fat_make_mode(struct msdos_sb_info *sbi, 160 + u8 attrs, umode_t mode) 161 161 { 162 162 if (attrs & ATTR_RO && !((attrs & ATTR_DIR) && !sbi->options.rodir)) 163 163 mode &= ~S_IWUGO;
+4 -4
fs/fat/file.c
··· 44 44 goto out; 45 45 46 46 mutex_lock(&inode->i_mutex); 47 - err = mnt_want_write(file->f_path.mnt); 47 + err = mnt_want_write_file(file); 48 48 if (err) 49 49 goto out_unlock_inode; 50 50 ··· 108 108 fat_save_attrs(inode, attr); 109 109 mark_inode_dirty(inode); 110 110 out_drop_write: 111 - mnt_drop_write(file->f_path.mnt); 111 + mnt_drop_write_file(file); 112 112 out_unlock_inode: 113 113 mutex_unlock(&inode->i_mutex); 114 114 out: ··· 314 314 static int fat_sanitize_mode(const struct msdos_sb_info *sbi, 315 315 struct inode *inode, umode_t *mode_ptr) 316 316 { 317 - mode_t mask, perm; 317 + umode_t mask, perm; 318 318 319 319 /* 320 320 * Note, the basic check is already done by a caller of ··· 351 351 352 352 static int fat_allow_set_time(struct msdos_sb_info *sbi, struct inode *inode) 353 353 { 354 - mode_t allow_utime = sbi->options.allow_utime; 354 + umode_t allow_utime = sbi->options.allow_utime; 355 355 356 356 if (current_fsuid() != inode->i_uid) { 357 357 if (in_group_p(inode->i_gid))
+3 -4
fs/fat/inode.c
··· 518 518 static void fat_i_callback(struct rcu_head *head) 519 519 { 520 520 struct inode *inode = container_of(head, struct inode, i_rcu); 521 - INIT_LIST_HEAD(&inode->i_dentry); 522 521 kmem_cache_free(fat_inode_cachep, MSDOS_I(inode)); 523 522 } 524 523 ··· 671 672 672 673 EXPORT_SYMBOL_GPL(fat_sync_inode); 673 674 674 - static int fat_show_options(struct seq_file *m, struct vfsmount *mnt); 675 + static int fat_show_options(struct seq_file *m, struct dentry *root); 675 676 static const struct super_operations fat_sops = { 676 677 .alloc_inode = fat_alloc_inode, 677 678 .destroy_inode = fat_destroy_inode, ··· 810 811 .get_parent = fat_get_parent, 811 812 }; 812 813 813 - static int fat_show_options(struct seq_file *m, struct vfsmount *mnt) 814 + static int fat_show_options(struct seq_file *m, struct dentry *root) 814 815 { 815 - struct msdos_sb_info *sbi = MSDOS_SB(mnt->mnt_sb); 816 + struct msdos_sb_info *sbi = MSDOS_SB(root->d_sb); 816 817 struct fat_mount_options *opts = &sbi->options; 817 818 int isvfat = opts->isvfat; 818 819
+2 -2
fs/fat/namei_msdos.c
··· 264 264 } 265 265 266 266 /***** Create a file */ 267 - static int msdos_create(struct inode *dir, struct dentry *dentry, int mode, 267 + static int msdos_create(struct inode *dir, struct dentry *dentry, umode_t mode, 268 268 struct nameidata *nd) 269 269 { 270 270 struct super_block *sb = dir->i_sb; ··· 346 346 } 347 347 348 348 /***** Make a directory */ 349 - static int msdos_mkdir(struct inode *dir, struct dentry *dentry, int mode) 349 + static int msdos_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 350 350 { 351 351 struct super_block *sb = dir->i_sb; 352 352 struct fat_slot_info sinfo;
+2 -2
fs/fat/namei_vfat.c
··· 781 781 return ERR_PTR(err); 782 782 } 783 783 784 - static int vfat_create(struct inode *dir, struct dentry *dentry, int mode, 784 + static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, 785 785 struct nameidata *nd) 786 786 { 787 787 struct super_block *sb = dir->i_sb; ··· 870 870 return err; 871 871 } 872 872 873 - static int vfat_mkdir(struct inode *dir, struct dentry *dentry, int mode) 873 + static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 874 874 { 875 875 struct super_block *sb = dir->i_sb; 876 876 struct inode *inode;
+5 -3
fs/fhandle.c
··· 10 10 #include <linux/personality.h> 11 11 #include <asm/uaccess.h> 12 12 #include "internal.h" 13 + #include "mount.h" 13 14 14 15 static long do_sys_name_to_handle(struct path *path, 15 16 struct file_handle __user *ufh, ··· 25 24 * We need t make sure wether the file system 26 25 * support decoding of the file handle 27 26 */ 28 - if (!path->mnt->mnt_sb->s_export_op || 29 - !path->mnt->mnt_sb->s_export_op->fh_to_dentry) 27 + if (!path->dentry->d_sb->s_export_op || 28 + !path->dentry->d_sb->s_export_op->fh_to_dentry) 30 29 return -EOPNOTSUPP; 31 30 32 31 if (copy_from_user(&f_handle, ufh, sizeof(struct file_handle))) ··· 67 66 } else 68 67 retval = 0; 69 68 /* copy the mount id */ 70 - if (copy_to_user(mnt_id, &path->mnt->mnt_id, sizeof(*mnt_id)) || 69 + if (copy_to_user(mnt_id, &real_mount(path->mnt)->mnt_id, 70 + sizeof(*mnt_id)) || 71 71 copy_to_user(ufh, handle, 72 72 sizeof(struct file_handle) + handle_bytes)) 73 73 retval = -EFAULT;
-23
fs/file_table.c
··· 474 474 475 475 #endif 476 476 477 - int fs_may_remount_ro(struct super_block *sb) 478 - { 479 - struct file *file; 480 - /* Check that no files are currently opened for writing. */ 481 - lg_global_lock(files_lglock); 482 - do_file_list_for_each_entry(sb, file) { 483 - struct inode *inode = file->f_path.dentry->d_inode; 484 - 485 - /* File with pending delete? */ 486 - if (inode->i_nlink == 0) 487 - goto too_bad; 488 - 489 - /* Writeable file? */ 490 - if (S_ISREG(inode->i_mode) && (file->f_mode & FMODE_WRITE)) 491 - goto too_bad; 492 - } while_file_list_for_each_entry; 493 - lg_global_unlock(files_lglock); 494 - return 1; /* Tis' cool bro. */ 495 - too_bad: 496 - lg_global_unlock(files_lglock); 497 - return 0; 498 - } 499 - 500 477 /** 501 478 * mark_files_ro - mark all files read-only 502 479 * @sb: superblock in question
-1
fs/filesystems.c
··· 74 74 BUG_ON(strchr(fs->name, '.')); 75 75 if (fs->next) 76 76 return -EBUSY; 77 - INIT_LIST_HEAD(&fs->fs_supers); 78 77 write_lock(&file_systems_lock); 79 78 p = find_filesystem(fs->name, strlen(fs->name)); 80 79 if (*p)
+2 -3
fs/freevxfs/vxfs_inode.c
··· 187 187 * vxfs_transmod returns a Linux mode_t for a given 188 188 * VxFS inode structure. 189 189 */ 190 - static __inline__ mode_t 190 + static __inline__ umode_t 191 191 vxfs_transmod(struct vxfs_inode_info *vip) 192 192 { 193 - mode_t ret = vip->vii_mode & ~VXFS_TYPE_MASK; 193 + umode_t ret = vip->vii_mode & ~VXFS_TYPE_MASK; 194 194 195 195 if (VXFS_ISFIFO(vip)) 196 196 ret |= S_IFIFO; ··· 340 340 static void vxfs_i_callback(struct rcu_head *head) 341 341 { 342 342 struct inode *inode = container_of(head, struct inode, i_rcu); 343 - INIT_LIST_HEAD(&inode->i_dentry); 344 343 kmem_cache_free(vxfs_inode_cachep, inode->i_private); 345 344 } 346 345
-1
fs/fs-writeback.c
··· 25 25 #include <linux/writeback.h> 26 26 #include <linux/blkdev.h> 27 27 #include <linux/backing-dev.h> 28 - #include <linux/buffer_head.h> 29 28 #include <linux/tracepoint.h> 30 29 #include "internal.h" 31 30
+6 -6
fs/fuse/dir.c
··· 369 369 * If the filesystem doesn't support this, then fall back to separate 370 370 * 'mknod' + 'open' requests. 371 371 */ 372 - static int fuse_create_open(struct inode *dir, struct dentry *entry, int mode, 373 - struct nameidata *nd) 372 + static int fuse_create_open(struct inode *dir, struct dentry *entry, 373 + umode_t mode, struct nameidata *nd) 374 374 { 375 375 int err; 376 376 struct inode *inode; ··· 480 480 */ 481 481 static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req, 482 482 struct inode *dir, struct dentry *entry, 483 - int mode) 483 + umode_t mode) 484 484 { 485 485 struct fuse_entry_out outarg; 486 486 struct inode *inode; ··· 547 547 return err; 548 548 } 549 549 550 - static int fuse_mknod(struct inode *dir, struct dentry *entry, int mode, 550 + static int fuse_mknod(struct inode *dir, struct dentry *entry, umode_t mode, 551 551 dev_t rdev) 552 552 { 553 553 struct fuse_mknod_in inarg; ··· 573 573 return create_new_entry(fc, req, dir, entry, mode); 574 574 } 575 575 576 - static int fuse_create(struct inode *dir, struct dentry *entry, int mode, 576 + static int fuse_create(struct inode *dir, struct dentry *entry, umode_t mode, 577 577 struct nameidata *nd) 578 578 { 579 579 if (nd) { ··· 585 585 return fuse_mknod(dir, entry, mode, 0); 586 586 } 587 587 588 - static int fuse_mkdir(struct inode *dir, struct dentry *entry, int mode) 588 + static int fuse_mkdir(struct inode *dir, struct dentry *entry, umode_t mode) 589 589 { 590 590 struct fuse_mkdir_in inarg; 591 591 struct fuse_conn *fc = get_fuse_conn(dir);
+1 -1
fs/fuse/fuse_i.h
··· 80 80 81 81 /** The sticky bit in inode->i_mode may have been removed, so 82 82 preserve the original mode */ 83 - mode_t orig_i_mode; 83 + umode_t orig_i_mode; 84 84 85 85 /** Version of last attribute change */ 86 86 u64 attr_version;
+5 -6
fs/fuse/inode.c
··· 107 107 static void fuse_i_callback(struct rcu_head *head) 108 108 { 109 109 struct inode *inode = container_of(head, struct inode, i_rcu); 110 - INIT_LIST_HEAD(&inode->i_dentry); 111 110 kmem_cache_free(fuse_inode_cachep, inode); 112 111 } 113 112 ··· 497 498 return 1; 498 499 } 499 500 500 - static int fuse_show_options(struct seq_file *m, struct vfsmount *mnt) 501 + static int fuse_show_options(struct seq_file *m, struct dentry *root) 501 502 { 502 - struct fuse_conn *fc = get_fuse_conn_super(mnt->mnt_sb); 503 + struct super_block *sb = root->d_sb; 504 + struct fuse_conn *fc = get_fuse_conn_super(sb); 503 505 504 506 seq_printf(m, ",user_id=%u", fc->user_id); 505 507 seq_printf(m, ",group_id=%u", fc->group_id); ··· 510 510 seq_puts(m, ",allow_other"); 511 511 if (fc->max_read != ~0) 512 512 seq_printf(m, ",max_read=%u", fc->max_read); 513 - if (mnt->mnt_sb->s_bdev && 514 - mnt->mnt_sb->s_blocksize != FUSE_DEFAULT_BLKSIZE) 515 - seq_printf(m, ",blksize=%lu", mnt->mnt_sb->s_blocksize); 513 + if (sb->s_bdev && sb->s_blocksize != FUSE_DEFAULT_BLKSIZE) 514 + seq_printf(m, ",blksize=%lu", sb->s_blocksize); 516 515 return 0; 517 516 } 518 517
+2 -2
fs/gfs2/file.c
··· 223 223 int error; 224 224 u32 new_flags, flags; 225 225 226 - error = mnt_want_write(filp->f_path.mnt); 226 + error = mnt_want_write_file(filp); 227 227 if (error) 228 228 return error; 229 229 ··· 285 285 out: 286 286 gfs2_glock_dq_uninit(&gh); 287 287 out_drop_write: 288 - mnt_drop_write(filp->f_path.mnt); 288 + mnt_drop_write_file(filp); 289 289 return error; 290 290 } 291 291
+8 -8
fs/gfs2/inode.c
··· 333 333 */ 334 334 335 335 static int create_ok(struct gfs2_inode *dip, const struct qstr *name, 336 - unsigned int mode) 336 + umode_t mode) 337 337 { 338 338 int error; 339 339 ··· 364 364 return 0; 365 365 } 366 366 367 - static void munge_mode_uid_gid(struct gfs2_inode *dip, unsigned int *mode, 367 + static void munge_mode_uid_gid(struct gfs2_inode *dip, umode_t *mode, 368 368 unsigned int *uid, unsigned int *gid) 369 369 { 370 370 if (GFS2_SB(&dip->i_inode)->sd_args.ar_suiddir && ··· 447 447 */ 448 448 449 449 static void init_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl, 450 - const struct gfs2_inum_host *inum, unsigned int mode, 450 + const struct gfs2_inum_host *inum, umode_t mode, 451 451 unsigned int uid, unsigned int gid, 452 452 const u64 *generation, dev_t dev, const char *symname, 453 453 unsigned size, struct buffer_head **bhp) ··· 516 516 } 517 517 518 518 static int make_dinode(struct gfs2_inode *dip, struct gfs2_glock *gl, 519 - unsigned int mode, const struct gfs2_inum_host *inum, 519 + umode_t mode, const struct gfs2_inum_host *inum, 520 520 const u64 *generation, dev_t dev, const char *symname, 521 521 unsigned int size, struct buffer_head **bhp) 522 522 { ··· 659 659 */ 660 660 661 661 static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, 662 - unsigned int mode, dev_t dev, const char *symname, 662 + umode_t mode, dev_t dev, const char *symname, 663 663 unsigned int size, int excl) 664 664 { 665 665 const struct qstr *name = &dentry->d_name; ··· 760 760 */ 761 761 762 762 static int gfs2_create(struct inode *dir, struct dentry *dentry, 763 - int mode, struct nameidata *nd) 763 + umode_t mode, struct nameidata *nd) 764 764 { 765 765 int excl = 0; 766 766 if (nd && (nd->flags & LOOKUP_EXCL)) ··· 1129 1129 * Returns: errno 1130 1130 */ 1131 1131 1132 - static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, int mode) 1132 + static int gfs2_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 1133 1133 { 1134 1134 return gfs2_create_inode(dir, dentry, S_IFDIR | mode, 0, NULL, 0, 0); 1135 1135 } ··· 1143 1143 * 1144 1144 */ 1145 1145 1146 - static int gfs2_mknod(struct inode *dir, struct dentry *dentry, int mode, 1146 + static int gfs2_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, 1147 1147 dev_t dev) 1148 1148 { 1149 1149 return gfs2_create_inode(dir, dentry, mode, dev, NULL, 0, 0);
+4 -5
fs/gfs2/super.c
··· 1284 1284 /** 1285 1285 * gfs2_show_options - Show mount options for /proc/mounts 1286 1286 * @s: seq_file structure 1287 - * @mnt: vfsmount 1287 + * @root: root of this (sub)tree 1288 1288 * 1289 1289 * Returns: 0 on success or error code 1290 1290 */ 1291 1291 1292 - static int gfs2_show_options(struct seq_file *s, struct vfsmount *mnt) 1292 + static int gfs2_show_options(struct seq_file *s, struct dentry *root) 1293 1293 { 1294 - struct gfs2_sbd *sdp = mnt->mnt_sb->s_fs_info; 1294 + struct gfs2_sbd *sdp = root->d_sb->s_fs_info; 1295 1295 struct gfs2_args *args = &sdp->sd_args; 1296 1296 int val; 1297 1297 1298 - if (is_ancestor(mnt->mnt_root, sdp->sd_master_dir)) 1298 + if (is_ancestor(root, sdp->sd_master_dir)) 1299 1299 seq_printf(s, ",meta"); 1300 1300 if (args->ar_lockproto[0]) 1301 1301 seq_printf(s, ",lockproto=%s", args->ar_lockproto); ··· 1582 1582 static void gfs2_i_callback(struct rcu_head *head) 1583 1583 { 1584 1584 struct inode *inode = container_of(head, struct inode, i_rcu); 1585 - INIT_LIST_HEAD(&inode->i_dentry); 1586 1585 kmem_cache_free(gfs2_inode_cachep, inode); 1587 1586 } 1588 1587
+2 -2
fs/hfs/dir.c
··· 186 186 * a directory and return a corresponding inode, given the inode for 187 187 * the directory and the name (and its length) of the new file. 188 188 */ 189 - static int hfs_create(struct inode *dir, struct dentry *dentry, int mode, 189 + static int hfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 190 190 struct nameidata *nd) 191 191 { 192 192 struct inode *inode; ··· 216 216 * in a directory, given the inode for the parent directory and the 217 217 * name (and its length) of the new directory. 218 218 */ 219 - static int hfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 219 + static int hfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 220 220 { 221 221 struct inode *inode; 222 222 int res;
+1 -1
fs/hfs/hfs_fs.h
··· 184 184 extern const struct address_space_operations hfs_aops; 185 185 extern const struct address_space_operations hfs_btree_aops; 186 186 187 - extern struct inode *hfs_new_inode(struct inode *, struct qstr *, int); 187 + extern struct inode *hfs_new_inode(struct inode *, struct qstr *, umode_t); 188 188 extern void hfs_inode_write_fork(struct inode *, struct hfs_extent *, __be32 *, __be32 *); 189 189 extern int hfs_write_inode(struct inode *, struct writeback_control *); 190 190 extern int hfs_inode_setattr(struct dentry *, struct iattr *);
+1 -1
fs/hfs/inode.c
··· 169 169 /* 170 170 * hfs_new_inode 171 171 */ 172 - struct inode *hfs_new_inode(struct inode *dir, struct qstr *name, int mode) 172 + struct inode *hfs_new_inode(struct inode *dir, struct qstr *name, umode_t mode) 173 173 { 174 174 struct super_block *sb = dir->i_sb; 175 175 struct inode *inode = new_inode(sb);
+2 -3
fs/hfs/super.c
··· 133 133 return 0; 134 134 } 135 135 136 - static int hfs_show_options(struct seq_file *seq, struct vfsmount *mnt) 136 + static int hfs_show_options(struct seq_file *seq, struct dentry *root) 137 137 { 138 - struct hfs_sb_info *sbi = HFS_SB(mnt->mnt_sb); 138 + struct hfs_sb_info *sbi = HFS_SB(root->d_sb); 139 139 140 140 if (sbi->s_creator != cpu_to_be32(0x3f3f3f3f)) 141 141 seq_printf(seq, ",creator=%.4s", (char *)&sbi->s_creator); ··· 170 170 static void hfs_i_callback(struct rcu_head *head) 171 171 { 172 172 struct inode *inode = container_of(head, struct inode, i_rcu); 173 - INIT_LIST_HEAD(&inode->i_dentry); 174 173 kmem_cache_free(hfs_inode_cachep, HFS_I(inode)); 175 174 } 176 175
+3 -3
fs/hfsplus/dir.c
··· 424 424 } 425 425 426 426 static int hfsplus_mknod(struct inode *dir, struct dentry *dentry, 427 - int mode, dev_t rdev) 427 + umode_t mode, dev_t rdev) 428 428 { 429 429 struct hfsplus_sb_info *sbi = HFSPLUS_SB(dir->i_sb); 430 430 struct inode *inode; ··· 453 453 return res; 454 454 } 455 455 456 - static int hfsplus_create(struct inode *dir, struct dentry *dentry, int mode, 456 + static int hfsplus_create(struct inode *dir, struct dentry *dentry, umode_t mode, 457 457 struct nameidata *nd) 458 458 { 459 459 return hfsplus_mknod(dir, dentry, mode, 0); 460 460 } 461 461 462 - static int hfsplus_mkdir(struct inode *dir, struct dentry *dentry, int mode) 462 + static int hfsplus_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 463 463 { 464 464 return hfsplus_mknod(dir, dentry, mode | S_IFDIR, 0); 465 465 }
+2 -2
fs/hfsplus/hfsplus_fs.h
··· 402 402 void hfsplus_inode_write_fork(struct inode *, struct hfsplus_fork_raw *); 403 403 int hfsplus_cat_read_inode(struct inode *, struct hfs_find_data *); 404 404 int hfsplus_cat_write_inode(struct inode *); 405 - struct inode *hfsplus_new_inode(struct super_block *, int); 405 + struct inode *hfsplus_new_inode(struct super_block *, umode_t); 406 406 void hfsplus_delete_inode(struct inode *); 407 407 int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end, 408 408 int datasync); ··· 419 419 int hfsplus_parse_options(char *, struct hfsplus_sb_info *); 420 420 int hfsplus_parse_options_remount(char *input, int *force); 421 421 void hfsplus_fill_defaults(struct hfsplus_sb_info *); 422 - int hfsplus_show_options(struct seq_file *, struct vfsmount *); 422 + int hfsplus_show_options(struct seq_file *, struct dentry *); 423 423 424 424 /* super.c */ 425 425 struct inode *hfsplus_iget(struct super_block *, unsigned long);
+1 -1
fs/hfsplus/inode.c
··· 378 378 .unlocked_ioctl = hfsplus_ioctl, 379 379 }; 380 380 381 - struct inode *hfsplus_new_inode(struct super_block *sb, int mode) 381 + struct inode *hfsplus_new_inode(struct super_block *sb, umode_t mode) 382 382 { 383 383 struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb); 384 384 struct inode *inode = new_inode(sb);
+2 -2
fs/hfsplus/ioctl.c
··· 43 43 unsigned int flags; 44 44 int err = 0; 45 45 46 - err = mnt_want_write(file->f_path.mnt); 46 + err = mnt_want_write_file(file); 47 47 if (err) 48 48 goto out; 49 49 ··· 94 94 out_unlock_inode: 95 95 mutex_unlock(&inode->i_mutex); 96 96 out_drop_write: 97 - mnt_drop_write(file->f_path.mnt); 97 + mnt_drop_write_file(file); 98 98 out: 99 99 return err; 100 100 }
+2 -2
fs/hfsplus/options.c
··· 206 206 return 1; 207 207 } 208 208 209 - int hfsplus_show_options(struct seq_file *seq, struct vfsmount *mnt) 209 + int hfsplus_show_options(struct seq_file *seq, struct dentry *root) 210 210 { 211 - struct hfsplus_sb_info *sbi = HFSPLUS_SB(mnt->mnt_sb); 211 + struct hfsplus_sb_info *sbi = HFSPLUS_SB(root->d_sb); 212 212 213 213 if (sbi->creator != HFSPLUS_DEF_CR_TYPE) 214 214 seq_printf(seq, ",creator=%.4s", (char *)&sbi->creator);
-1
fs/hfsplus/super.c
··· 558 558 { 559 559 struct inode *inode = container_of(head, struct inode, i_rcu); 560 560 561 - INIT_LIST_HEAD(&inode->i_dentry); 562 561 kmem_cache_free(hfsplus_inode_cachep, HFSPLUS_I(inode)); 563 562 } 564 563
+1 -1
fs/hostfs/hostfs.h
··· 39 39 40 40 struct hostfs_iattr { 41 41 unsigned int ia_valid; 42 - mode_t ia_mode; 42 + unsigned short ia_mode; 43 43 uid_t ia_uid; 44 44 gid_t ia_gid; 45 45 loff_t ia_size;
+5 -6
fs/hostfs/hostfs_kern.c
··· 250 250 static void hostfs_i_callback(struct rcu_head *head) 251 251 { 252 252 struct inode *inode = container_of(head, struct inode, i_rcu); 253 - INIT_LIST_HEAD(&inode->i_dentry); 254 253 kfree(HOSTFS_I(inode)); 255 254 } 256 255 ··· 258 259 call_rcu(&inode->i_rcu, hostfs_i_callback); 259 260 } 260 261 261 - static int hostfs_show_options(struct seq_file *seq, struct vfsmount *vfs) 262 + static int hostfs_show_options(struct seq_file *seq, struct dentry *root) 262 263 { 263 - const char *root_path = vfs->mnt_sb->s_fs_info; 264 + const char *root_path = root->d_sb->s_fs_info; 264 265 size_t offset = strlen(root_ino) + 1; 265 266 266 267 if (strlen(root_path) > offset) ··· 551 552 return 0; 552 553 } 553 554 554 - int hostfs_create(struct inode *dir, struct dentry *dentry, int mode, 555 + int hostfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 555 556 struct nameidata *nd) 556 557 { 557 558 struct inode *inode; ··· 676 677 return err; 677 678 } 678 679 679 - int hostfs_mkdir(struct inode *ino, struct dentry *dentry, int mode) 680 + int hostfs_mkdir(struct inode *ino, struct dentry *dentry, umode_t mode) 680 681 { 681 682 char *file; 682 683 int err; ··· 700 701 return err; 701 702 } 702 703 703 - int hostfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev) 704 + static int hostfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) 704 705 { 705 706 struct inode *inode; 706 707 char *name;
+3 -3
fs/hpfs/namei.c
··· 8 8 #include <linux/sched.h> 9 9 #include "hpfs_fn.h" 10 10 11 - static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 11 + static int hpfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 12 12 { 13 13 const unsigned char *name = dentry->d_name.name; 14 14 unsigned len = dentry->d_name.len; ··· 115 115 return err; 116 116 } 117 117 118 - static int hpfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd) 118 + static int hpfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *nd) 119 119 { 120 120 const unsigned char *name = dentry->d_name.name; 121 121 unsigned len = dentry->d_name.len; ··· 201 201 return err; 202 202 } 203 203 204 - static int hpfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) 204 + static int hpfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) 205 205 { 206 206 const unsigned char *name = dentry->d_name.name; 207 207 unsigned len = dentry->d_name.len;
-1
fs/hpfs/super.c
··· 181 181 static void hpfs_i_callback(struct rcu_head *head) 182 182 { 183 183 struct inode *inode = container_of(head, struct inode, i_rcu); 184 - INIT_LIST_HEAD(&inode->i_dentry); 185 184 kmem_cache_free(hpfs_inode_cachep, hpfs_i(inode)); 186 185 } 187 186
+1 -2
fs/hppfs/hppfs.c
··· 622 622 static void hppfs_i_callback(struct rcu_head *head) 623 623 { 624 624 struct inode *inode = container_of(head, struct inode, i_rcu); 625 - INIT_LIST_HEAD(&inode->i_dentry); 626 625 kfree(HPPFS_I(inode)); 627 626 } 628 627 ··· 725 726 sb->s_fs_info = proc_mnt; 726 727 727 728 err = -ENOMEM; 728 - root_inode = get_inode(sb, dget(proc_mnt->mnt_sb->s_root)); 729 + root_inode = get_inode(sb, dget(proc_mnt->mnt_root)); 729 730 if (!root_inode) 730 731 goto out_mntput; 731 732
+34 -30
fs/hugetlbfs/inode.c
··· 447 447 return 0; 448 448 } 449 449 450 - static struct inode *hugetlbfs_get_inode(struct super_block *sb, uid_t uid, 451 - gid_t gid, int mode, dev_t dev) 450 + static struct inode *hugetlbfs_get_root(struct super_block *sb, 451 + struct hugetlbfs_config *config) 452 452 { 453 453 struct inode *inode; 454 454 ··· 456 456 if (inode) { 457 457 struct hugetlbfs_inode_info *info; 458 458 inode->i_ino = get_next_ino(); 459 - inode->i_mode = mode; 460 - inode->i_uid = uid; 461 - inode->i_gid = gid; 459 + inode->i_mode = S_IFDIR | config->mode; 460 + inode->i_uid = config->uid; 461 + inode->i_gid = config->gid; 462 + inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 463 + info = HUGETLBFS_I(inode); 464 + mpol_shared_policy_init(&info->policy, NULL); 465 + inode->i_op = &hugetlbfs_dir_inode_operations; 466 + inode->i_fop = &simple_dir_operations; 467 + /* directory inodes start off with i_nlink == 2 (for "." entry) */ 468 + inc_nlink(inode); 469 + } 470 + return inode; 471 + } 472 + 473 + static struct inode *hugetlbfs_get_inode(struct super_block *sb, 474 + struct inode *dir, 475 + umode_t mode, dev_t dev) 476 + { 477 + struct inode *inode; 478 + 479 + inode = new_inode(sb); 480 + if (inode) { 481 + struct hugetlbfs_inode_info *info; 482 + inode->i_ino = get_next_ino(); 483 + inode_init_owner(inode, dir, mode); 462 484 inode->i_mapping->a_ops = &hugetlbfs_aops; 463 485 inode->i_mapping->backing_dev_info =&hugetlbfs_backing_dev_info; 464 486 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; ··· 522 500 * File creation. Allocate an inode, and we're done.. 523 501 */ 524 502 static int hugetlbfs_mknod(struct inode *dir, 525 - struct dentry *dentry, int mode, dev_t dev) 503 + struct dentry *dentry, umode_t mode, dev_t dev) 526 504 { 527 505 struct inode *inode; 528 506 int error = -ENOSPC; 529 - gid_t gid; 530 507 531 - if (dir->i_mode & S_ISGID) { 532 - gid = dir->i_gid; 533 - if (S_ISDIR(mode)) 534 - mode |= S_ISGID; 535 - } else { 536 - gid = current_fsgid(); 537 - } 538 - inode = hugetlbfs_get_inode(dir->i_sb, current_fsuid(), gid, mode, dev); 508 + inode = hugetlbfs_get_inode(dir->i_sb, dir, mode, dev); 539 509 if (inode) { 540 510 dir->i_ctime = dir->i_mtime = CURRENT_TIME; 541 511 d_instantiate(dentry, inode); ··· 537 523 return error; 538 524 } 539 525 540 - static int hugetlbfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 526 + static int hugetlbfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 541 527 { 542 528 int retval = hugetlbfs_mknod(dir, dentry, mode | S_IFDIR, 0); 543 529 if (!retval) ··· 545 531 return retval; 546 532 } 547 533 548 - static int hugetlbfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd) 534 + static int hugetlbfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *nd) 549 535 { 550 536 return hugetlbfs_mknod(dir, dentry, mode | S_IFREG, 0); 551 537 } ··· 555 541 { 556 542 struct inode *inode; 557 543 int error = -ENOSPC; 558 - gid_t gid; 559 544 560 - if (dir->i_mode & S_ISGID) 561 - gid = dir->i_gid; 562 - else 563 - gid = current_fsgid(); 564 - 565 - inode = hugetlbfs_get_inode(dir->i_sb, current_fsuid(), 566 - gid, S_IFLNK|S_IRWXUGO, 0); 545 + inode = hugetlbfs_get_inode(dir->i_sb, dir, S_IFLNK|S_IRWXUGO, 0); 567 546 if (inode) { 568 547 int l = strlen(symname)+1; 569 548 error = page_symlink(inode, symname, l); ··· 673 666 static void hugetlbfs_i_callback(struct rcu_head *head) 674 667 { 675 668 struct inode *inode = container_of(head, struct inode, i_rcu); 676 - INIT_LIST_HEAD(&inode->i_dentry); 677 669 kmem_cache_free(hugetlbfs_inode_cachep, HUGETLBFS_I(inode)); 678 670 } 679 671 ··· 864 858 sb->s_magic = HUGETLBFS_MAGIC; 865 859 sb->s_op = &hugetlbfs_ops; 866 860 sb->s_time_gran = 1; 867 - inode = hugetlbfs_get_inode(sb, config.uid, config.gid, 868 - S_IFDIR | config.mode, 0); 861 + inode = hugetlbfs_get_root(sb, &config); 869 862 if (!inode) 870 863 goto out_free; 871 864 ··· 962 957 963 958 path.mnt = mntget(hugetlbfs_vfsmount); 964 959 error = -ENOSPC; 965 - inode = hugetlbfs_get_inode(root->d_sb, current_fsuid(), 966 - current_fsgid(), S_IFREG | S_IRWXUGO, 0); 960 + inode = hugetlbfs_get_inode(root->d_sb, NULL, S_IFREG | S_IRWXUGO, 0); 967 961 if (!inode) 968 962 goto out_dentry; 969 963
+88 -4
fs/inode.c
··· 26 26 #include <linux/ima.h> 27 27 #include <linux/cred.h> 28 28 #include <linux/buffer_head.h> /* for inode_has_buffers */ 29 + #include <linux/ratelimit.h> 29 30 #include "internal.h" 30 31 31 32 /* ··· 192 191 } 193 192 inode->i_private = NULL; 194 193 inode->i_mapping = mapping; 194 + INIT_LIST_HEAD(&inode->i_dentry); /* buggered by rcu freeing */ 195 195 #ifdef CONFIG_FS_POSIX_ACL 196 196 inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED; 197 197 #endif ··· 243 241 BUG_ON(inode_has_buffers(inode)); 244 242 security_inode_free(inode); 245 243 fsnotify_inode_delete(inode); 244 + if (!inode->i_nlink) { 245 + WARN_ON(atomic_long_read(&inode->i_sb->s_remove_count) == 0); 246 + atomic_long_dec(&inode->i_sb->s_remove_count); 247 + } 248 + 246 249 #ifdef CONFIG_FS_POSIX_ACL 247 250 if (inode->i_acl && inode->i_acl != ACL_NOT_CACHED) 248 251 posix_acl_release(inode->i_acl); ··· 261 254 static void i_callback(struct rcu_head *head) 262 255 { 263 256 struct inode *inode = container_of(head, struct inode, i_rcu); 264 - INIT_LIST_HEAD(&inode->i_dentry); 265 257 kmem_cache_free(inode_cachep, inode); 266 258 } 267 259 ··· 273 267 else 274 268 call_rcu(&inode->i_rcu, i_callback); 275 269 } 270 + 271 + /** 272 + * drop_nlink - directly drop an inode's link count 273 + * @inode: inode 274 + * 275 + * This is a low-level filesystem helper to replace any 276 + * direct filesystem manipulation of i_nlink. In cases 277 + * where we are attempting to track writes to the 278 + * filesystem, a decrement to zero means an imminent 279 + * write when the file is truncated and actually unlinked 280 + * on the filesystem. 281 + */ 282 + void drop_nlink(struct inode *inode) 283 + { 284 + WARN_ON(inode->i_nlink == 0); 285 + inode->__i_nlink--; 286 + if (!inode->i_nlink) 287 + atomic_long_inc(&inode->i_sb->s_remove_count); 288 + } 289 + EXPORT_SYMBOL(drop_nlink); 290 + 291 + /** 292 + * clear_nlink - directly zero an inode's link count 293 + * @inode: inode 294 + * 295 + * This is a low-level filesystem helper to replace any 296 + * direct filesystem manipulation of i_nlink. See 297 + * drop_nlink() for why we care about i_nlink hitting zero. 298 + */ 299 + void clear_nlink(struct inode *inode) 300 + { 301 + if (inode->i_nlink) { 302 + inode->__i_nlink = 0; 303 + atomic_long_inc(&inode->i_sb->s_remove_count); 304 + } 305 + } 306 + EXPORT_SYMBOL(clear_nlink); 307 + 308 + /** 309 + * set_nlink - directly set an inode's link count 310 + * @inode: inode 311 + * @nlink: new nlink (should be non-zero) 312 + * 313 + * This is a low-level filesystem helper to replace any 314 + * direct filesystem manipulation of i_nlink. 315 + */ 316 + void set_nlink(struct inode *inode, unsigned int nlink) 317 + { 318 + if (!nlink) { 319 + printk_ratelimited(KERN_INFO 320 + "set_nlink() clearing i_nlink on %s inode %li\n", 321 + inode->i_sb->s_type->name, inode->i_ino); 322 + clear_nlink(inode); 323 + } else { 324 + /* Yes, some filesystems do change nlink from zero to one */ 325 + if (inode->i_nlink == 0) 326 + atomic_long_dec(&inode->i_sb->s_remove_count); 327 + 328 + inode->__i_nlink = nlink; 329 + } 330 + } 331 + EXPORT_SYMBOL(set_nlink); 332 + 333 + /** 334 + * inc_nlink - directly increment an inode's link count 335 + * @inode: inode 336 + * 337 + * This is a low-level filesystem helper to replace any 338 + * direct filesystem manipulation of i_nlink. Currently, 339 + * it is only here for parity with dec_nlink(). 340 + */ 341 + void inc_nlink(struct inode *inode) 342 + { 343 + if (WARN_ON(inode->i_nlink == 0)) 344 + atomic_long_dec(&inode->i_sb->s_remove_count); 345 + 346 + inode->__i_nlink++; 347 + } 348 + EXPORT_SYMBOL(inc_nlink); 276 349 277 350 void address_space_init_once(struct address_space *mapping) 278 351 { ··· 375 290 { 376 291 memset(inode, 0, sizeof(*inode)); 377 292 INIT_HLIST_NODE(&inode->i_hash); 378 - INIT_LIST_HEAD(&inode->i_dentry); 379 293 INIT_LIST_HEAD(&inode->i_devices); 380 294 INIT_LIST_HEAD(&inode->i_wb_list); 381 295 INIT_LIST_HEAD(&inode->i_lru); ··· 1592 1508 if (sync_it & S_MTIME) 1593 1509 inode->i_mtime = now; 1594 1510 mark_inode_dirty_sync(inode); 1595 - mnt_drop_write(file->f_path.mnt); 1511 + mnt_drop_write_file(file); 1596 1512 } 1597 1513 EXPORT_SYMBOL(file_update_time); 1598 1514 ··· 1731 1647 * @mode: mode of the new inode 1732 1648 */ 1733 1649 void inode_init_owner(struct inode *inode, const struct inode *dir, 1734 - mode_t mode) 1650 + umode_t mode) 1735 1651 { 1736 1652 inode->i_uid = current_fsuid(); 1737 1653 if (dir && dir->i_mode & S_ISGID) {
+4 -26
fs/internal.h
··· 15 15 struct file_system_type; 16 16 struct linux_binprm; 17 17 struct path; 18 + struct mount; 18 19 19 20 /* 20 21 * block_dev.c 21 22 */ 22 23 #ifdef CONFIG_BLOCK 23 - extern struct super_block *blockdev_superblock; 24 24 extern void __init bdev_cache_init(void); 25 - 26 - static inline int sb_is_blkdev_sb(struct super_block *sb) 27 - { 28 - return sb == blockdev_superblock; 29 - } 30 25 31 26 extern int __sync_blockdev(struct block_device *bdev, int wait); 32 27 33 28 #else 34 29 static inline void bdev_cache_init(void) 35 30 { 36 - } 37 - 38 - static inline int sb_is_blkdev_sb(struct super_block *sb) 39 - { 40 - return 0; 41 31 } 42 32 43 33 static inline int __sync_blockdev(struct block_device *bdev, int wait) ··· 42 52 extern void __init chrdev_init(void); 43 53 44 54 /* 45 - * exec.c 46 - */ 47 - extern int check_unsafe_exec(struct linux_binprm *); 48 - 49 - /* 50 55 * namespace.c 51 56 */ 52 57 extern int copy_mount_options(const void __user *, unsigned long *); 53 58 extern int copy_mount_string(const void __user *, char **); 54 59 55 - extern unsigned int mnt_get_count(struct vfsmount *mnt); 56 - extern struct vfsmount *__lookup_mnt(struct vfsmount *, struct dentry *, int); 57 60 extern struct vfsmount *lookup_mnt(struct path *); 58 - extern void mnt_set_mountpoint(struct vfsmount *, struct dentry *, 59 - struct vfsmount *); 60 - extern void release_mounts(struct list_head *); 61 - extern void umount_tree(struct vfsmount *, int, struct list_head *); 62 - extern struct vfsmount *copy_tree(struct vfsmount *, struct dentry *, int); 63 61 extern int finish_automount(struct vfsmount *, struct path *); 64 62 65 63 extern void mnt_make_longterm(struct vfsmount *); 66 64 extern void mnt_make_shortterm(struct vfsmount *); 65 + extern int sb_prepare_remount_readonly(struct super_block *); 67 66 68 67 extern void __init mnt_init(void); 69 68 ··· 77 98 */ 78 99 extern int do_remount_sb(struct super_block *, int, void *, int); 79 100 extern bool grab_super_passive(struct super_block *sb); 80 - extern void __put_super(struct super_block *sb); 81 - extern void put_super(struct super_block *sb); 82 101 extern struct dentry *mount_fs(struct file_system_type *, 83 102 int, const char *, void *); 103 + extern struct super_block *user_get_super(dev_t); 84 104 85 105 /* 86 106 * open.c ··· 89 111 extern void release_open_intent(struct nameidata *); 90 112 struct open_flags { 91 113 int open_flag; 92 - int mode; 114 + umode_t mode; 93 115 int acc_mode; 94 116 int intent; 95 117 };
+2 -3
fs/isofs/inode.c
··· 85 85 static void isofs_i_callback(struct rcu_head *head) 86 86 { 87 87 struct inode *inode = container_of(head, struct inode, i_rcu); 88 - INIT_LIST_HEAD(&inode->i_dentry); 89 88 kmem_cache_free(isofs_inode_cachep, ISOFS_I(inode)); 90 89 } 91 90 ··· 169 170 unsigned char map; 170 171 unsigned char check; 171 172 unsigned int blocksize; 172 - mode_t fmode; 173 - mode_t dmode; 173 + umode_t fmode; 174 + umode_t dmode; 174 175 gid_t gid; 175 176 uid_t uid; 176 177 char *iocharset;
+3 -3
fs/isofs/isofs.h
··· 50 50 unsigned int s_uid_set:1; 51 51 unsigned int s_gid_set:1; 52 52 53 - mode_t s_fmode; 54 - mode_t s_dmode; 53 + umode_t s_fmode; 54 + umode_t s_dmode; 55 55 gid_t s_gid; 56 56 uid_t s_uid; 57 57 struct nls_table *s_nls_iocharset; /* Native language support table */ 58 58 }; 59 59 60 - #define ISOFS_INVALID_MODE ((mode_t) -1) 60 + #define ISOFS_INVALID_MODE ((umode_t) -1) 61 61 62 62 static inline struct isofs_sb_info *ISOFS_SB(struct super_block *sb) 63 63 {
+7 -7
fs/jffs2/dir.c
··· 22 22 23 23 static int jffs2_readdir (struct file *, void *, filldir_t); 24 24 25 - static int jffs2_create (struct inode *,struct dentry *,int, 25 + static int jffs2_create (struct inode *,struct dentry *,umode_t, 26 26 struct nameidata *); 27 27 static struct dentry *jffs2_lookup (struct inode *,struct dentry *, 28 28 struct nameidata *); 29 29 static int jffs2_link (struct dentry *,struct inode *,struct dentry *); 30 30 static int jffs2_unlink (struct inode *,struct dentry *); 31 31 static int jffs2_symlink (struct inode *,struct dentry *,const char *); 32 - static int jffs2_mkdir (struct inode *,struct dentry *,int); 32 + static int jffs2_mkdir (struct inode *,struct dentry *,umode_t); 33 33 static int jffs2_rmdir (struct inode *,struct dentry *); 34 - static int jffs2_mknod (struct inode *,struct dentry *,int,dev_t); 34 + static int jffs2_mknod (struct inode *,struct dentry *,umode_t,dev_t); 35 35 static int jffs2_rename (struct inode *, struct dentry *, 36 36 struct inode *, struct dentry *); 37 37 ··· 169 169 /***********************************************************************/ 170 170 171 171 172 - static int jffs2_create(struct inode *dir_i, struct dentry *dentry, int mode, 173 - struct nameidata *nd) 172 + static int jffs2_create(struct inode *dir_i, struct dentry *dentry, 173 + umode_t mode, struct nameidata *nd) 174 174 { 175 175 struct jffs2_raw_inode *ri; 176 176 struct jffs2_inode_info *f, *dir_f; ··· 450 450 } 451 451 452 452 453 - static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, int mode) 453 + static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, umode_t mode) 454 454 { 455 455 struct jffs2_inode_info *f, *dir_f; 456 456 struct jffs2_sb_info *c; ··· 618 618 return ret; 619 619 } 620 620 621 - static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, int mode, dev_t rdev) 621 + static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, umode_t mode, dev_t rdev) 622 622 { 623 623 struct jffs2_inode_info *f, *dir_f; 624 624 struct jffs2_sb_info *c;
+2 -3
fs/jffs2/super.c
··· 45 45 static void jffs2_i_callback(struct rcu_head *head) 46 46 { 47 47 struct inode *inode = container_of(head, struct inode, i_rcu); 48 - INIT_LIST_HEAD(&inode->i_dentry); 49 48 kmem_cache_free(jffs2_inode_cachep, JFFS2_INODE_INFO(inode)); 50 49 } 51 50 ··· 96 97 } 97 98 } 98 99 99 - static int jffs2_show_options(struct seq_file *s, struct vfsmount *mnt) 100 + static int jffs2_show_options(struct seq_file *s, struct dentry *root) 100 101 { 101 - struct jffs2_sb_info *c = JFFS2_SB_INFO(mnt->mnt_sb); 102 + struct jffs2_sb_info *c = JFFS2_SB_INFO(root->d_sb); 102 103 struct jffs2_mount_opts *opts = &c->mount_opts; 103 104 104 105 if (opts->override_compr)
+2 -2
fs/jfs/ioctl.c
··· 68 68 unsigned int oldflags; 69 69 int err; 70 70 71 - err = mnt_want_write(filp->f_path.mnt); 71 + err = mnt_want_write_file(filp); 72 72 if (err) 73 73 return err; 74 74 ··· 120 120 inode->i_ctime = CURRENT_TIME_SEC; 121 121 mark_inode_dirty(inode); 122 122 setflags_out: 123 - mnt_drop_write(filp->f_path.mnt); 123 + mnt_drop_write_file(filp); 124 124 return err; 125 125 } 126 126 default:
+3 -3
fs/jfs/namei.c
··· 72 72 * RETURN: Errors from subroutines 73 73 * 74 74 */ 75 - static int jfs_create(struct inode *dip, struct dentry *dentry, int mode, 75 + static int jfs_create(struct inode *dip, struct dentry *dentry, umode_t mode, 76 76 struct nameidata *nd) 77 77 { 78 78 int rc = 0; ··· 205 205 * note: 206 206 * EACCESS: user needs search+write permission on the parent directory 207 207 */ 208 - static int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode) 208 + static int jfs_mkdir(struct inode *dip, struct dentry *dentry, umode_t mode) 209 209 { 210 210 int rc = 0; 211 211 tid_t tid; /* transaction id */ ··· 1353 1353 * FUNCTION: Create a special file (device) 1354 1354 */ 1355 1355 static int jfs_mknod(struct inode *dir, struct dentry *dentry, 1356 - int mode, dev_t rdev) 1356 + umode_t mode, dev_t rdev) 1357 1357 { 1358 1358 struct jfs_inode_info *jfs_ip; 1359 1359 struct btstack btstack;
+2 -3
fs/jfs/super.c
··· 119 119 { 120 120 struct inode *inode = container_of(head, struct inode, i_rcu); 121 121 struct jfs_inode_info *ji = JFS_IP(inode); 122 - INIT_LIST_HEAD(&inode->i_dentry); 123 122 kmem_cache_free(jfs_inode_cachep, ji); 124 123 } 125 124 ··· 608 609 return 0; 609 610 } 610 611 611 - static int jfs_show_options(struct seq_file *seq, struct vfsmount *vfs) 612 + static int jfs_show_options(struct seq_file *seq, struct dentry *root) 612 613 { 613 - struct jfs_sb_info *sbi = JFS_SBI(vfs->mnt_sb); 614 + struct jfs_sb_info *sbi = JFS_SBI(root->d_sb); 614 615 615 616 if (sbi->uid != -1) 616 617 seq_printf(seq, ",uid=%d", sbi->uid);
+1 -1
fs/libfs.c
··· 12 12 #include <linux/mutex.h> 13 13 #include <linux/exportfs.h> 14 14 #include <linux/writeback.h> 15 - #include <linux/buffer_head.h> 15 + #include <linux/buffer_head.h> /* sync_mapping_buffers */ 16 16 17 17 #include <asm/uaccess.h> 18 18
+1 -1
fs/lockd/svcsubs.c
··· 403 403 { 404 404 struct super_block *sb = datap; 405 405 406 - return sb == file->f_file->f_path.mnt->mnt_sb; 406 + return sb == file->f_file->f_path.dentry->d_sb; 407 407 } 408 408 409 409 /**
+3 -3
fs/logfs/dir.c
··· 482 482 return ret; 483 483 } 484 484 485 - static int logfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 485 + static int logfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 486 486 { 487 487 struct inode *inode; 488 488 ··· 501 501 return __logfs_create(dir, dentry, inode, NULL, 0); 502 502 } 503 503 504 - static int logfs_create(struct inode *dir, struct dentry *dentry, int mode, 504 + static int logfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 505 505 struct nameidata *nd) 506 506 { 507 507 struct inode *inode; ··· 517 517 return __logfs_create(dir, dentry, inode, NULL, 0); 518 518 } 519 519 520 - static int logfs_mknod(struct inode *dir, struct dentry *dentry, int mode, 520 + static int logfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, 521 521 dev_t rdev) 522 522 { 523 523 struct inode *inode;
+1 -2
fs/logfs/inode.c
··· 144 144 static void logfs_i_callback(struct rcu_head *head) 145 145 { 146 146 struct inode *inode = container_of(head, struct inode, i_rcu); 147 - INIT_LIST_HEAD(&inode->i_dentry); 148 147 kmem_cache_free(logfs_inode_cache, logfs_inode(inode)); 149 148 } 150 149 ··· 323 324 mutex_unlock(&super->s_journal_mutex); 324 325 } 325 326 326 - struct inode *logfs_new_inode(struct inode *dir, int mode) 327 + struct inode *logfs_new_inode(struct inode *dir, umode_t mode) 327 328 { 328 329 struct super_block *sb = dir->i_sb; 329 330 struct inode *inode;
+1 -1
fs/logfs/logfs.h
··· 520 520 struct inode *logfs_iget(struct super_block *sb, ino_t ino); 521 521 struct inode *logfs_safe_iget(struct super_block *sb, ino_t ino, int *cookie); 522 522 void logfs_safe_iput(struct inode *inode, int cookie); 523 - struct inode *logfs_new_inode(struct inode *dir, int mode); 523 + struct inode *logfs_new_inode(struct inode *dir, umode_t mode); 524 524 struct inode *logfs_new_meta_inode(struct super_block *sb, u64 ino); 525 525 struct inode *logfs_read_meta_inode(struct super_block *sb, u64 ino); 526 526 int logfs_init_inode_cache(void);
+1 -1
fs/minix/bitmap.c
··· 209 209 mark_buffer_dirty(bh); 210 210 } 211 211 212 - struct inode *minix_new_inode(const struct inode *dir, int mode, int *error) 212 + struct inode *minix_new_inode(const struct inode *dir, umode_t mode, int *error) 213 213 { 214 214 struct super_block *sb = dir->i_sb; 215 215 struct minix_sb_info *sbi = minix_sb(sb);
-1
fs/minix/inode.c
··· 71 71 static void minix_i_callback(struct rcu_head *head) 72 72 { 73 73 struct inode *inode = container_of(head, struct inode, i_rcu); 74 - INIT_LIST_HEAD(&inode->i_dentry); 75 74 kmem_cache_free(minix_inode_cachep, minix_i(inode)); 76 75 } 77 76
+1 -1
fs/minix/minix.h
··· 46 46 extern struct inode *minix_iget(struct super_block *, unsigned long); 47 47 extern struct minix_inode * minix_V1_raw_inode(struct super_block *, ino_t, struct buffer_head **); 48 48 extern struct minix2_inode * minix_V2_raw_inode(struct super_block *, ino_t, struct buffer_head **); 49 - extern struct inode * minix_new_inode(const struct inode *, int, int *); 49 + extern struct inode * minix_new_inode(const struct inode *, umode_t, int *); 50 50 extern void minix_free_inode(struct inode * inode); 51 51 extern unsigned long minix_count_free_inodes(struct super_block *sb); 52 52 extern int minix_new_block(struct inode * inode);
+3 -3
fs/minix/namei.c
··· 36 36 return NULL; 37 37 } 38 38 39 - static int minix_mknod(struct inode * dir, struct dentry *dentry, int mode, dev_t rdev) 39 + static int minix_mknod(struct inode * dir, struct dentry *dentry, umode_t mode, dev_t rdev) 40 40 { 41 41 int error; 42 42 struct inode *inode; ··· 54 54 return error; 55 55 } 56 56 57 - static int minix_create(struct inode * dir, struct dentry *dentry, int mode, 57 + static int minix_create(struct inode *dir, struct dentry *dentry, umode_t mode, 58 58 struct nameidata *nd) 59 59 { 60 60 return minix_mknod(dir, dentry, mode, 0); ··· 103 103 return add_nondir(dentry, inode); 104 104 } 105 105 106 - static int minix_mkdir(struct inode * dir, struct dentry *dentry, int mode) 106 + static int minix_mkdir(struct inode * dir, struct dentry *dentry, umode_t mode) 107 107 { 108 108 struct inode * inode; 109 109 int err = -EMLINK;
+76
fs/mount.h
··· 1 + #include <linux/mount.h> 2 + #include <linux/seq_file.h> 3 + #include <linux/poll.h> 4 + 5 + struct mnt_namespace { 6 + atomic_t count; 7 + struct mount * root; 8 + struct list_head list; 9 + wait_queue_head_t poll; 10 + int event; 11 + }; 12 + 13 + struct mnt_pcp { 14 + int mnt_count; 15 + int mnt_writers; 16 + }; 17 + 18 + struct mount { 19 + struct list_head mnt_hash; 20 + struct mount *mnt_parent; 21 + struct dentry *mnt_mountpoint; 22 + struct vfsmount mnt; 23 + #ifdef CONFIG_SMP 24 + struct mnt_pcp __percpu *mnt_pcp; 25 + atomic_t mnt_longterm; /* how many of the refs are longterm */ 26 + #else 27 + int mnt_count; 28 + int mnt_writers; 29 + #endif 30 + struct list_head mnt_mounts; /* list of children, anchored here */ 31 + struct list_head mnt_child; /* and going through their mnt_child */ 32 + struct list_head mnt_instance; /* mount instance on sb->s_mounts */ 33 + const char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ 34 + struct list_head mnt_list; 35 + struct list_head mnt_expire; /* link in fs-specific expiry list */ 36 + struct list_head mnt_share; /* circular list of shared mounts */ 37 + struct list_head mnt_slave_list;/* list of slave mounts */ 38 + struct list_head mnt_slave; /* slave list entry */ 39 + struct mount *mnt_master; /* slave is on master->mnt_slave_list */ 40 + struct mnt_namespace *mnt_ns; /* containing namespace */ 41 + #ifdef CONFIG_FSNOTIFY 42 + struct hlist_head mnt_fsnotify_marks; 43 + __u32 mnt_fsnotify_mask; 44 + #endif 45 + int mnt_id; /* mount identifier */ 46 + int mnt_group_id; /* peer group identifier */ 47 + int mnt_expiry_mark; /* true if marked for expiry */ 48 + int mnt_pinned; 49 + int mnt_ghosts; 50 + }; 51 + 52 + static inline struct mount *real_mount(struct vfsmount *mnt) 53 + { 54 + return container_of(mnt, struct mount, mnt); 55 + } 56 + 57 + static inline int mnt_has_parent(struct mount *mnt) 58 + { 59 + return mnt != mnt->mnt_parent; 60 + } 61 + 62 + extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int); 63 + 64 + static inline void get_mnt_ns(struct mnt_namespace *ns) 65 + { 66 + atomic_inc(&ns->count); 67 + } 68 + 69 + struct proc_mounts { 70 + struct seq_file m; /* must be the first element */ 71 + struct mnt_namespace *ns; 72 + struct path root; 73 + int (*show)(struct seq_file *, struct vfsmount *); 74 + }; 75 + 76 + extern const struct seq_operations mounts_op;
+29 -26
fs/namei.c
··· 36 36 #include <asm/uaccess.h> 37 37 38 38 #include "internal.h" 39 + #include "mount.h" 39 40 40 41 /* [Feb-1997 T. Schoebel-Theuer] 41 42 * Fundamental changes in the pathname lookup mechanisms (namei) ··· 677 676 678 677 static int follow_up_rcu(struct path *path) 679 678 { 680 - struct vfsmount *parent; 679 + struct mount *mnt = real_mount(path->mnt); 680 + struct mount *parent; 681 681 struct dentry *mountpoint; 682 682 683 - parent = path->mnt->mnt_parent; 684 - if (parent == path->mnt) 683 + parent = mnt->mnt_parent; 684 + if (&parent->mnt == path->mnt) 685 685 return 0; 686 - mountpoint = path->mnt->mnt_mountpoint; 686 + mountpoint = mnt->mnt_mountpoint; 687 687 path->dentry = mountpoint; 688 - path->mnt = parent; 688 + path->mnt = &parent->mnt; 689 689 return 1; 690 690 } 691 691 692 692 int follow_up(struct path *path) 693 693 { 694 - struct vfsmount *parent; 694 + struct mount *mnt = real_mount(path->mnt); 695 + struct mount *parent; 695 696 struct dentry *mountpoint; 696 697 697 698 br_read_lock(vfsmount_lock); 698 - parent = path->mnt->mnt_parent; 699 - if (parent == path->mnt) { 699 + parent = mnt->mnt_parent; 700 + if (&parent->mnt == path->mnt) { 700 701 br_read_unlock(vfsmount_lock); 701 702 return 0; 702 703 } 703 - mntget(parent); 704 - mountpoint = dget(path->mnt->mnt_mountpoint); 704 + mntget(&parent->mnt); 705 + mountpoint = dget(mnt->mnt_mountpoint); 705 706 br_read_unlock(vfsmount_lock); 706 707 dput(path->dentry); 707 708 path->dentry = mountpoint; 708 709 mntput(path->mnt); 709 - path->mnt = parent; 710 + path->mnt = &parent->mnt; 710 711 return 1; 711 712 } 712 713 ··· 887 884 struct inode **inode) 888 885 { 889 886 for (;;) { 890 - struct vfsmount *mounted; 887 + struct mount *mounted; 891 888 /* 892 889 * Don't forget we might have a non-mountpoint managed dentry 893 890 * that wants to block transit. ··· 901 898 mounted = __lookup_mnt(path->mnt, path->dentry, 1); 902 899 if (!mounted) 903 900 break; 904 - path->mnt = mounted; 905 - path->dentry = mounted->mnt_root; 901 + path->mnt = &mounted->mnt; 902 + path->dentry = mounted->mnt.mnt_root; 906 903 nd->flags |= LOOKUP_JUMPED; 907 904 nd->seq = read_seqcount_begin(&path->dentry->d_seq); 908 905 /* ··· 918 915 static void follow_mount_rcu(struct nameidata *nd) 919 916 { 920 917 while (d_mountpoint(nd->path.dentry)) { 921 - struct vfsmount *mounted; 918 + struct mount *mounted; 922 919 mounted = __lookup_mnt(nd->path.mnt, nd->path.dentry, 1); 923 920 if (!mounted) 924 921 break; 925 - nd->path.mnt = mounted; 926 - nd->path.dentry = mounted->mnt_root; 922 + nd->path.mnt = &mounted->mnt; 923 + nd->path.dentry = mounted->mnt.mnt_root; 927 924 nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq); 928 925 } 929 926 } ··· 1979 1976 } 1980 1977 } 1981 1978 1982 - int vfs_create(struct inode *dir, struct dentry *dentry, int mode, 1979 + int vfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 1983 1980 struct nameidata *nd) 1984 1981 { 1985 1982 int error = may_create(dir, dentry); ··· 2180 2177 2181 2178 /* Negative dentry, just create the file */ 2182 2179 if (!dentry->d_inode) { 2183 - int mode = op->mode; 2180 + umode_t mode = op->mode; 2184 2181 if (!IS_POSIXACL(dir->d_inode)) 2185 2182 mode &= ~current_umask(); 2186 2183 /* ··· 2447 2444 } 2448 2445 EXPORT_SYMBOL(user_path_create); 2449 2446 2450 - int vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev) 2447 + int vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) 2451 2448 { 2452 2449 int error = may_create(dir, dentry); 2453 2450 ··· 2475 2472 return error; 2476 2473 } 2477 2474 2478 - static int may_mknod(mode_t mode) 2475 + static int may_mknod(umode_t mode) 2479 2476 { 2480 2477 switch (mode & S_IFMT) { 2481 2478 case S_IFREG: ··· 2492 2489 } 2493 2490 } 2494 2491 2495 - SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, int, mode, 2492 + SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode, 2496 2493 unsigned, dev) 2497 2494 { 2498 2495 struct dentry *dentry; ··· 2539 2536 return error; 2540 2537 } 2541 2538 2542 - SYSCALL_DEFINE3(mknod, const char __user *, filename, int, mode, unsigned, dev) 2539 + SYSCALL_DEFINE3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev) 2543 2540 { 2544 2541 return sys_mknodat(AT_FDCWD, filename, mode, dev); 2545 2542 } 2546 2543 2547 - int vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 2544 + int vfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 2548 2545 { 2549 2546 int error = may_create(dir, dentry); 2550 2547 ··· 2565 2562 return error; 2566 2563 } 2567 2564 2568 - SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, int, mode) 2565 + SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode) 2569 2566 { 2570 2567 struct dentry *dentry; 2571 2568 struct path path; ··· 2593 2590 return error; 2594 2591 } 2595 2592 2596 - SYSCALL_DEFINE2(mkdir, const char __user *, pathname, int, mode) 2593 + SYSCALL_DEFINE2(mkdir, const char __user *, pathname, umode_t, mode) 2597 2594 { 2598 2595 return sys_mkdirat(AT_FDCWD, pathname, mode); 2599 2596 }
+343 -486
fs/namespace.c
··· 9 9 */ 10 10 11 11 #include <linux/syscalls.h> 12 - #include <linux/slab.h> 13 - #include <linux/sched.h> 14 - #include <linux/spinlock.h> 15 - #include <linux/percpu.h> 16 - #include <linux/init.h> 17 - #include <linux/kernel.h> 18 - #include <linux/acct.h> 12 + #include <linux/export.h> 19 13 #include <linux/capability.h> 20 - #include <linux/cpumask.h> 21 - #include <linux/module.h> 22 - #include <linux/sysfs.h> 23 - #include <linux/seq_file.h> 24 14 #include <linux/mnt_namespace.h> 25 15 #include <linux/namei.h> 26 - #include <linux/nsproxy.h> 27 16 #include <linux/security.h> 28 - #include <linux/mount.h> 29 - #include <linux/ramfs.h> 30 - #include <linux/log2.h> 31 17 #include <linux/idr.h> 32 - #include <linux/fs_struct.h> 33 - #include <linux/fsnotify.h> 34 - #include <asm/uaccess.h> 35 - #include <asm/unistd.h> 18 + #include <linux/acct.h> /* acct_auto_close_mnt */ 19 + #include <linux/ramfs.h> /* init_rootfs */ 20 + #include <linux/fs_struct.h> /* get_fs_root et.al. */ 21 + #include <linux/fsnotify.h> /* fsnotify_vfsmount_delete */ 22 + #include <linux/uaccess.h> 36 23 #include "pnode.h" 37 24 #include "internal.h" 38 25 ··· 65 78 * allocation is serialized by namespace_sem, but we need the spinlock to 66 79 * serialize with freeing. 67 80 */ 68 - static int mnt_alloc_id(struct vfsmount *mnt) 81 + static int mnt_alloc_id(struct mount *mnt) 69 82 { 70 83 int res; 71 84 ··· 82 95 return res; 83 96 } 84 97 85 - static void mnt_free_id(struct vfsmount *mnt) 98 + static void mnt_free_id(struct mount *mnt) 86 99 { 87 100 int id = mnt->mnt_id; 88 101 spin_lock(&mnt_id_lock); ··· 97 110 * 98 111 * mnt_group_ida is protected by namespace_sem 99 112 */ 100 - static int mnt_alloc_group_id(struct vfsmount *mnt) 113 + static int mnt_alloc_group_id(struct mount *mnt) 101 114 { 102 115 int res; 103 116 ··· 116 129 /* 117 130 * Release a peer group ID 118 131 */ 119 - void mnt_release_group_id(struct vfsmount *mnt) 132 + void mnt_release_group_id(struct mount *mnt) 120 133 { 121 134 int id = mnt->mnt_group_id; 122 135 ida_remove(&mnt_group_ida, id); ··· 128 141 /* 129 142 * vfsmount lock must be held for read 130 143 */ 131 - static inline void mnt_add_count(struct vfsmount *mnt, int n) 144 + static inline void mnt_add_count(struct mount *mnt, int n) 132 145 { 133 146 #ifdef CONFIG_SMP 134 147 this_cpu_add(mnt->mnt_pcp->mnt_count, n); ··· 139 152 #endif 140 153 } 141 154 142 - static inline void mnt_set_count(struct vfsmount *mnt, int n) 143 - { 144 - #ifdef CONFIG_SMP 145 - this_cpu_write(mnt->mnt_pcp->mnt_count, n); 146 - #else 147 - mnt->mnt_count = n; 148 - #endif 149 - } 150 - 151 - /* 152 - * vfsmount lock must be held for read 153 - */ 154 - static inline void mnt_inc_count(struct vfsmount *mnt) 155 - { 156 - mnt_add_count(mnt, 1); 157 - } 158 - 159 - /* 160 - * vfsmount lock must be held for read 161 - */ 162 - static inline void mnt_dec_count(struct vfsmount *mnt) 163 - { 164 - mnt_add_count(mnt, -1); 165 - } 166 - 167 155 /* 168 156 * vfsmount lock must be held for write 169 157 */ 170 - unsigned int mnt_get_count(struct vfsmount *mnt) 158 + unsigned int mnt_get_count(struct mount *mnt) 171 159 { 172 160 #ifdef CONFIG_SMP 173 161 unsigned int count = 0; ··· 158 196 #endif 159 197 } 160 198 161 - static struct vfsmount *alloc_vfsmnt(const char *name) 199 + static struct mount *alloc_vfsmnt(const char *name) 162 200 { 163 - struct vfsmount *mnt = kmem_cache_zalloc(mnt_cache, GFP_KERNEL); 201 + struct mount *mnt = kmem_cache_zalloc(mnt_cache, GFP_KERNEL); 164 202 if (mnt) { 165 203 int err; 166 204 ··· 239 277 } 240 278 EXPORT_SYMBOL_GPL(__mnt_is_readonly); 241 279 242 - static inline void mnt_inc_writers(struct vfsmount *mnt) 280 + static inline void mnt_inc_writers(struct mount *mnt) 243 281 { 244 282 #ifdef CONFIG_SMP 245 283 this_cpu_inc(mnt->mnt_pcp->mnt_writers); ··· 248 286 #endif 249 287 } 250 288 251 - static inline void mnt_dec_writers(struct vfsmount *mnt) 289 + static inline void mnt_dec_writers(struct mount *mnt) 252 290 { 253 291 #ifdef CONFIG_SMP 254 292 this_cpu_dec(mnt->mnt_pcp->mnt_writers); ··· 257 295 #endif 258 296 } 259 297 260 - static unsigned int mnt_get_writers(struct vfsmount *mnt) 298 + static unsigned int mnt_get_writers(struct mount *mnt) 261 299 { 262 300 #ifdef CONFIG_SMP 263 301 unsigned int count = 0; ··· 273 311 #endif 274 312 } 275 313 314 + static int mnt_is_readonly(struct vfsmount *mnt) 315 + { 316 + if (mnt->mnt_sb->s_readonly_remount) 317 + return 1; 318 + /* Order wrt setting s_flags/s_readonly_remount in do_remount() */ 319 + smp_rmb(); 320 + return __mnt_is_readonly(mnt); 321 + } 322 + 276 323 /* 277 324 * Most r/o checks on a fs are for operations that take 278 325 * discrete amounts of time, like a write() or unlink(). ··· 292 321 */ 293 322 /** 294 323 * mnt_want_write - get write access to a mount 295 - * @mnt: the mount on which to take a write 324 + * @m: the mount on which to take a write 296 325 * 297 326 * This tells the low-level filesystem that a write is 298 327 * about to be performed to it, and makes sure that ··· 300 329 * the write operation is finished, mnt_drop_write() 301 330 * must be called. This is effectively a refcount. 302 331 */ 303 - int mnt_want_write(struct vfsmount *mnt) 332 + int mnt_want_write(struct vfsmount *m) 304 333 { 334 + struct mount *mnt = real_mount(m); 305 335 int ret = 0; 306 336 307 337 preempt_disable(); ··· 313 341 * incremented count after it has set MNT_WRITE_HOLD. 314 342 */ 315 343 smp_mb(); 316 - while (mnt->mnt_flags & MNT_WRITE_HOLD) 344 + while (mnt->mnt.mnt_flags & MNT_WRITE_HOLD) 317 345 cpu_relax(); 318 346 /* 319 347 * After the slowpath clears MNT_WRITE_HOLD, mnt_is_readonly will ··· 321 349 * MNT_WRITE_HOLD is cleared. 322 350 */ 323 351 smp_rmb(); 324 - if (__mnt_is_readonly(mnt)) { 352 + if (mnt_is_readonly(m)) { 325 353 mnt_dec_writers(mnt); 326 354 ret = -EROFS; 327 355 goto out; ··· 350 378 if (__mnt_is_readonly(mnt)) 351 379 return -EROFS; 352 380 preempt_disable(); 353 - mnt_inc_writers(mnt); 381 + mnt_inc_writers(real_mount(mnt)); 354 382 preempt_enable(); 355 383 return 0; 356 384 } ··· 384 412 void mnt_drop_write(struct vfsmount *mnt) 385 413 { 386 414 preempt_disable(); 387 - mnt_dec_writers(mnt); 415 + mnt_dec_writers(real_mount(mnt)); 388 416 preempt_enable(); 389 417 } 390 418 EXPORT_SYMBOL_GPL(mnt_drop_write); 391 419 392 - static int mnt_make_readonly(struct vfsmount *mnt) 420 + void mnt_drop_write_file(struct file *file) 421 + { 422 + mnt_drop_write(file->f_path.mnt); 423 + } 424 + EXPORT_SYMBOL(mnt_drop_write_file); 425 + 426 + static int mnt_make_readonly(struct mount *mnt) 393 427 { 394 428 int ret = 0; 395 429 396 430 br_write_lock(vfsmount_lock); 397 - mnt->mnt_flags |= MNT_WRITE_HOLD; 431 + mnt->mnt.mnt_flags |= MNT_WRITE_HOLD; 398 432 /* 399 433 * After storing MNT_WRITE_HOLD, we'll read the counters. This store 400 434 * should be visible before we do. ··· 426 448 if (mnt_get_writers(mnt) > 0) 427 449 ret = -EBUSY; 428 450 else 429 - mnt->mnt_flags |= MNT_READONLY; 451 + mnt->mnt.mnt_flags |= MNT_READONLY; 430 452 /* 431 453 * MNT_READONLY must become visible before ~MNT_WRITE_HOLD, so writers 432 454 * that become unheld will see MNT_READONLY. 433 455 */ 434 456 smp_wmb(); 435 - mnt->mnt_flags &= ~MNT_WRITE_HOLD; 457 + mnt->mnt.mnt_flags &= ~MNT_WRITE_HOLD; 436 458 br_write_unlock(vfsmount_lock); 437 459 return ret; 438 460 } 439 461 440 - static void __mnt_unmake_readonly(struct vfsmount *mnt) 462 + static void __mnt_unmake_readonly(struct mount *mnt) 441 463 { 442 464 br_write_lock(vfsmount_lock); 443 - mnt->mnt_flags &= ~MNT_READONLY; 465 + mnt->mnt.mnt_flags &= ~MNT_READONLY; 444 466 br_write_unlock(vfsmount_lock); 445 467 } 446 468 447 - static void free_vfsmnt(struct vfsmount *mnt) 469 + int sb_prepare_remount_readonly(struct super_block *sb) 470 + { 471 + struct mount *mnt; 472 + int err = 0; 473 + 474 + /* Racy optimization. Recheck the counter under MNT_WRITE_HOLD */ 475 + if (atomic_long_read(&sb->s_remove_count)) 476 + return -EBUSY; 477 + 478 + br_write_lock(vfsmount_lock); 479 + list_for_each_entry(mnt, &sb->s_mounts, mnt_instance) { 480 + if (!(mnt->mnt.mnt_flags & MNT_READONLY)) { 481 + mnt->mnt.mnt_flags |= MNT_WRITE_HOLD; 482 + smp_mb(); 483 + if (mnt_get_writers(mnt) > 0) { 484 + err = -EBUSY; 485 + break; 486 + } 487 + } 488 + } 489 + if (!err && atomic_long_read(&sb->s_remove_count)) 490 + err = -EBUSY; 491 + 492 + if (!err) { 493 + sb->s_readonly_remount = 1; 494 + smp_wmb(); 495 + } 496 + list_for_each_entry(mnt, &sb->s_mounts, mnt_instance) { 497 + if (mnt->mnt.mnt_flags & MNT_WRITE_HOLD) 498 + mnt->mnt.mnt_flags &= ~MNT_WRITE_HOLD; 499 + } 500 + br_write_unlock(vfsmount_lock); 501 + 502 + return err; 503 + } 504 + 505 + static void free_vfsmnt(struct mount *mnt) 448 506 { 449 507 kfree(mnt->mnt_devname); 450 508 mnt_free_id(mnt); ··· 495 481 * @dir. If @dir is set return the first mount else return the last mount. 496 482 * vfsmount_lock must be held for read or write. 497 483 */ 498 - struct vfsmount *__lookup_mnt(struct vfsmount *mnt, struct dentry *dentry, 484 + struct mount *__lookup_mnt(struct vfsmount *mnt, struct dentry *dentry, 499 485 int dir) 500 486 { 501 487 struct list_head *head = mount_hashtable + hash(mnt, dentry); 502 488 struct list_head *tmp = head; 503 - struct vfsmount *p, *found = NULL; 489 + struct mount *p, *found = NULL; 504 490 505 491 for (;;) { 506 492 tmp = dir ? tmp->next : tmp->prev; 507 493 p = NULL; 508 494 if (tmp == head) 509 495 break; 510 - p = list_entry(tmp, struct vfsmount, mnt_hash); 511 - if (p->mnt_parent == mnt && p->mnt_mountpoint == dentry) { 496 + p = list_entry(tmp, struct mount, mnt_hash); 497 + if (&p->mnt_parent->mnt == mnt && p->mnt_mountpoint == dentry) { 512 498 found = p; 513 499 break; 514 500 } ··· 522 508 */ 523 509 struct vfsmount *lookup_mnt(struct path *path) 524 510 { 525 - struct vfsmount *child_mnt; 511 + struct mount *child_mnt; 526 512 527 513 br_read_lock(vfsmount_lock); 528 - if ((child_mnt = __lookup_mnt(path->mnt, path->dentry, 1))) 529 - mntget(child_mnt); 530 - br_read_unlock(vfsmount_lock); 531 - return child_mnt; 514 + child_mnt = __lookup_mnt(path->mnt, path->dentry, 1); 515 + if (child_mnt) { 516 + mnt_add_count(child_mnt, 1); 517 + br_read_unlock(vfsmount_lock); 518 + return &child_mnt->mnt; 519 + } else { 520 + br_read_unlock(vfsmount_lock); 521 + return NULL; 522 + } 532 523 } 533 524 534 - static inline int check_mnt(struct vfsmount *mnt) 525 + static inline int check_mnt(struct mount *mnt) 535 526 { 536 527 return mnt->mnt_ns == current->nsproxy->mnt_ns; 537 528 } ··· 567 548 * Clear dentry's mounted state if it has no remaining mounts. 568 549 * vfsmount_lock must be held for write. 569 550 */ 570 - static void dentry_reset_mounted(struct vfsmount *mnt, struct dentry *dentry) 551 + static void dentry_reset_mounted(struct dentry *dentry) 571 552 { 572 553 unsigned u; 573 554 574 555 for (u = 0; u < HASH_SIZE; u++) { 575 - struct vfsmount *p; 556 + struct mount *p; 576 557 577 558 list_for_each_entry(p, &mount_hashtable[u], mnt_hash) { 578 559 if (p->mnt_mountpoint == dentry) ··· 587 568 /* 588 569 * vfsmount lock must be held for write 589 570 */ 590 - static void detach_mnt(struct vfsmount *mnt, struct path *old_path) 571 + static void detach_mnt(struct mount *mnt, struct path *old_path) 591 572 { 592 573 old_path->dentry = mnt->mnt_mountpoint; 593 - old_path->mnt = mnt->mnt_parent; 574 + old_path->mnt = &mnt->mnt_parent->mnt; 594 575 mnt->mnt_parent = mnt; 595 - mnt->mnt_mountpoint = mnt->mnt_root; 576 + mnt->mnt_mountpoint = mnt->mnt.mnt_root; 596 577 list_del_init(&mnt->mnt_child); 597 578 list_del_init(&mnt->mnt_hash); 598 - dentry_reset_mounted(old_path->mnt, old_path->dentry); 579 + dentry_reset_mounted(old_path->dentry); 599 580 } 600 581 601 582 /* 602 583 * vfsmount lock must be held for write 603 584 */ 604 - void mnt_set_mountpoint(struct vfsmount *mnt, struct dentry *dentry, 605 - struct vfsmount *child_mnt) 585 + void mnt_set_mountpoint(struct mount *mnt, struct dentry *dentry, 586 + struct mount *child_mnt) 606 587 { 607 - child_mnt->mnt_parent = mntget(mnt); 588 + mnt_add_count(mnt, 1); /* essentially, that's mntget */ 608 589 child_mnt->mnt_mountpoint = dget(dentry); 590 + child_mnt->mnt_parent = mnt; 609 591 spin_lock(&dentry->d_lock); 610 592 dentry->d_flags |= DCACHE_MOUNTED; 611 593 spin_unlock(&dentry->d_lock); ··· 615 595 /* 616 596 * vfsmount lock must be held for write 617 597 */ 618 - static void attach_mnt(struct vfsmount *mnt, struct path *path) 598 + static void attach_mnt(struct mount *mnt, struct path *path) 619 599 { 620 - mnt_set_mountpoint(path->mnt, path->dentry, mnt); 600 + mnt_set_mountpoint(real_mount(path->mnt), path->dentry, mnt); 621 601 list_add_tail(&mnt->mnt_hash, mount_hashtable + 622 602 hash(path->mnt, path->dentry)); 623 - list_add_tail(&mnt->mnt_child, &path->mnt->mnt_mounts); 603 + list_add_tail(&mnt->mnt_child, &real_mount(path->mnt)->mnt_mounts); 624 604 } 625 605 626 - static inline void __mnt_make_longterm(struct vfsmount *mnt) 606 + static inline void __mnt_make_longterm(struct mount *mnt) 627 607 { 628 608 #ifdef CONFIG_SMP 629 609 atomic_inc(&mnt->mnt_longterm); ··· 631 611 } 632 612 633 613 /* needs vfsmount lock for write */ 634 - static inline void __mnt_make_shortterm(struct vfsmount *mnt) 614 + static inline void __mnt_make_shortterm(struct mount *mnt) 635 615 { 636 616 #ifdef CONFIG_SMP 637 617 atomic_dec(&mnt->mnt_longterm); ··· 641 621 /* 642 622 * vfsmount lock must be held for write 643 623 */ 644 - static void commit_tree(struct vfsmount *mnt) 624 + static void commit_tree(struct mount *mnt) 645 625 { 646 - struct vfsmount *parent = mnt->mnt_parent; 647 - struct vfsmount *m; 626 + struct mount *parent = mnt->mnt_parent; 627 + struct mount *m; 648 628 LIST_HEAD(head); 649 629 struct mnt_namespace *n = parent->mnt_ns; 650 630 ··· 659 639 list_splice(&head, n->list.prev); 660 640 661 641 list_add_tail(&mnt->mnt_hash, mount_hashtable + 662 - hash(parent, mnt->mnt_mountpoint)); 642 + hash(&parent->mnt, mnt->mnt_mountpoint)); 663 643 list_add_tail(&mnt->mnt_child, &parent->mnt_mounts); 664 644 touch_mnt_namespace(n); 665 645 } 666 646 667 - static struct vfsmount *next_mnt(struct vfsmount *p, struct vfsmount *root) 647 + static struct mount *next_mnt(struct mount *p, struct mount *root) 668 648 { 669 649 struct list_head *next = p->mnt_mounts.next; 670 650 if (next == &p->mnt_mounts) { ··· 677 657 p = p->mnt_parent; 678 658 } 679 659 } 680 - return list_entry(next, struct vfsmount, mnt_child); 660 + return list_entry(next, struct mount, mnt_child); 681 661 } 682 662 683 - static struct vfsmount *skip_mnt_tree(struct vfsmount *p) 663 + static struct mount *skip_mnt_tree(struct mount *p) 684 664 { 685 665 struct list_head *prev = p->mnt_mounts.prev; 686 666 while (prev != &p->mnt_mounts) { 687 - p = list_entry(prev, struct vfsmount, mnt_child); 667 + p = list_entry(prev, struct mount, mnt_child); 688 668 prev = p->mnt_mounts.prev; 689 669 } 690 670 return p; ··· 693 673 struct vfsmount * 694 674 vfs_kern_mount(struct file_system_type *type, int flags, const char *name, void *data) 695 675 { 696 - struct vfsmount *mnt; 676 + struct mount *mnt; 697 677 struct dentry *root; 698 678 699 679 if (!type) ··· 704 684 return ERR_PTR(-ENOMEM); 705 685 706 686 if (flags & MS_KERNMOUNT) 707 - mnt->mnt_flags = MNT_INTERNAL; 687 + mnt->mnt.mnt_flags = MNT_INTERNAL; 708 688 709 689 root = mount_fs(type, flags, name, data); 710 690 if (IS_ERR(root)) { ··· 712 692 return ERR_CAST(root); 713 693 } 714 694 715 - mnt->mnt_root = root; 716 - mnt->mnt_sb = root->d_sb; 717 - mnt->mnt_mountpoint = mnt->mnt_root; 695 + mnt->mnt.mnt_root = root; 696 + mnt->mnt.mnt_sb = root->d_sb; 697 + mnt->mnt_mountpoint = mnt->mnt.mnt_root; 718 698 mnt->mnt_parent = mnt; 719 - return mnt; 699 + br_write_lock(vfsmount_lock); 700 + list_add_tail(&mnt->mnt_instance, &root->d_sb->s_mounts); 701 + br_write_unlock(vfsmount_lock); 702 + return &mnt->mnt; 720 703 } 721 704 EXPORT_SYMBOL_GPL(vfs_kern_mount); 722 705 723 - static struct vfsmount *clone_mnt(struct vfsmount *old, struct dentry *root, 706 + static struct mount *clone_mnt(struct mount *old, struct dentry *root, 724 707 int flag) 725 708 { 726 - struct super_block *sb = old->mnt_sb; 727 - struct vfsmount *mnt = alloc_vfsmnt(old->mnt_devname); 709 + struct super_block *sb = old->mnt.mnt_sb; 710 + struct mount *mnt = alloc_vfsmnt(old->mnt_devname); 728 711 729 712 if (mnt) { 730 713 if (flag & (CL_SLAVE | CL_PRIVATE)) ··· 741 718 goto out_free; 742 719 } 743 720 744 - mnt->mnt_flags = old->mnt_flags & ~MNT_WRITE_HOLD; 721 + mnt->mnt.mnt_flags = old->mnt.mnt_flags & ~MNT_WRITE_HOLD; 745 722 atomic_inc(&sb->s_active); 746 - mnt->mnt_sb = sb; 747 - mnt->mnt_root = dget(root); 748 - mnt->mnt_mountpoint = mnt->mnt_root; 723 + mnt->mnt.mnt_sb = sb; 724 + mnt->mnt.mnt_root = dget(root); 725 + mnt->mnt_mountpoint = mnt->mnt.mnt_root; 749 726 mnt->mnt_parent = mnt; 727 + br_write_lock(vfsmount_lock); 728 + list_add_tail(&mnt->mnt_instance, &sb->s_mounts); 729 + br_write_unlock(vfsmount_lock); 750 730 751 731 if (flag & CL_SLAVE) { 752 732 list_add(&mnt->mnt_slave, &old->mnt_slave_list); ··· 779 753 return NULL; 780 754 } 781 755 782 - static inline void mntfree(struct vfsmount *mnt) 756 + static inline void mntfree(struct mount *mnt) 783 757 { 784 - struct super_block *sb = mnt->mnt_sb; 758 + struct vfsmount *m = &mnt->mnt; 759 + struct super_block *sb = m->mnt_sb; 785 760 786 761 /* 787 762 * This probably indicates that somebody messed ··· 795 768 * so mnt_get_writers() below is safe. 796 769 */ 797 770 WARN_ON(mnt_get_writers(mnt)); 798 - fsnotify_vfsmount_delete(mnt); 799 - dput(mnt->mnt_root); 771 + fsnotify_vfsmount_delete(m); 772 + dput(m->mnt_root); 800 773 free_vfsmnt(mnt); 801 774 deactivate_super(sb); 802 775 } 803 776 804 - static void mntput_no_expire(struct vfsmount *mnt) 777 + static void mntput_no_expire(struct mount *mnt) 805 778 { 806 779 put_again: 807 780 #ifdef CONFIG_SMP 808 781 br_read_lock(vfsmount_lock); 809 782 if (likely(atomic_read(&mnt->mnt_longterm))) { 810 - mnt_dec_count(mnt); 783 + mnt_add_count(mnt, -1); 811 784 br_read_unlock(vfsmount_lock); 812 785 return; 813 786 } 814 787 br_read_unlock(vfsmount_lock); 815 788 816 789 br_write_lock(vfsmount_lock); 817 - mnt_dec_count(mnt); 790 + mnt_add_count(mnt, -1); 818 791 if (mnt_get_count(mnt)) { 819 792 br_write_unlock(vfsmount_lock); 820 793 return; 821 794 } 822 795 #else 823 - mnt_dec_count(mnt); 796 + mnt_add_count(mnt, -1); 824 797 if (likely(mnt_get_count(mnt))) 825 798 return; 826 799 br_write_lock(vfsmount_lock); ··· 829 802 mnt_add_count(mnt, mnt->mnt_pinned + 1); 830 803 mnt->mnt_pinned = 0; 831 804 br_write_unlock(vfsmount_lock); 832 - acct_auto_close_mnt(mnt); 805 + acct_auto_close_mnt(&mnt->mnt); 833 806 goto put_again; 834 807 } 808 + list_del(&mnt->mnt_instance); 835 809 br_write_unlock(vfsmount_lock); 836 810 mntfree(mnt); 837 811 } ··· 840 812 void mntput(struct vfsmount *mnt) 841 813 { 842 814 if (mnt) { 815 + struct mount *m = real_mount(mnt); 843 816 /* avoid cacheline pingpong, hope gcc doesn't get "smart" */ 844 - if (unlikely(mnt->mnt_expiry_mark)) 845 - mnt->mnt_expiry_mark = 0; 846 - mntput_no_expire(mnt); 817 + if (unlikely(m->mnt_expiry_mark)) 818 + m->mnt_expiry_mark = 0; 819 + mntput_no_expire(m); 847 820 } 848 821 } 849 822 EXPORT_SYMBOL(mntput); ··· 852 823 struct vfsmount *mntget(struct vfsmount *mnt) 853 824 { 854 825 if (mnt) 855 - mnt_inc_count(mnt); 826 + mnt_add_count(real_mount(mnt), 1); 856 827 return mnt; 857 828 } 858 829 EXPORT_SYMBOL(mntget); ··· 860 831 void mnt_pin(struct vfsmount *mnt) 861 832 { 862 833 br_write_lock(vfsmount_lock); 863 - mnt->mnt_pinned++; 834 + real_mount(mnt)->mnt_pinned++; 864 835 br_write_unlock(vfsmount_lock); 865 836 } 866 837 EXPORT_SYMBOL(mnt_pin); 867 838 868 - void mnt_unpin(struct vfsmount *mnt) 839 + void mnt_unpin(struct vfsmount *m) 869 840 { 841 + struct mount *mnt = real_mount(m); 870 842 br_write_lock(vfsmount_lock); 871 843 if (mnt->mnt_pinned) { 872 - mnt_inc_count(mnt); 844 + mnt_add_count(mnt, 1); 873 845 mnt->mnt_pinned--; 874 846 } 875 847 br_write_unlock(vfsmount_lock); ··· 888 858 * 889 859 * See also save_mount_options(). 890 860 */ 891 - int generic_show_options(struct seq_file *m, struct vfsmount *mnt) 861 + int generic_show_options(struct seq_file *m, struct dentry *root) 892 862 { 893 863 const char *options; 894 864 895 865 rcu_read_lock(); 896 - options = rcu_dereference(mnt->mnt_sb->s_options); 866 + options = rcu_dereference(root->d_sb->s_options); 897 867 898 868 if (options != NULL && options[0]) { 899 869 seq_putc(m, ','); ··· 937 907 EXPORT_SYMBOL(replace_mount_options); 938 908 939 909 #ifdef CONFIG_PROC_FS 940 - /* iterator */ 910 + /* iterator; we want it to have access to namespace_sem, thus here... */ 941 911 static void *m_start(struct seq_file *m, loff_t *pos) 942 912 { 943 - struct proc_mounts *p = m->private; 913 + struct proc_mounts *p = container_of(m, struct proc_mounts, m); 944 914 945 915 down_read(&namespace_sem); 946 916 return seq_list_start(&p->ns->list, *pos); ··· 948 918 949 919 static void *m_next(struct seq_file *m, void *v, loff_t *pos) 950 920 { 951 - struct proc_mounts *p = m->private; 921 + struct proc_mounts *p = container_of(m, struct proc_mounts, m); 952 922 953 923 return seq_list_next(v, &p->ns->list, pos); 954 924 } ··· 958 928 up_read(&namespace_sem); 959 929 } 960 930 961 - int mnt_had_events(struct proc_mounts *p) 931 + static int m_show(struct seq_file *m, void *v) 962 932 { 963 - struct mnt_namespace *ns = p->ns; 964 - int res = 0; 965 - 966 - br_read_lock(vfsmount_lock); 967 - if (p->m.poll_event != ns->event) { 968 - p->m.poll_event = ns->event; 969 - res = 1; 970 - } 971 - br_read_unlock(vfsmount_lock); 972 - 973 - return res; 974 - } 975 - 976 - struct proc_fs_info { 977 - int flag; 978 - const char *str; 979 - }; 980 - 981 - static int show_sb_opts(struct seq_file *m, struct super_block *sb) 982 - { 983 - static const struct proc_fs_info fs_info[] = { 984 - { MS_SYNCHRONOUS, ",sync" }, 985 - { MS_DIRSYNC, ",dirsync" }, 986 - { MS_MANDLOCK, ",mand" }, 987 - { 0, NULL } 988 - }; 989 - const struct proc_fs_info *fs_infop; 990 - 991 - for (fs_infop = fs_info; fs_infop->flag; fs_infop++) { 992 - if (sb->s_flags & fs_infop->flag) 993 - seq_puts(m, fs_infop->str); 994 - } 995 - 996 - return security_sb_show_options(m, sb); 997 - } 998 - 999 - static void show_mnt_opts(struct seq_file *m, struct vfsmount *mnt) 1000 - { 1001 - static const struct proc_fs_info mnt_info[] = { 1002 - { MNT_NOSUID, ",nosuid" }, 1003 - { MNT_NODEV, ",nodev" }, 1004 - { MNT_NOEXEC, ",noexec" }, 1005 - { MNT_NOATIME, ",noatime" }, 1006 - { MNT_NODIRATIME, ",nodiratime" }, 1007 - { MNT_RELATIME, ",relatime" }, 1008 - { 0, NULL } 1009 - }; 1010 - const struct proc_fs_info *fs_infop; 1011 - 1012 - for (fs_infop = mnt_info; fs_infop->flag; fs_infop++) { 1013 - if (mnt->mnt_flags & fs_infop->flag) 1014 - seq_puts(m, fs_infop->str); 1015 - } 1016 - } 1017 - 1018 - static void show_type(struct seq_file *m, struct super_block *sb) 1019 - { 1020 - mangle(m, sb->s_type->name); 1021 - if (sb->s_subtype && sb->s_subtype[0]) { 1022 - seq_putc(m, '.'); 1023 - mangle(m, sb->s_subtype); 1024 - } 1025 - } 1026 - 1027 - static int show_vfsmnt(struct seq_file *m, void *v) 1028 - { 1029 - struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list); 1030 - int err = 0; 1031 - struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; 1032 - 1033 - if (mnt->mnt_sb->s_op->show_devname) { 1034 - err = mnt->mnt_sb->s_op->show_devname(m, mnt); 1035 - if (err) 1036 - goto out; 1037 - } else { 1038 - mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none"); 1039 - } 1040 - seq_putc(m, ' '); 1041 - seq_path(m, &mnt_path, " \t\n\\"); 1042 - seq_putc(m, ' '); 1043 - show_type(m, mnt->mnt_sb); 1044 - seq_puts(m, __mnt_is_readonly(mnt) ? " ro" : " rw"); 1045 - err = show_sb_opts(m, mnt->mnt_sb); 1046 - if (err) 1047 - goto out; 1048 - show_mnt_opts(m, mnt); 1049 - if (mnt->mnt_sb->s_op->show_options) 1050 - err = mnt->mnt_sb->s_op->show_options(m, mnt); 1051 - seq_puts(m, " 0 0\n"); 1052 - out: 1053 - return err; 933 + struct proc_mounts *p = container_of(m, struct proc_mounts, m); 934 + struct mount *r = list_entry(v, struct mount, mnt_list); 935 + return p->show(m, &r->mnt); 1054 936 } 1055 937 1056 938 const struct seq_operations mounts_op = { 1057 939 .start = m_start, 1058 940 .next = m_next, 1059 941 .stop = m_stop, 1060 - .show = show_vfsmnt 1061 - }; 1062 - 1063 - static int show_mountinfo(struct seq_file *m, void *v) 1064 - { 1065 - struct proc_mounts *p = m->private; 1066 - struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list); 1067 - struct super_block *sb = mnt->mnt_sb; 1068 - struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; 1069 - struct path root = p->root; 1070 - int err = 0; 1071 - 1072 - seq_printf(m, "%i %i %u:%u ", mnt->mnt_id, mnt->mnt_parent->mnt_id, 1073 - MAJOR(sb->s_dev), MINOR(sb->s_dev)); 1074 - if (sb->s_op->show_path) 1075 - err = sb->s_op->show_path(m, mnt); 1076 - else 1077 - seq_dentry(m, mnt->mnt_root, " \t\n\\"); 1078 - if (err) 1079 - goto out; 1080 - seq_putc(m, ' '); 1081 - 1082 - /* mountpoints outside of chroot jail will give SEQ_SKIP on this */ 1083 - err = seq_path_root(m, &mnt_path, &root, " \t\n\\"); 1084 - if (err) 1085 - goto out; 1086 - 1087 - seq_puts(m, mnt->mnt_flags & MNT_READONLY ? " ro" : " rw"); 1088 - show_mnt_opts(m, mnt); 1089 - 1090 - /* Tagged fields ("foo:X" or "bar") */ 1091 - if (IS_MNT_SHARED(mnt)) 1092 - seq_printf(m, " shared:%i", mnt->mnt_group_id); 1093 - if (IS_MNT_SLAVE(mnt)) { 1094 - int master = mnt->mnt_master->mnt_group_id; 1095 - int dom = get_dominating_id(mnt, &p->root); 1096 - seq_printf(m, " master:%i", master); 1097 - if (dom && dom != master) 1098 - seq_printf(m, " propagate_from:%i", dom); 1099 - } 1100 - if (IS_MNT_UNBINDABLE(mnt)) 1101 - seq_puts(m, " unbindable"); 1102 - 1103 - /* Filesystem specific data */ 1104 - seq_puts(m, " - "); 1105 - show_type(m, sb); 1106 - seq_putc(m, ' '); 1107 - if (sb->s_op->show_devname) 1108 - err = sb->s_op->show_devname(m, mnt); 1109 - else 1110 - mangle(m, mnt->mnt_devname ? mnt->mnt_devname : "none"); 1111 - if (err) 1112 - goto out; 1113 - seq_puts(m, sb->s_flags & MS_RDONLY ? " ro" : " rw"); 1114 - err = show_sb_opts(m, sb); 1115 - if (err) 1116 - goto out; 1117 - if (sb->s_op->show_options) 1118 - err = sb->s_op->show_options(m, mnt); 1119 - seq_putc(m, '\n'); 1120 - out: 1121 - return err; 1122 - } 1123 - 1124 - const struct seq_operations mountinfo_op = { 1125 - .start = m_start, 1126 - .next = m_next, 1127 - .stop = m_stop, 1128 - .show = show_mountinfo, 1129 - }; 1130 - 1131 - static int show_vfsstat(struct seq_file *m, void *v) 1132 - { 1133 - struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list); 1134 - struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; 1135 - int err = 0; 1136 - 1137 - /* device */ 1138 - if (mnt->mnt_sb->s_op->show_devname) { 1139 - seq_puts(m, "device "); 1140 - err = mnt->mnt_sb->s_op->show_devname(m, mnt); 1141 - } else { 1142 - if (mnt->mnt_devname) { 1143 - seq_puts(m, "device "); 1144 - mangle(m, mnt->mnt_devname); 1145 - } else 1146 - seq_puts(m, "no device"); 1147 - } 1148 - 1149 - /* mount point */ 1150 - seq_puts(m, " mounted on "); 1151 - seq_path(m, &mnt_path, " \t\n\\"); 1152 - seq_putc(m, ' '); 1153 - 1154 - /* file system type */ 1155 - seq_puts(m, "with fstype "); 1156 - show_type(m, mnt->mnt_sb); 1157 - 1158 - /* optional statistics */ 1159 - if (mnt->mnt_sb->s_op->show_stats) { 1160 - seq_putc(m, ' '); 1161 - if (!err) 1162 - err = mnt->mnt_sb->s_op->show_stats(m, mnt); 1163 - } 1164 - 1165 - seq_putc(m, '\n'); 1166 - return err; 1167 - } 1168 - 1169 - const struct seq_operations mountstats_op = { 1170 - .start = m_start, 1171 - .next = m_next, 1172 - .stop = m_stop, 1173 - .show = show_vfsstat, 942 + .show = m_show, 1174 943 }; 1175 944 #endif /* CONFIG_PROC_FS */ 1176 945 ··· 981 1152 * open files, pwds, chroots or sub mounts that are 982 1153 * busy. 983 1154 */ 984 - int may_umount_tree(struct vfsmount *mnt) 1155 + int may_umount_tree(struct vfsmount *m) 985 1156 { 1157 + struct mount *mnt = real_mount(m); 986 1158 int actual_refs = 0; 987 1159 int minimum_refs = 0; 988 - struct vfsmount *p; 1160 + struct mount *p; 1161 + BUG_ON(!m); 989 1162 990 1163 /* write lock needed for mnt_get_count */ 991 1164 br_write_lock(vfsmount_lock); ··· 1023 1192 int ret = 1; 1024 1193 down_read(&namespace_sem); 1025 1194 br_write_lock(vfsmount_lock); 1026 - if (propagate_mount_busy(mnt, 2)) 1195 + if (propagate_mount_busy(real_mount(mnt), 2)) 1027 1196 ret = 0; 1028 1197 br_write_unlock(vfsmount_lock); 1029 1198 up_read(&namespace_sem); ··· 1034 1203 1035 1204 void release_mounts(struct list_head *head) 1036 1205 { 1037 - struct vfsmount *mnt; 1206 + struct mount *mnt; 1038 1207 while (!list_empty(head)) { 1039 - mnt = list_first_entry(head, struct vfsmount, mnt_hash); 1208 + mnt = list_first_entry(head, struct mount, mnt_hash); 1040 1209 list_del_init(&mnt->mnt_hash); 1041 - if (mnt->mnt_parent != mnt) { 1210 + if (mnt_has_parent(mnt)) { 1042 1211 struct dentry *dentry; 1043 - struct vfsmount *m; 1212 + struct mount *m; 1044 1213 1045 1214 br_write_lock(vfsmount_lock); 1046 1215 dentry = mnt->mnt_mountpoint; 1047 1216 m = mnt->mnt_parent; 1048 - mnt->mnt_mountpoint = mnt->mnt_root; 1217 + mnt->mnt_mountpoint = mnt->mnt.mnt_root; 1049 1218 mnt->mnt_parent = mnt; 1050 1219 m->mnt_ghosts--; 1051 1220 br_write_unlock(vfsmount_lock); 1052 1221 dput(dentry); 1053 - mntput(m); 1222 + mntput(&m->mnt); 1054 1223 } 1055 - mntput(mnt); 1224 + mntput(&mnt->mnt); 1056 1225 } 1057 1226 } 1058 1227 ··· 1060 1229 * vfsmount lock must be held for write 1061 1230 * namespace_sem must be held for write 1062 1231 */ 1063 - void umount_tree(struct vfsmount *mnt, int propagate, struct list_head *kill) 1232 + void umount_tree(struct mount *mnt, int propagate, struct list_head *kill) 1064 1233 { 1065 1234 LIST_HEAD(tmp_list); 1066 - struct vfsmount *p; 1235 + struct mount *p; 1067 1236 1068 1237 for (p = mnt; p; p = next_mnt(p, mnt)) 1069 1238 list_move(&p->mnt_hash, &tmp_list); ··· 1078 1247 p->mnt_ns = NULL; 1079 1248 __mnt_make_shortterm(p); 1080 1249 list_del_init(&p->mnt_child); 1081 - if (p->mnt_parent != p) { 1250 + if (mnt_has_parent(p)) { 1082 1251 p->mnt_parent->mnt_ghosts++; 1083 - dentry_reset_mounted(p->mnt_parent, p->mnt_mountpoint); 1252 + dentry_reset_mounted(p->mnt_mountpoint); 1084 1253 } 1085 1254 change_mnt_propagation(p, MS_PRIVATE); 1086 1255 } 1087 1256 list_splice(&tmp_list, kill); 1088 1257 } 1089 1258 1090 - static void shrink_submounts(struct vfsmount *mnt, struct list_head *umounts); 1259 + static void shrink_submounts(struct mount *mnt, struct list_head *umounts); 1091 1260 1092 - static int do_umount(struct vfsmount *mnt, int flags) 1261 + static int do_umount(struct mount *mnt, int flags) 1093 1262 { 1094 - struct super_block *sb = mnt->mnt_sb; 1263 + struct super_block *sb = mnt->mnt.mnt_sb; 1095 1264 int retval; 1096 1265 LIST_HEAD(umount_list); 1097 1266 1098 - retval = security_sb_umount(mnt, flags); 1267 + retval = security_sb_umount(&mnt->mnt, flags); 1099 1268 if (retval) 1100 1269 return retval; 1101 1270 ··· 1106 1275 * (2) the usage count == 1 [parent vfsmount] + 1 [sys_umount] 1107 1276 */ 1108 1277 if (flags & MNT_EXPIRE) { 1109 - if (mnt == current->fs->root.mnt || 1278 + if (&mnt->mnt == current->fs->root.mnt || 1110 1279 flags & (MNT_FORCE | MNT_DETACH)) 1111 1280 return -EINVAL; 1112 1281 ··· 1148 1317 * /reboot - static binary that would close all descriptors and 1149 1318 * call reboot(9). Then init(8) could umount root and exec /reboot. 1150 1319 */ 1151 - if (mnt == current->fs->root.mnt && !(flags & MNT_DETACH)) { 1320 + if (&mnt->mnt == current->fs->root.mnt && !(flags & MNT_DETACH)) { 1152 1321 /* 1153 1322 * Special case for "unmounting" root ... 1154 1323 * we just try to remount it readonly. ··· 1190 1359 SYSCALL_DEFINE2(umount, char __user *, name, int, flags) 1191 1360 { 1192 1361 struct path path; 1362 + struct mount *mnt; 1193 1363 int retval; 1194 1364 int lookup_flags = 0; 1195 1365 ··· 1203 1371 retval = user_path_at(AT_FDCWD, name, lookup_flags, &path); 1204 1372 if (retval) 1205 1373 goto out; 1374 + mnt = real_mount(path.mnt); 1206 1375 retval = -EINVAL; 1207 1376 if (path.dentry != path.mnt->mnt_root) 1208 1377 goto dput_and_out; 1209 - if (!check_mnt(path.mnt)) 1378 + if (!check_mnt(mnt)) 1210 1379 goto dput_and_out; 1211 1380 1212 1381 retval = -EPERM; 1213 1382 if (!capable(CAP_SYS_ADMIN)) 1214 1383 goto dput_and_out; 1215 1384 1216 - retval = do_umount(path.mnt, flags); 1385 + retval = do_umount(mnt, flags); 1217 1386 dput_and_out: 1218 1387 /* we mustn't call path_put() as that would clear mnt_expiry_mark */ 1219 1388 dput(path.dentry); 1220 - mntput_no_expire(path.mnt); 1389 + mntput_no_expire(mnt); 1221 1390 out: 1222 1391 return retval; 1223 1392 } ··· 1253 1420 #endif 1254 1421 } 1255 1422 1256 - struct vfsmount *copy_tree(struct vfsmount *mnt, struct dentry *dentry, 1423 + struct mount *copy_tree(struct mount *mnt, struct dentry *dentry, 1257 1424 int flag) 1258 1425 { 1259 - struct vfsmount *res, *p, *q, *r, *s; 1426 + struct mount *res, *p, *q, *r; 1260 1427 struct path path; 1261 1428 1262 1429 if (!(flag & CL_COPY_ALL) && IS_MNT_UNBINDABLE(mnt)) ··· 1269 1436 1270 1437 p = mnt; 1271 1438 list_for_each_entry(r, &mnt->mnt_mounts, mnt_child) { 1439 + struct mount *s; 1272 1440 if (!is_subdir(r->mnt_mountpoint, dentry)) 1273 1441 continue; 1274 1442 ··· 1283 1449 q = q->mnt_parent; 1284 1450 } 1285 1451 p = s; 1286 - path.mnt = q; 1452 + path.mnt = &q->mnt; 1287 1453 path.dentry = p->mnt_mountpoint; 1288 - q = clone_mnt(p, p->mnt_root, flag); 1454 + q = clone_mnt(p, p->mnt.mnt_root, flag); 1289 1455 if (!q) 1290 1456 goto Enomem; 1291 1457 br_write_lock(vfsmount_lock); ··· 1308 1474 1309 1475 struct vfsmount *collect_mounts(struct path *path) 1310 1476 { 1311 - struct vfsmount *tree; 1477 + struct mount *tree; 1312 1478 down_write(&namespace_sem); 1313 - tree = copy_tree(path->mnt, path->dentry, CL_COPY_ALL | CL_PRIVATE); 1479 + tree = copy_tree(real_mount(path->mnt), path->dentry, 1480 + CL_COPY_ALL | CL_PRIVATE); 1314 1481 up_write(&namespace_sem); 1315 - return tree; 1482 + return tree ? &tree->mnt : NULL; 1316 1483 } 1317 1484 1318 1485 void drop_collected_mounts(struct vfsmount *mnt) ··· 1321 1486 LIST_HEAD(umount_list); 1322 1487 down_write(&namespace_sem); 1323 1488 br_write_lock(vfsmount_lock); 1324 - umount_tree(mnt, 0, &umount_list); 1489 + umount_tree(real_mount(mnt), 0, &umount_list); 1325 1490 br_write_unlock(vfsmount_lock); 1326 1491 up_write(&namespace_sem); 1327 1492 release_mounts(&umount_list); ··· 1330 1495 int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg, 1331 1496 struct vfsmount *root) 1332 1497 { 1333 - struct vfsmount *mnt; 1498 + struct mount *mnt; 1334 1499 int res = f(root, arg); 1335 1500 if (res) 1336 1501 return res; 1337 - list_for_each_entry(mnt, &root->mnt_list, mnt_list) { 1338 - res = f(mnt, arg); 1502 + list_for_each_entry(mnt, &real_mount(root)->mnt_list, mnt_list) { 1503 + res = f(&mnt->mnt, arg); 1339 1504 if (res) 1340 1505 return res; 1341 1506 } 1342 1507 return 0; 1343 1508 } 1344 1509 1345 - static void cleanup_group_ids(struct vfsmount *mnt, struct vfsmount *end) 1510 + static void cleanup_group_ids(struct mount *mnt, struct mount *end) 1346 1511 { 1347 - struct vfsmount *p; 1512 + struct mount *p; 1348 1513 1349 1514 for (p = mnt; p != end; p = next_mnt(p, mnt)) { 1350 1515 if (p->mnt_group_id && !IS_MNT_SHARED(p)) ··· 1352 1517 } 1353 1518 } 1354 1519 1355 - static int invent_group_ids(struct vfsmount *mnt, bool recurse) 1520 + static int invent_group_ids(struct mount *mnt, bool recurse) 1356 1521 { 1357 - struct vfsmount *p; 1522 + struct mount *p; 1358 1523 1359 1524 for (p = mnt; p; p = recurse ? next_mnt(p, mnt) : NULL) { 1360 1525 if (!p->mnt_group_id && !IS_MNT_SHARED(p)) { ··· 1432 1597 * Must be called without spinlocks held, since this function can sleep 1433 1598 * in allocations. 1434 1599 */ 1435 - static int attach_recursive_mnt(struct vfsmount *source_mnt, 1600 + static int attach_recursive_mnt(struct mount *source_mnt, 1436 1601 struct path *path, struct path *parent_path) 1437 1602 { 1438 1603 LIST_HEAD(tree_list); 1439 - struct vfsmount *dest_mnt = path->mnt; 1604 + struct mount *dest_mnt = real_mount(path->mnt); 1440 1605 struct dentry *dest_dentry = path->dentry; 1441 - struct vfsmount *child, *p; 1606 + struct mount *child, *p; 1442 1607 int err; 1443 1608 1444 1609 if (IS_MNT_SHARED(dest_mnt)) { ··· 1459 1624 if (parent_path) { 1460 1625 detach_mnt(source_mnt, parent_path); 1461 1626 attach_mnt(source_mnt, path); 1462 - touch_mnt_namespace(parent_path->mnt->mnt_ns); 1627 + touch_mnt_namespace(source_mnt->mnt_ns); 1463 1628 } else { 1464 1629 mnt_set_mountpoint(dest_mnt, dest_dentry, source_mnt); 1465 1630 commit_tree(source_mnt); ··· 1507 1672 mutex_unlock(&path->dentry->d_inode->i_mutex); 1508 1673 } 1509 1674 1510 - static int graft_tree(struct vfsmount *mnt, struct path *path) 1675 + static int graft_tree(struct mount *mnt, struct path *path) 1511 1676 { 1512 - if (mnt->mnt_sb->s_flags & MS_NOUSER) 1677 + if (mnt->mnt.mnt_sb->s_flags & MS_NOUSER) 1513 1678 return -EINVAL; 1514 1679 1515 1680 if (S_ISDIR(path->dentry->d_inode->i_mode) != 1516 - S_ISDIR(mnt->mnt_root->d_inode->i_mode)) 1681 + S_ISDIR(mnt->mnt.mnt_root->d_inode->i_mode)) 1517 1682 return -ENOTDIR; 1518 1683 1519 1684 if (d_unlinked(path->dentry)) ··· 1544 1709 */ 1545 1710 static int do_change_type(struct path *path, int flag) 1546 1711 { 1547 - struct vfsmount *m, *mnt = path->mnt; 1712 + struct mount *m; 1713 + struct mount *mnt = real_mount(path->mnt); 1548 1714 int recurse = flag & MS_REC; 1549 1715 int type; 1550 1716 int err = 0; ··· 1585 1749 { 1586 1750 LIST_HEAD(umount_list); 1587 1751 struct path old_path; 1588 - struct vfsmount *mnt = NULL; 1752 + struct mount *mnt = NULL, *old; 1589 1753 int err = mount_is_safe(path); 1590 1754 if (err) 1591 1755 return err; ··· 1599 1763 if (err) 1600 1764 goto out; 1601 1765 1766 + old = real_mount(old_path.mnt); 1767 + 1602 1768 err = -EINVAL; 1603 - if (IS_MNT_UNBINDABLE(old_path.mnt)) 1769 + if (IS_MNT_UNBINDABLE(old)) 1604 1770 goto out2; 1605 1771 1606 - if (!check_mnt(path->mnt) || !check_mnt(old_path.mnt)) 1772 + if (!check_mnt(real_mount(path->mnt)) || !check_mnt(old)) 1607 1773 goto out2; 1608 1774 1609 1775 err = -ENOMEM; 1610 1776 if (recurse) 1611 - mnt = copy_tree(old_path.mnt, old_path.dentry, 0); 1777 + mnt = copy_tree(old, old_path.dentry, 0); 1612 1778 else 1613 - mnt = clone_mnt(old_path.mnt, old_path.dentry, 0); 1779 + mnt = clone_mnt(old, old_path.dentry, 0); 1614 1780 1615 1781 if (!mnt) 1616 1782 goto out2; ··· 1642 1804 return 0; 1643 1805 1644 1806 if (readonly_request) 1645 - error = mnt_make_readonly(mnt); 1807 + error = mnt_make_readonly(real_mount(mnt)); 1646 1808 else 1647 - __mnt_unmake_readonly(mnt); 1809 + __mnt_unmake_readonly(real_mount(mnt)); 1648 1810 return error; 1649 1811 } 1650 1812 ··· 1658 1820 { 1659 1821 int err; 1660 1822 struct super_block *sb = path->mnt->mnt_sb; 1823 + struct mount *mnt = real_mount(path->mnt); 1661 1824 1662 1825 if (!capable(CAP_SYS_ADMIN)) 1663 1826 return -EPERM; 1664 1827 1665 - if (!check_mnt(path->mnt)) 1828 + if (!check_mnt(mnt)) 1666 1829 return -EINVAL; 1667 1830 1668 1831 if (path->dentry != path->mnt->mnt_root) ··· 1680 1841 err = do_remount_sb(sb, flags, data, 0); 1681 1842 if (!err) { 1682 1843 br_write_lock(vfsmount_lock); 1683 - mnt_flags |= path->mnt->mnt_flags & MNT_PROPAGATION_MASK; 1684 - path->mnt->mnt_flags = mnt_flags; 1844 + mnt_flags |= mnt->mnt.mnt_flags & MNT_PROPAGATION_MASK; 1845 + mnt->mnt.mnt_flags = mnt_flags; 1685 1846 br_write_unlock(vfsmount_lock); 1686 1847 } 1687 1848 up_write(&sb->s_umount); 1688 1849 if (!err) { 1689 1850 br_write_lock(vfsmount_lock); 1690 - touch_mnt_namespace(path->mnt->mnt_ns); 1851 + touch_mnt_namespace(mnt->mnt_ns); 1691 1852 br_write_unlock(vfsmount_lock); 1692 1853 } 1693 1854 return err; 1694 1855 } 1695 1856 1696 - static inline int tree_contains_unbindable(struct vfsmount *mnt) 1857 + static inline int tree_contains_unbindable(struct mount *mnt) 1697 1858 { 1698 - struct vfsmount *p; 1859 + struct mount *p; 1699 1860 for (p = mnt; p; p = next_mnt(p, mnt)) { 1700 1861 if (IS_MNT_UNBINDABLE(p)) 1701 1862 return 1; ··· 1706 1867 static int do_move_mount(struct path *path, char *old_name) 1707 1868 { 1708 1869 struct path old_path, parent_path; 1709 - struct vfsmount *p; 1870 + struct mount *p; 1871 + struct mount *old; 1710 1872 int err = 0; 1711 1873 if (!capable(CAP_SYS_ADMIN)) 1712 1874 return -EPERM; ··· 1721 1881 if (err < 0) 1722 1882 goto out; 1723 1883 1884 + old = real_mount(old_path.mnt); 1885 + p = real_mount(path->mnt); 1886 + 1724 1887 err = -EINVAL; 1725 - if (!check_mnt(path->mnt) || !check_mnt(old_path.mnt)) 1888 + if (!check_mnt(p) || !check_mnt(old)) 1726 1889 goto out1; 1727 1890 1728 1891 if (d_unlinked(path->dentry)) ··· 1735 1892 if (old_path.dentry != old_path.mnt->mnt_root) 1736 1893 goto out1; 1737 1894 1738 - if (old_path.mnt == old_path.mnt->mnt_parent) 1895 + if (!mnt_has_parent(old)) 1739 1896 goto out1; 1740 1897 1741 1898 if (S_ISDIR(path->dentry->d_inode->i_mode) != ··· 1744 1901 /* 1745 1902 * Don't move a mount residing in a shared parent. 1746 1903 */ 1747 - if (old_path.mnt->mnt_parent && 1748 - IS_MNT_SHARED(old_path.mnt->mnt_parent)) 1904 + if (IS_MNT_SHARED(old->mnt_parent)) 1749 1905 goto out1; 1750 1906 /* 1751 1907 * Don't move a mount tree containing unbindable mounts to a destination 1752 1908 * mount which is shared. 1753 1909 */ 1754 - if (IS_MNT_SHARED(path->mnt) && 1755 - tree_contains_unbindable(old_path.mnt)) 1910 + if (IS_MNT_SHARED(p) && tree_contains_unbindable(old)) 1756 1911 goto out1; 1757 1912 err = -ELOOP; 1758 - for (p = path->mnt; p->mnt_parent != p; p = p->mnt_parent) 1759 - if (p == old_path.mnt) 1913 + for (; mnt_has_parent(p); p = p->mnt_parent) 1914 + if (p == old) 1760 1915 goto out1; 1761 1916 1762 - err = attach_recursive_mnt(old_path.mnt, path, &parent_path); 1917 + err = attach_recursive_mnt(old, path, &parent_path); 1763 1918 if (err) 1764 1919 goto out1; 1765 1920 1766 1921 /* if the mount is moved, it should no longer be expire 1767 1922 * automatically */ 1768 - list_del_init(&old_path.mnt->mnt_expire); 1923 + list_del_init(&old->mnt_expire); 1769 1924 out1: 1770 1925 unlock_mount(path); 1771 1926 out: ··· 1796 1955 return ERR_PTR(err); 1797 1956 } 1798 1957 1799 - struct vfsmount * 1958 + static struct vfsmount * 1800 1959 do_kern_mount(const char *fstype, int flags, const char *name, void *data) 1801 1960 { 1802 1961 struct file_system_type *type = get_fs_type(fstype); ··· 1810 1969 put_filesystem(type); 1811 1970 return mnt; 1812 1971 } 1813 - EXPORT_SYMBOL_GPL(do_kern_mount); 1814 1972 1815 1973 /* 1816 1974 * add a mount into a namespace's mount tree 1817 1975 */ 1818 - static int do_add_mount(struct vfsmount *newmnt, struct path *path, int mnt_flags) 1976 + static int do_add_mount(struct mount *newmnt, struct path *path, int mnt_flags) 1819 1977 { 1820 1978 int err; 1821 1979 ··· 1825 1985 return err; 1826 1986 1827 1987 err = -EINVAL; 1828 - if (!(mnt_flags & MNT_SHRINKABLE) && !check_mnt(path->mnt)) 1988 + if (!(mnt_flags & MNT_SHRINKABLE) && !check_mnt(real_mount(path->mnt))) 1829 1989 goto unlock; 1830 1990 1831 1991 /* Refuse the same filesystem on the same mount point */ 1832 1992 err = -EBUSY; 1833 - if (path->mnt->mnt_sb == newmnt->mnt_sb && 1993 + if (path->mnt->mnt_sb == newmnt->mnt.mnt_sb && 1834 1994 path->mnt->mnt_root == path->dentry) 1835 1995 goto unlock; 1836 1996 1837 1997 err = -EINVAL; 1838 - if (S_ISLNK(newmnt->mnt_root->d_inode->i_mode)) 1998 + if (S_ISLNK(newmnt->mnt.mnt_root->d_inode->i_mode)) 1839 1999 goto unlock; 1840 2000 1841 - newmnt->mnt_flags = mnt_flags; 2001 + newmnt->mnt.mnt_flags = mnt_flags; 1842 2002 err = graft_tree(newmnt, path); 1843 2003 1844 2004 unlock: ··· 1867 2027 if (IS_ERR(mnt)) 1868 2028 return PTR_ERR(mnt); 1869 2029 1870 - err = do_add_mount(mnt, path, mnt_flags); 2030 + err = do_add_mount(real_mount(mnt), path, mnt_flags); 1871 2031 if (err) 1872 2032 mntput(mnt); 1873 2033 return err; ··· 1875 2035 1876 2036 int finish_automount(struct vfsmount *m, struct path *path) 1877 2037 { 2038 + struct mount *mnt = real_mount(m); 1878 2039 int err; 1879 2040 /* The new mount record should have at least 2 refs to prevent it being 1880 2041 * expired before we get a chance to add it 1881 2042 */ 1882 - BUG_ON(mnt_get_count(m) < 2); 2043 + BUG_ON(mnt_get_count(mnt) < 2); 1883 2044 1884 2045 if (m->mnt_sb == path->mnt->mnt_sb && 1885 2046 m->mnt_root == path->dentry) { ··· 1888 2047 goto fail; 1889 2048 } 1890 2049 1891 - err = do_add_mount(m, path, path->mnt->mnt_flags | MNT_SHRINKABLE); 2050 + err = do_add_mount(mnt, path, path->mnt->mnt_flags | MNT_SHRINKABLE); 1892 2051 if (!err) 1893 2052 return 0; 1894 2053 fail: 1895 2054 /* remove m from any expiration list it may be on */ 1896 - if (!list_empty(&m->mnt_expire)) { 2055 + if (!list_empty(&mnt->mnt_expire)) { 1897 2056 down_write(&namespace_sem); 1898 2057 br_write_lock(vfsmount_lock); 1899 - list_del_init(&m->mnt_expire); 2058 + list_del_init(&mnt->mnt_expire); 1900 2059 br_write_unlock(vfsmount_lock); 1901 2060 up_write(&namespace_sem); 1902 2061 } ··· 1915 2074 down_write(&namespace_sem); 1916 2075 br_write_lock(vfsmount_lock); 1917 2076 1918 - list_add_tail(&mnt->mnt_expire, expiry_list); 2077 + list_add_tail(&real_mount(mnt)->mnt_expire, expiry_list); 1919 2078 1920 2079 br_write_unlock(vfsmount_lock); 1921 2080 up_write(&namespace_sem); ··· 1929 2088 */ 1930 2089 void mark_mounts_for_expiry(struct list_head *mounts) 1931 2090 { 1932 - struct vfsmount *mnt, *next; 2091 + struct mount *mnt, *next; 1933 2092 LIST_HEAD(graveyard); 1934 2093 LIST_HEAD(umounts); 1935 2094 ··· 1952 2111 list_move(&mnt->mnt_expire, &graveyard); 1953 2112 } 1954 2113 while (!list_empty(&graveyard)) { 1955 - mnt = list_first_entry(&graveyard, struct vfsmount, mnt_expire); 2114 + mnt = list_first_entry(&graveyard, struct mount, mnt_expire); 1956 2115 touch_mnt_namespace(mnt->mnt_ns); 1957 2116 umount_tree(mnt, 1, &umounts); 1958 2117 } ··· 1970 2129 * search the list of submounts for a given mountpoint, and move any 1971 2130 * shrinkable submounts to the 'graveyard' list. 1972 2131 */ 1973 - static int select_submounts(struct vfsmount *parent, struct list_head *graveyard) 2132 + static int select_submounts(struct mount *parent, struct list_head *graveyard) 1974 2133 { 1975 - struct vfsmount *this_parent = parent; 2134 + struct mount *this_parent = parent; 1976 2135 struct list_head *next; 1977 2136 int found = 0; 1978 2137 ··· 1981 2140 resume: 1982 2141 while (next != &this_parent->mnt_mounts) { 1983 2142 struct list_head *tmp = next; 1984 - struct vfsmount *mnt = list_entry(tmp, struct vfsmount, mnt_child); 2143 + struct mount *mnt = list_entry(tmp, struct mount, mnt_child); 1985 2144 1986 2145 next = tmp->next; 1987 - if (!(mnt->mnt_flags & MNT_SHRINKABLE)) 2146 + if (!(mnt->mnt.mnt_flags & MNT_SHRINKABLE)) 1988 2147 continue; 1989 2148 /* 1990 2149 * Descend a level if the d_mounts list is non-empty. ··· 2016 2175 * 2017 2176 * vfsmount_lock must be held for write 2018 2177 */ 2019 - static void shrink_submounts(struct vfsmount *mnt, struct list_head *umounts) 2178 + static void shrink_submounts(struct mount *mnt, struct list_head *umounts) 2020 2179 { 2021 2180 LIST_HEAD(graveyard); 2022 - struct vfsmount *m; 2181 + struct mount *m; 2023 2182 2024 2183 /* extract submounts of 'mountpoint' from the expiration list */ 2025 2184 while (select_submounts(mnt, &graveyard)) { 2026 2185 while (!list_empty(&graveyard)) { 2027 - m = list_first_entry(&graveyard, struct vfsmount, 2186 + m = list_first_entry(&graveyard, struct mount, 2028 2187 mnt_expire); 2029 2188 touch_mnt_namespace(m->mnt_ns); 2030 2189 umount_tree(m, 1, umounts); ··· 2211 2370 2212 2371 void mnt_make_longterm(struct vfsmount *mnt) 2213 2372 { 2214 - __mnt_make_longterm(mnt); 2373 + __mnt_make_longterm(real_mount(mnt)); 2215 2374 } 2216 2375 2217 - void mnt_make_shortterm(struct vfsmount *mnt) 2376 + void mnt_make_shortterm(struct vfsmount *m) 2218 2377 { 2219 2378 #ifdef CONFIG_SMP 2379 + struct mount *mnt = real_mount(m); 2220 2380 if (atomic_add_unless(&mnt->mnt_longterm, -1, 1)) 2221 2381 return; 2222 2382 br_write_lock(vfsmount_lock); ··· 2235 2393 { 2236 2394 struct mnt_namespace *new_ns; 2237 2395 struct vfsmount *rootmnt = NULL, *pwdmnt = NULL; 2238 - struct vfsmount *p, *q; 2396 + struct mount *p, *q; 2397 + struct mount *old = mnt_ns->root; 2398 + struct mount *new; 2239 2399 2240 2400 new_ns = alloc_mnt_ns(); 2241 2401 if (IS_ERR(new_ns)) ··· 2245 2401 2246 2402 down_write(&namespace_sem); 2247 2403 /* First pass: copy the tree topology */ 2248 - new_ns->root = copy_tree(mnt_ns->root, mnt_ns->root->mnt_root, 2249 - CL_COPY_ALL | CL_EXPIRE); 2250 - if (!new_ns->root) { 2404 + new = copy_tree(old, old->mnt.mnt_root, CL_COPY_ALL | CL_EXPIRE); 2405 + if (!new) { 2251 2406 up_write(&namespace_sem); 2252 2407 kfree(new_ns); 2253 2408 return ERR_PTR(-ENOMEM); 2254 2409 } 2410 + new_ns->root = new; 2255 2411 br_write_lock(vfsmount_lock); 2256 - list_add_tail(&new_ns->list, &new_ns->root->mnt_list); 2412 + list_add_tail(&new_ns->list, &new->mnt_list); 2257 2413 br_write_unlock(vfsmount_lock); 2258 2414 2259 2415 /* ··· 2261 2417 * as belonging to new namespace. We have already acquired a private 2262 2418 * fs_struct, so tsk->fs->lock is not needed. 2263 2419 */ 2264 - p = mnt_ns->root; 2265 - q = new_ns->root; 2420 + p = old; 2421 + q = new; 2266 2422 while (p) { 2267 2423 q->mnt_ns = new_ns; 2268 2424 __mnt_make_longterm(q); 2269 2425 if (fs) { 2270 - if (p == fs->root.mnt) { 2271 - fs->root.mnt = mntget(q); 2426 + if (&p->mnt == fs->root.mnt) { 2427 + fs->root.mnt = mntget(&q->mnt); 2272 2428 __mnt_make_longterm(q); 2273 - mnt_make_shortterm(p); 2274 - rootmnt = p; 2429 + mnt_make_shortterm(&p->mnt); 2430 + rootmnt = &p->mnt; 2275 2431 } 2276 - if (p == fs->pwd.mnt) { 2277 - fs->pwd.mnt = mntget(q); 2432 + if (&p->mnt == fs->pwd.mnt) { 2433 + fs->pwd.mnt = mntget(&q->mnt); 2278 2434 __mnt_make_longterm(q); 2279 - mnt_make_shortterm(p); 2280 - pwdmnt = p; 2435 + mnt_make_shortterm(&p->mnt); 2436 + pwdmnt = &p->mnt; 2281 2437 } 2282 2438 } 2283 - p = next_mnt(p, mnt_ns->root); 2284 - q = next_mnt(q, new_ns->root); 2439 + p = next_mnt(p, old); 2440 + q = next_mnt(q, new); 2285 2441 } 2286 2442 up_write(&namespace_sem); 2287 2443 ··· 2314 2470 * create_mnt_ns - creates a private namespace and adds a root filesystem 2315 2471 * @mnt: pointer to the new root filesystem mountpoint 2316 2472 */ 2317 - struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt) 2473 + static struct mnt_namespace *create_mnt_ns(struct vfsmount *m) 2318 2474 { 2319 - struct mnt_namespace *new_ns; 2320 - 2321 - new_ns = alloc_mnt_ns(); 2475 + struct mnt_namespace *new_ns = alloc_mnt_ns(); 2322 2476 if (!IS_ERR(new_ns)) { 2477 + struct mount *mnt = real_mount(m); 2323 2478 mnt->mnt_ns = new_ns; 2324 2479 __mnt_make_longterm(mnt); 2325 2480 new_ns->root = mnt; 2326 - list_add(&new_ns->list, &new_ns->root->mnt_list); 2481 + list_add(&new_ns->list, &mnt->mnt_list); 2327 2482 } else { 2328 - mntput(mnt); 2483 + mntput(m); 2329 2484 } 2330 2485 return new_ns; 2331 2486 } 2332 - EXPORT_SYMBOL(create_mnt_ns); 2333 2487 2334 2488 struct dentry *mount_subtree(struct vfsmount *mnt, const char *name) 2335 2489 { ··· 2401 2559 } 2402 2560 2403 2561 /* 2562 + * Return true if path is reachable from root 2563 + * 2564 + * namespace_sem or vfsmount_lock is held 2565 + */ 2566 + bool is_path_reachable(struct mount *mnt, struct dentry *dentry, 2567 + const struct path *root) 2568 + { 2569 + while (&mnt->mnt != root->mnt && mnt_has_parent(mnt)) { 2570 + dentry = mnt->mnt_mountpoint; 2571 + mnt = mnt->mnt_parent; 2572 + } 2573 + return &mnt->mnt == root->mnt && is_subdir(dentry, root->dentry); 2574 + } 2575 + 2576 + int path_is_under(struct path *path1, struct path *path2) 2577 + { 2578 + int res; 2579 + br_read_lock(vfsmount_lock); 2580 + res = is_path_reachable(real_mount(path1->mnt), path1->dentry, path2); 2581 + br_read_unlock(vfsmount_lock); 2582 + return res; 2583 + } 2584 + EXPORT_SYMBOL(path_is_under); 2585 + 2586 + /* 2404 2587 * pivot_root Semantics: 2405 2588 * Moves the root file system of the current process to the directory put_old, 2406 2589 * makes new_root as the new root file system of the current process, and sets ··· 2453 2586 SYSCALL_DEFINE2(pivot_root, const char __user *, new_root, 2454 2587 const char __user *, put_old) 2455 2588 { 2456 - struct vfsmount *tmp; 2457 2589 struct path new, old, parent_path, root_parent, root; 2590 + struct mount *new_mnt, *root_mnt; 2458 2591 int error; 2459 2592 2460 2593 if (!capable(CAP_SYS_ADMIN)) ··· 2478 2611 goto out3; 2479 2612 2480 2613 error = -EINVAL; 2481 - if (IS_MNT_SHARED(old.mnt) || 2482 - IS_MNT_SHARED(new.mnt->mnt_parent) || 2483 - IS_MNT_SHARED(root.mnt->mnt_parent)) 2614 + new_mnt = real_mount(new.mnt); 2615 + root_mnt = real_mount(root.mnt); 2616 + if (IS_MNT_SHARED(real_mount(old.mnt)) || 2617 + IS_MNT_SHARED(new_mnt->mnt_parent) || 2618 + IS_MNT_SHARED(root_mnt->mnt_parent)) 2484 2619 goto out4; 2485 - if (!check_mnt(root.mnt) || !check_mnt(new.mnt)) 2620 + if (!check_mnt(root_mnt) || !check_mnt(new_mnt)) 2486 2621 goto out4; 2487 2622 error = -ENOENT; 2488 2623 if (d_unlinked(new.dentry)) ··· 2498 2629 error = -EINVAL; 2499 2630 if (root.mnt->mnt_root != root.dentry) 2500 2631 goto out4; /* not a mountpoint */ 2501 - if (root.mnt->mnt_parent == root.mnt) 2632 + if (!mnt_has_parent(root_mnt)) 2502 2633 goto out4; /* not attached */ 2503 2634 if (new.mnt->mnt_root != new.dentry) 2504 2635 goto out4; /* not a mountpoint */ 2505 - if (new.mnt->mnt_parent == new.mnt) 2636 + if (!mnt_has_parent(new_mnt)) 2506 2637 goto out4; /* not attached */ 2507 2638 /* make sure we can reach put_old from new_root */ 2508 - tmp = old.mnt; 2509 - if (tmp != new.mnt) { 2510 - for (;;) { 2511 - if (tmp->mnt_parent == tmp) 2512 - goto out4; /* already mounted on put_old */ 2513 - if (tmp->mnt_parent == new.mnt) 2514 - break; 2515 - tmp = tmp->mnt_parent; 2516 - } 2517 - if (!is_subdir(tmp->mnt_mountpoint, new.dentry)) 2518 - goto out4; 2519 - } else if (!is_subdir(old.dentry, new.dentry)) 2639 + if (!is_path_reachable(real_mount(old.mnt), old.dentry, &new)) 2520 2640 goto out4; 2521 2641 br_write_lock(vfsmount_lock); 2522 - detach_mnt(new.mnt, &parent_path); 2523 - detach_mnt(root.mnt, &root_parent); 2642 + detach_mnt(new_mnt, &parent_path); 2643 + detach_mnt(root_mnt, &root_parent); 2524 2644 /* mount old root on put_old */ 2525 - attach_mnt(root.mnt, &old); 2645 + attach_mnt(root_mnt, &old); 2526 2646 /* mount new_root on / */ 2527 - attach_mnt(new.mnt, &root_parent); 2647 + attach_mnt(new_mnt, &root_parent); 2528 2648 touch_mnt_namespace(current->nsproxy->mnt_ns); 2529 2649 br_write_unlock(vfsmount_lock); 2530 2650 chroot_fs_refs(&root, &new); ··· 2551 2693 init_task.nsproxy->mnt_ns = ns; 2552 2694 get_mnt_ns(ns); 2553 2695 2554 - root.mnt = ns->root; 2555 - root.dentry = ns->root->mnt_root; 2696 + root.mnt = mnt; 2697 + root.dentry = mnt->mnt_root; 2556 2698 2557 2699 set_fs_pwd(current->fs, &root); 2558 2700 set_fs_root(current->fs, &root); ··· 2565 2707 2566 2708 init_rwsem(&namespace_sem); 2567 2709 2568 - mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct vfsmount), 2710 + mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct mount), 2569 2711 0, SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL); 2570 2712 2571 2713 mount_hashtable = (struct list_head *)__get_free_page(GFP_ATOMIC); ··· 2605 2747 release_mounts(&umount_list); 2606 2748 kfree(ns); 2607 2749 } 2608 - EXPORT_SYMBOL(put_mnt_ns); 2609 2750 2610 2751 struct vfsmount *kern_mount_data(struct file_system_type *type, void *data) 2611 2752 { ··· 2633 2776 2634 2777 bool our_mnt(struct vfsmount *mnt) 2635 2778 { 2636 - return check_mnt(mnt); 2779 + return check_mnt(real_mount(mnt)); 2637 2780 }
+9 -9
fs/ncpfs/dir.c
··· 30 30 31 31 static int ncp_readdir(struct file *, void *, filldir_t); 32 32 33 - static int ncp_create(struct inode *, struct dentry *, int, struct nameidata *); 33 + static int ncp_create(struct inode *, struct dentry *, umode_t, struct nameidata *); 34 34 static struct dentry *ncp_lookup(struct inode *, struct dentry *, struct nameidata *); 35 35 static int ncp_unlink(struct inode *, struct dentry *); 36 - static int ncp_mkdir(struct inode *, struct dentry *, int); 36 + static int ncp_mkdir(struct inode *, struct dentry *, umode_t); 37 37 static int ncp_rmdir(struct inode *, struct dentry *); 38 38 static int ncp_rename(struct inode *, struct dentry *, 39 39 struct inode *, struct dentry *); 40 40 static int ncp_mknod(struct inode * dir, struct dentry *dentry, 41 - int mode, dev_t rdev); 41 + umode_t mode, dev_t rdev); 42 42 #if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS) 43 43 extern int ncp_symlink(struct inode *, struct dentry *, const char *); 44 44 #else ··· 919 919 goto out; 920 920 } 921 921 922 - int ncp_create_new(struct inode *dir, struct dentry *dentry, int mode, 922 + int ncp_create_new(struct inode *dir, struct dentry *dentry, umode_t mode, 923 923 dev_t rdev, __le32 attributes) 924 924 { 925 925 struct ncp_server *server = NCP_SERVER(dir); ··· 928 928 int opmode; 929 929 __u8 __name[NCP_MAXPATHLEN + 1]; 930 930 931 - PPRINTK("ncp_create_new: creating %s/%s, mode=%x\n", 931 + PPRINTK("ncp_create_new: creating %s/%s, mode=%hx\n", 932 932 dentry->d_parent->d_name.name, dentry->d_name.name, mode); 933 933 934 934 ncp_age_dentry(server, dentry); ··· 979 979 return error; 980 980 } 981 981 982 - static int ncp_create(struct inode *dir, struct dentry *dentry, int mode, 982 + static int ncp_create(struct inode *dir, struct dentry *dentry, umode_t mode, 983 983 struct nameidata *nd) 984 984 { 985 985 return ncp_create_new(dir, dentry, mode, 0, 0); 986 986 } 987 987 988 - static int ncp_mkdir(struct inode *dir, struct dentry *dentry, int mode) 988 + static int ncp_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 989 989 { 990 990 struct ncp_entry_info finfo; 991 991 struct ncp_server *server = NCP_SERVER(dir); ··· 1201 1201 } 1202 1202 1203 1203 static int ncp_mknod(struct inode * dir, struct dentry *dentry, 1204 - int mode, dev_t rdev) 1204 + umode_t mode, dev_t rdev) 1205 1205 { 1206 1206 if (!new_valid_dev(rdev)) 1207 1207 return -EINVAL; 1208 1208 if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber)) { 1209 - DPRINTK(KERN_DEBUG "ncp_mknod: mode = 0%o\n", mode); 1209 + DPRINTK(KERN_DEBUG "ncp_mknod: mode = 0%ho\n", mode); 1210 1210 return ncp_create_new(dir, dentry, mode, rdev, 0); 1211 1211 } 1212 1212 return -EPERM; /* Strange, but true */
+3 -4
fs/ncpfs/inode.c
··· 44 44 static void ncp_evict_inode(struct inode *); 45 45 static void ncp_put_super(struct super_block *); 46 46 static int ncp_statfs(struct dentry *, struct kstatfs *); 47 - static int ncp_show_options(struct seq_file *, struct vfsmount *); 47 + static int ncp_show_options(struct seq_file *, struct dentry *); 48 48 49 49 static struct kmem_cache * ncp_inode_cachep; 50 50 ··· 60 60 static void ncp_i_callback(struct rcu_head *head) 61 61 { 62 62 struct inode *inode = container_of(head, struct inode, i_rcu); 63 - INIT_LIST_HEAD(&inode->i_dentry); 64 63 kmem_cache_free(ncp_inode_cachep, NCP_FINFO(inode)); 65 64 } 66 65 ··· 322 323 flush_work_sync(&server->timeout_tq); 323 324 } 324 325 325 - static int ncp_show_options(struct seq_file *seq, struct vfsmount *mnt) 326 + static int ncp_show_options(struct seq_file *seq, struct dentry *root) 326 327 { 327 - struct ncp_server *server = NCP_SBP(mnt->mnt_sb); 328 + struct ncp_server *server = NCP_SBP(root->d_sb); 328 329 unsigned int tmp; 329 330 330 331 if (server->m.uid != 0)
+1 -1
fs/ncpfs/ioctl.c
··· 901 901 ret = __ncp_ioctl(inode, cmd, arg); 902 902 outDropWrite: 903 903 if (need_drop_write) 904 - mnt_drop_write(filp->f_path.mnt); 904 + mnt_drop_write_file(filp); 905 905 out: 906 906 return ret; 907 907 }
+1 -1
fs/ncpfs/ncplib_kernel.h
··· 114 114 int ncp_dirhandle_free(struct ncp_server *, __u8 dirhandle); 115 115 116 116 int ncp_create_new(struct inode *dir, struct dentry *dentry, 117 - int mode, dev_t rdev, __le32 attributes); 117 + umode_t mode, dev_t rdev, __le32 attributes); 118 118 119 119 static inline int ncp_is_nfs_extras(struct ncp_server* server, unsigned int volnum) { 120 120 #ifdef CONFIG_NCPFS_NFS_NS
+1 -1
fs/ncpfs/symlink.c
··· 108 108 char *rawlink; 109 109 int length, err, i, outlen; 110 110 int kludge; 111 - int mode; 111 + umode_t mode; 112 112 __le32 attr; 113 113 unsigned int hdr; 114 114
+11 -22
fs/nfs/dir.c
··· 47 47 static int nfs_closedir(struct inode *, struct file *); 48 48 static int nfs_readdir(struct file *, void *, filldir_t); 49 49 static struct dentry *nfs_lookup(struct inode *, struct dentry *, struct nameidata *); 50 - static int nfs_create(struct inode *, struct dentry *, int, struct nameidata *); 51 - static int nfs_mkdir(struct inode *, struct dentry *, int); 50 + static int nfs_create(struct inode *, struct dentry *, umode_t, struct nameidata *); 51 + static int nfs_mkdir(struct inode *, struct dentry *, umode_t); 52 52 static int nfs_rmdir(struct inode *, struct dentry *); 53 53 static int nfs_unlink(struct inode *, struct dentry *); 54 54 static int nfs_symlink(struct inode *, struct dentry *, const char *); 55 55 static int nfs_link(struct dentry *, struct inode *, struct dentry *); 56 - static int nfs_mknod(struct inode *, struct dentry *, int, dev_t); 56 + static int nfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); 57 57 static int nfs_rename(struct inode *, struct dentry *, 58 58 struct inode *, struct dentry *); 59 59 static int nfs_fsync_dir(struct file *, loff_t, loff_t, int); ··· 112 112 #ifdef CONFIG_NFS_V4 113 113 114 114 static struct dentry *nfs_atomic_lookup(struct inode *, struct dentry *, struct nameidata *); 115 - static int nfs_open_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd); 115 + static int nfs_open_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *nd); 116 116 const struct inode_operations nfs4_dir_inode_operations = { 117 117 .create = nfs_open_create, 118 118 .lookup = nfs_atomic_lookup, ··· 1368 1368 1369 1369 static struct nfs_open_context *create_nfs_open_context(struct dentry *dentry, int open_flags) 1370 1370 { 1371 - struct nfs_open_context *ctx; 1372 - struct rpc_cred *cred; 1373 - fmode_t fmode = flags_to_mode(open_flags); 1374 - 1375 - cred = rpc_lookup_cred(); 1376 - if (IS_ERR(cred)) 1377 - return ERR_CAST(cred); 1378 - ctx = alloc_nfs_open_context(dentry, cred, fmode); 1379 - put_rpccred(cred); 1380 - if (ctx == NULL) 1381 - return ERR_PTR(-ENOMEM); 1382 - return ctx; 1371 + return alloc_nfs_open_context(dentry, flags_to_mode(open_flags)); 1383 1372 } 1384 1373 1385 1374 static int do_open(struct inode *inode, struct file *filp) ··· 1573 1584 return nfs_lookup_revalidate(dentry, nd); 1574 1585 } 1575 1586 1576 - static int nfs_open_create(struct inode *dir, struct dentry *dentry, int mode, 1577 - struct nameidata *nd) 1587 + static int nfs_open_create(struct inode *dir, struct dentry *dentry, 1588 + umode_t mode, struct nameidata *nd) 1578 1589 { 1579 1590 struct nfs_open_context *ctx = NULL; 1580 1591 struct iattr attr; ··· 1664 1675 * that the operation succeeded on the server, but an error in the 1665 1676 * reply path made it appear to have failed. 1666 1677 */ 1667 - static int nfs_create(struct inode *dir, struct dentry *dentry, int mode, 1668 - struct nameidata *nd) 1678 + static int nfs_create(struct inode *dir, struct dentry *dentry, 1679 + umode_t mode, struct nameidata *nd) 1669 1680 { 1670 1681 struct iattr attr; 1671 1682 int error; ··· 1693 1704 * See comments for nfs_proc_create regarding failed operations. 1694 1705 */ 1695 1706 static int 1696 - nfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) 1707 + nfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) 1697 1708 { 1698 1709 struct iattr attr; 1699 1710 int status; ··· 1719 1730 /* 1720 1731 * See comments for nfs_proc_create regarding failed operations. 1721 1732 */ 1722 - static int nfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 1733 + static int nfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 1723 1734 { 1724 1735 struct iattr attr; 1725 1736 int error;
+20 -21
fs/nfs/inode.c
··· 629 629 nfs_revalidate_inode(server, inode); 630 630 } 631 631 632 - struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rpc_cred *cred, fmode_t f_mode) 632 + struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f_mode) 633 633 { 634 634 struct nfs_open_context *ctx; 635 + struct rpc_cred *cred = rpc_lookup_cred(); 636 + if (IS_ERR(cred)) 637 + return ERR_CAST(cred); 635 638 636 639 ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); 637 - if (ctx != NULL) { 638 - nfs_sb_active(dentry->d_sb); 639 - ctx->dentry = dget(dentry); 640 - ctx->cred = get_rpccred(cred); 641 - ctx->state = NULL; 642 - ctx->mode = f_mode; 643 - ctx->flags = 0; 644 - ctx->error = 0; 645 - nfs_init_lock_context(&ctx->lock_context); 646 - ctx->lock_context.open_context = ctx; 647 - INIT_LIST_HEAD(&ctx->list); 640 + if (!ctx) { 641 + put_rpccred(cred); 642 + return ERR_PTR(-ENOMEM); 648 643 } 644 + nfs_sb_active(dentry->d_sb); 645 + ctx->dentry = dget(dentry); 646 + ctx->cred = cred; 647 + ctx->state = NULL; 648 + ctx->mode = f_mode; 649 + ctx->flags = 0; 650 + ctx->error = 0; 651 + nfs_init_lock_context(&ctx->lock_context); 652 + ctx->lock_context.open_context = ctx; 653 + INIT_LIST_HEAD(&ctx->list); 649 654 return ctx; 650 655 } 651 656 ··· 743 738 int nfs_open(struct inode *inode, struct file *filp) 744 739 { 745 740 struct nfs_open_context *ctx; 746 - struct rpc_cred *cred; 747 741 748 - cred = rpc_lookup_cred(); 749 - if (IS_ERR(cred)) 750 - return PTR_ERR(cred); 751 - ctx = alloc_nfs_open_context(filp->f_path.dentry, cred, filp->f_mode); 752 - put_rpccred(cred); 753 - if (ctx == NULL) 754 - return -ENOMEM; 742 + ctx = alloc_nfs_open_context(filp->f_path.dentry, filp->f_mode); 743 + if (IS_ERR(ctx)) 744 + return PTR_ERR(ctx); 755 745 nfs_file_set_open_context(filp, ctx); 756 746 put_nfs_open_context(ctx); 757 747 nfs_fscache_set_inode_cookie(inode, filp); ··· 1464 1464 static void nfs_i_callback(struct rcu_head *head) 1465 1465 { 1466 1466 struct inode *inode = container_of(head, struct inode, i_rcu); 1467 - INIT_LIST_HEAD(&inode->i_dentry); 1468 1467 kmem_cache_free(nfs_inode_cachep, NFS_I(inode)); 1469 1468 } 1470 1469
+24 -25
fs/nfs/super.c
··· 41 41 #include <linux/lockd/bind.h> 42 42 #include <linux/seq_file.h> 43 43 #include <linux/mount.h> 44 - #include <linux/mnt_namespace.h> 45 44 #include <linux/namei.h> 46 45 #include <linux/nfs_idmap.h> 47 46 #include <linux/vfs.h> ··· 262 263 263 264 static void nfs_umount_begin(struct super_block *); 264 265 static int nfs_statfs(struct dentry *, struct kstatfs *); 265 - static int nfs_show_options(struct seq_file *, struct vfsmount *); 266 - static int nfs_show_devname(struct seq_file *, struct vfsmount *); 267 - static int nfs_show_path(struct seq_file *, struct vfsmount *); 268 - static int nfs_show_stats(struct seq_file *, struct vfsmount *); 266 + static int nfs_show_options(struct seq_file *, struct dentry *); 267 + static int nfs_show_devname(struct seq_file *, struct dentry *); 268 + static int nfs_show_path(struct seq_file *, struct dentry *); 269 + static int nfs_show_stats(struct seq_file *, struct dentry *); 269 270 static struct dentry *nfs_fs_mount(struct file_system_type *, 270 271 int, const char *, void *); 271 272 static struct dentry *nfs_xdev_mount(struct file_system_type *fs_type, ··· 720 721 /* 721 722 * Describe the mount options on this VFS mountpoint 722 723 */ 723 - static int nfs_show_options(struct seq_file *m, struct vfsmount *mnt) 724 + static int nfs_show_options(struct seq_file *m, struct dentry *root) 724 725 { 725 - struct nfs_server *nfss = NFS_SB(mnt->mnt_sb); 726 + struct nfs_server *nfss = NFS_SB(root->d_sb); 726 727 727 728 nfs_show_mount_options(m, nfss, 0); 728 729 ··· 760 761 #endif 761 762 #endif 762 763 763 - static int nfs_show_devname(struct seq_file *m, struct vfsmount *mnt) 764 + static int nfs_show_devname(struct seq_file *m, struct dentry *root) 764 765 { 765 766 char *page = (char *) __get_free_page(GFP_KERNEL); 766 767 char *devname, *dummy; 767 768 int err = 0; 768 769 if (!page) 769 770 return -ENOMEM; 770 - devname = nfs_path(&dummy, mnt->mnt_root, page, PAGE_SIZE); 771 + devname = nfs_path(&dummy, root, page, PAGE_SIZE); 771 772 if (IS_ERR(devname)) 772 773 err = PTR_ERR(devname); 773 774 else ··· 776 777 return err; 777 778 } 778 779 779 - static int nfs_show_path(struct seq_file *m, struct vfsmount *mnt) 780 + static int nfs_show_path(struct seq_file *m, struct dentry *dentry) 780 781 { 781 782 seq_puts(m, "/"); 782 783 return 0; ··· 785 786 /* 786 787 * Present statistical information for this VFS mountpoint 787 788 */ 788 - static int nfs_show_stats(struct seq_file *m, struct vfsmount *mnt) 789 + static int nfs_show_stats(struct seq_file *m, struct dentry *root) 789 790 { 790 791 int i, cpu; 791 - struct nfs_server *nfss = NFS_SB(mnt->mnt_sb); 792 + struct nfs_server *nfss = NFS_SB(root->d_sb); 792 793 struct rpc_auth *auth = nfss->client->cl_auth; 793 794 struct nfs_iostats totals = { }; 794 795 ··· 798 799 * Display all mount option settings 799 800 */ 800 801 seq_printf(m, "\n\topts:\t"); 801 - seq_puts(m, mnt->mnt_sb->s_flags & MS_RDONLY ? "ro" : "rw"); 802 - seq_puts(m, mnt->mnt_sb->s_flags & MS_SYNCHRONOUS ? ",sync" : ""); 803 - seq_puts(m, mnt->mnt_sb->s_flags & MS_NOATIME ? ",noatime" : ""); 804 - seq_puts(m, mnt->mnt_sb->s_flags & MS_NODIRATIME ? ",nodiratime" : ""); 802 + seq_puts(m, root->d_sb->s_flags & MS_RDONLY ? "ro" : "rw"); 803 + seq_puts(m, root->d_sb->s_flags & MS_SYNCHRONOUS ? ",sync" : ""); 804 + seq_puts(m, root->d_sb->s_flags & MS_NOATIME ? ",noatime" : ""); 805 + seq_puts(m, root->d_sb->s_flags & MS_NODIRATIME ? ",nodiratime" : ""); 805 806 nfs_show_mount_options(m, nfss, 1); 806 807 807 808 seq_printf(m, "\n\tage:\t%lu", (jiffies - nfss->mount_time) / HZ); ··· 2787 2788 const char *export_path) 2788 2789 { 2789 2790 struct dentry *dentry; 2790 - int ret = nfs_referral_loop_protect(); 2791 + int err; 2791 2792 2792 - if (ret) { 2793 + if (IS_ERR(root_mnt)) 2794 + return ERR_CAST(root_mnt); 2795 + 2796 + err = nfs_referral_loop_protect(); 2797 + if (err) { 2793 2798 mntput(root_mnt); 2794 - return ERR_PTR(ret); 2799 + return ERR_PTR(err); 2795 2800 } 2796 2801 2797 2802 dentry = mount_subtree(root_mnt, export_path); ··· 2819 2816 data->nfs_server.hostname); 2820 2817 data->nfs_server.export_path = export_path; 2821 2818 2822 - res = ERR_CAST(root_mnt); 2823 - if (!IS_ERR(root_mnt)) 2824 - res = nfs_follow_remote_path(root_mnt, export_path); 2819 + res = nfs_follow_remote_path(root_mnt, export_path); 2825 2820 2826 2821 dfprintk(MOUNT, "<-- nfs4_try_mount() = %ld%s\n", 2827 2822 IS_ERR(res) ? PTR_ERR(res) : 0, ··· 3080 3079 flags, data, data->hostname); 3081 3080 data->mnt_path = export_path; 3082 3081 3083 - res = ERR_CAST(root_mnt); 3084 - if (!IS_ERR(root_mnt)) 3085 - res = nfs_follow_remote_path(root_mnt, export_path); 3082 + res = nfs_follow_remote_path(root_mnt, export_path); 3086 3083 dprintk("<-- nfs4_referral_mount() = %ld%s\n", 3087 3084 IS_ERR(res) ? PTR_ERR(res) : 0, 3088 3085 IS_ERR(res) ? " [error]" : "");
+2 -2
fs/nfsd/nfs4proc.c
··· 838 838 return status; 839 839 } 840 840 } 841 - status = mnt_want_write(cstate->current_fh.fh_export->ex_path.mnt); 841 + status = fh_want_write(&cstate->current_fh); 842 842 if (status) 843 843 return status; 844 844 status = nfs_ok; ··· 856 856 status = nfsd_setattr(rqstp, &cstate->current_fh, &setattr->sa_iattr, 857 857 0, (time_t)0); 858 858 out: 859 - mnt_drop_write(cstate->current_fh.fh_export->ex_path.mnt); 859 + fh_drop_write(&cstate->current_fh); 860 860 return status; 861 861 } 862 862
+6 -6
fs/nfsd/nfs4recover.c
··· 147 147 status = -EEXIST; 148 148 if (dentry->d_inode) 149 149 goto out_put; 150 - status = mnt_want_write(rec_file->f_path.mnt); 150 + status = mnt_want_write_file(rec_file); 151 151 if (status) 152 152 goto out_put; 153 153 status = vfs_mkdir(dir->d_inode, dentry, S_IRWXU); 154 - mnt_drop_write(rec_file->f_path.mnt); 154 + mnt_drop_write_file(rec_file); 155 155 out_put: 156 156 dput(dentry); 157 157 out_unlock: ··· 268 268 if (!rec_file || !clp->cl_firststate) 269 269 return; 270 270 271 - status = mnt_want_write(rec_file->f_path.mnt); 271 + status = mnt_want_write_file(rec_file); 272 272 if (status) 273 273 goto out; 274 274 clp->cl_firststate = 0; ··· 281 281 nfs4_reset_creds(original_cred); 282 282 if (status == 0) 283 283 vfs_fsync(rec_file, 0); 284 - mnt_drop_write(rec_file->f_path.mnt); 284 + mnt_drop_write_file(rec_file); 285 285 out: 286 286 if (status) 287 287 printk("NFSD: Failed to remove expired client state directory" ··· 311 311 312 312 if (!rec_file) 313 313 return; 314 - status = mnt_want_write(rec_file->f_path.mnt); 314 + status = mnt_want_write_file(rec_file); 315 315 if (status) 316 316 goto out; 317 317 status = nfsd4_list_rec_dir(purge_old); 318 318 if (status == 0) 319 319 vfs_fsync(rec_file, 0); 320 - mnt_drop_write(rec_file->f_path.mnt); 320 + mnt_drop_write_file(rec_file); 321 321 out: 322 322 if (status) 323 323 printk("nfsd4: failed to purge old clients from recovery"
+1 -1
fs/nfsd/nfsctl.c
··· 272 272 * 2. Is that directory a mount point, or 273 273 * 3. Is that directory the root of an exported file system? 274 274 */ 275 - error = nlmsvc_unlock_all_by_sb(path.mnt->mnt_sb); 275 + error = nlmsvc_unlock_all_by_sb(path.dentry->d_sb); 276 276 277 277 path_put(&path); 278 278 return error;
+2 -2
fs/nfsd/nfsfh.c
··· 59 59 * the write call). 60 60 */ 61 61 static inline __be32 62 - nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int requested) 62 + nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, umode_t requested) 63 63 { 64 64 mode &= S_IFMT; 65 65 ··· 293 293 * include/linux/nfsd/nfsd.h. 294 294 */ 295 295 __be32 296 - fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) 296 + fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, int access) 297 297 { 298 298 struct svc_export *exp; 299 299 struct dentry *dentry;
+1 -1
fs/nfsd/nfsfh.h
··· 102 102 /* 103 103 * Function prototypes 104 104 */ 105 - __be32 fh_verify(struct svc_rqst *, struct svc_fh *, int, int); 105 + __be32 fh_verify(struct svc_rqst *, struct svc_fh *, umode_t, int); 106 106 __be32 fh_compose(struct svc_fh *, struct svc_export *, struct dentry *, struct svc_fh *); 107 107 __be32 fh_update(struct svc_fh *); 108 108 void fh_put(struct svc_fh *);
+19 -19
fs/nfsd/vfs.c
··· 307 307 struct dentry *dentry; 308 308 struct inode *inode; 309 309 int accmode = NFSD_MAY_SATTR; 310 - int ftype = 0; 310 + umode_t ftype = 0; 311 311 __be32 err; 312 312 int host_err; 313 313 int size_change = 0; ··· 730 730 * N.B. After this call fhp needs an fh_put 731 731 */ 732 732 __be32 733 - nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, 733 + nfsd_open(struct svc_rqst *rqstp, struct svc_fh *fhp, umode_t type, 734 734 int access, struct file **filp) 735 735 { 736 736 struct dentry *dentry; ··· 1300 1300 goto out; 1301 1301 } 1302 1302 1303 - host_err = mnt_want_write(fhp->fh_export->ex_path.mnt); 1303 + host_err = fh_want_write(fhp); 1304 1304 if (host_err) 1305 1305 goto out_nfserr; 1306 1306 ··· 1325 1325 break; 1326 1326 } 1327 1327 if (host_err < 0) { 1328 - mnt_drop_write(fhp->fh_export->ex_path.mnt); 1328 + fh_drop_write(fhp); 1329 1329 goto out_nfserr; 1330 1330 } 1331 1331 ··· 1339 1339 err2 = nfserrno(commit_metadata(fhp)); 1340 1340 if (err2) 1341 1341 err = err2; 1342 - mnt_drop_write(fhp->fh_export->ex_path.mnt); 1342 + fh_drop_write(fhp); 1343 1343 /* 1344 1344 * Update the file handle to get the new inode info. 1345 1345 */ ··· 1430 1430 v_atime = verifier[1]&0x7fffffff; 1431 1431 } 1432 1432 1433 - host_err = mnt_want_write(fhp->fh_export->ex_path.mnt); 1433 + host_err = fh_want_write(fhp); 1434 1434 if (host_err) 1435 1435 goto out_nfserr; 1436 1436 if (dchild->d_inode) { ··· 1469 1469 case NFS3_CREATE_GUARDED: 1470 1470 err = nfserr_exist; 1471 1471 } 1472 - mnt_drop_write(fhp->fh_export->ex_path.mnt); 1472 + fh_drop_write(fhp); 1473 1473 goto out; 1474 1474 } 1475 1475 1476 1476 host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL); 1477 1477 if (host_err < 0) { 1478 - mnt_drop_write(fhp->fh_export->ex_path.mnt); 1478 + fh_drop_write(fhp); 1479 1479 goto out_nfserr; 1480 1480 } 1481 1481 if (created) ··· 1503 1503 if (!err) 1504 1504 err = nfserrno(commit_metadata(fhp)); 1505 1505 1506 - mnt_drop_write(fhp->fh_export->ex_path.mnt); 1506 + fh_drop_write(fhp); 1507 1507 /* 1508 1508 * Update the filehandle to get the new inode info. 1509 1509 */ ··· 1600 1600 if (IS_ERR(dnew)) 1601 1601 goto out_nfserr; 1602 1602 1603 - host_err = mnt_want_write(fhp->fh_export->ex_path.mnt); 1603 + host_err = fh_want_write(fhp); 1604 1604 if (host_err) 1605 1605 goto out_nfserr; 1606 1606 ··· 1621 1621 err = nfserrno(commit_metadata(fhp)); 1622 1622 fh_unlock(fhp); 1623 1623 1624 - mnt_drop_write(fhp->fh_export->ex_path.mnt); 1624 + fh_drop_write(fhp); 1625 1625 1626 1626 cerr = fh_compose(resfhp, fhp->fh_export, dnew, fhp); 1627 1627 dput(dnew); ··· 1674 1674 1675 1675 dold = tfhp->fh_dentry; 1676 1676 1677 - host_err = mnt_want_write(tfhp->fh_export->ex_path.mnt); 1677 + host_err = fh_want_write(tfhp); 1678 1678 if (host_err) { 1679 1679 err = nfserrno(host_err); 1680 1680 goto out_dput; ··· 1699 1699 err = nfserrno(host_err); 1700 1700 } 1701 1701 out_drop_write: 1702 - mnt_drop_write(tfhp->fh_export->ex_path.mnt); 1702 + fh_drop_write(tfhp); 1703 1703 out_dput: 1704 1704 dput(dnew); 1705 1705 out_unlock: ··· 1776 1776 host_err = -EXDEV; 1777 1777 if (ffhp->fh_export->ex_path.mnt != tfhp->fh_export->ex_path.mnt) 1778 1778 goto out_dput_new; 1779 - host_err = mnt_want_write(ffhp->fh_export->ex_path.mnt); 1779 + host_err = fh_want_write(ffhp); 1780 1780 if (host_err) 1781 1781 goto out_dput_new; 1782 1782 ··· 1795 1795 host_err = commit_metadata(ffhp); 1796 1796 } 1797 1797 out_drop_write: 1798 - mnt_drop_write(ffhp->fh_export->ex_path.mnt); 1798 + fh_drop_write(ffhp); 1799 1799 out_dput_new: 1800 1800 dput(ndentry); 1801 1801 out_dput_old: ··· 1854 1854 if (!type) 1855 1855 type = rdentry->d_inode->i_mode & S_IFMT; 1856 1856 1857 - host_err = mnt_want_write(fhp->fh_export->ex_path.mnt); 1857 + host_err = fh_want_write(fhp); 1858 1858 if (host_err) 1859 1859 goto out_put; 1860 1860 ··· 1868 1868 if (!host_err) 1869 1869 host_err = commit_metadata(fhp); 1870 1870 out_drop_write: 1871 - mnt_drop_write(fhp->fh_export->ex_path.mnt); 1871 + fh_drop_write(fhp); 1872 1872 out_put: 1873 1873 dput(rdentry); 1874 1874 ··· 2270 2270 } else 2271 2271 size = 0; 2272 2272 2273 - error = mnt_want_write(fhp->fh_export->ex_path.mnt); 2273 + error = fh_want_write(fhp); 2274 2274 if (error) 2275 2275 goto getout; 2276 2276 if (size) ··· 2284 2284 error = 0; 2285 2285 } 2286 2286 } 2287 - mnt_drop_write(fhp->fh_export->ex_path.mnt); 2287 + fh_drop_write(fhp); 2288 2288 2289 2289 getout: 2290 2290 kfree(value);
+11 -1
fs/nfsd/vfs.h
··· 66 66 __be32 nfsd_commit(struct svc_rqst *, struct svc_fh *, 67 67 loff_t, unsigned long); 68 68 #endif /* CONFIG_NFSD_V3 */ 69 - __be32 nfsd_open(struct svc_rqst *, struct svc_fh *, int, 69 + __be32 nfsd_open(struct svc_rqst *, struct svc_fh *, umode_t, 70 70 int, struct file **); 71 71 void nfsd_close(struct file *); 72 72 __be32 nfsd_read(struct svc_rqst *, struct svc_fh *, ··· 105 105 struct posix_acl *nfsd_get_posix_acl(struct svc_fh *, int); 106 106 int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *); 107 107 #endif 108 + 109 + static inline int fh_want_write(struct svc_fh *fh) 110 + { 111 + return mnt_want_write(fh->fh_export->ex_path.mnt); 112 + } 113 + 114 + static inline void fh_drop_write(struct svc_fh *fh) 115 + { 116 + mnt_drop_write(fh->fh_export->ex_path.mnt); 117 + } 108 118 109 119 #endif /* LINUX_NFSD_VFS_H */
+1 -1
fs/nilfs2/dir.c
··· 251 251 252 252 static void nilfs_set_de_type(struct nilfs_dir_entry *de, struct inode *inode) 253 253 { 254 - mode_t mode = inode->i_mode; 254 + umode_t mode = inode->i_mode; 255 255 256 256 de->file_type = nilfs_type_by_mode[(mode & S_IFMT)>>S_SHIFT]; 257 257 }
+1 -1
fs/nilfs2/inode.c
··· 291 291 .is_partially_uptodate = block_is_partially_uptodate, 292 292 }; 293 293 294 - struct inode *nilfs_new_inode(struct inode *dir, int mode) 294 + struct inode *nilfs_new_inode(struct inode *dir, umode_t mode) 295 295 { 296 296 struct super_block *sb = dir->i_sb; 297 297 struct the_nilfs *nilfs = sb->s_fs_info;
+11 -11
fs/nilfs2/ioctl.c
··· 27 27 #include <linux/uaccess.h> /* copy_from_user(), copy_to_user() */ 28 28 #include <linux/vmalloc.h> 29 29 #include <linux/compat.h> /* compat_ptr() */ 30 - #include <linux/mount.h> /* mnt_want_write(), mnt_drop_write() */ 30 + #include <linux/mount.h> /* mnt_want_write_file(), mnt_drop_write_file() */ 31 31 #include <linux/buffer_head.h> 32 32 #include <linux/nilfs2_fs.h> 33 33 #include "nilfs.h" ··· 119 119 if (get_user(flags, (int __user *)argp)) 120 120 return -EFAULT; 121 121 122 - ret = mnt_want_write(filp->f_path.mnt); 122 + ret = mnt_want_write_file(filp); 123 123 if (ret) 124 124 return ret; 125 125 ··· 154 154 ret = nilfs_transaction_commit(inode->i_sb); 155 155 out: 156 156 mutex_unlock(&inode->i_mutex); 157 - mnt_drop_write(filp->f_path.mnt); 157 + mnt_drop_write_file(filp); 158 158 return ret; 159 159 } 160 160 ··· 174 174 if (!capable(CAP_SYS_ADMIN)) 175 175 return -EPERM; 176 176 177 - ret = mnt_want_write(filp->f_path.mnt); 177 + ret = mnt_want_write_file(filp); 178 178 if (ret) 179 179 return ret; 180 180 ··· 194 194 195 195 up_read(&inode->i_sb->s_umount); 196 196 out: 197 - mnt_drop_write(filp->f_path.mnt); 197 + mnt_drop_write_file(filp); 198 198 return ret; 199 199 } 200 200 ··· 210 210 if (!capable(CAP_SYS_ADMIN)) 211 211 return -EPERM; 212 212 213 - ret = mnt_want_write(filp->f_path.mnt); 213 + ret = mnt_want_write_file(filp); 214 214 if (ret) 215 215 return ret; 216 216 ··· 225 225 else 226 226 nilfs_transaction_commit(inode->i_sb); /* never fails */ 227 227 out: 228 - mnt_drop_write(filp->f_path.mnt); 228 + mnt_drop_write_file(filp); 229 229 return ret; 230 230 } 231 231 ··· 591 591 if (!capable(CAP_SYS_ADMIN)) 592 592 return -EPERM; 593 593 594 - ret = mnt_want_write(filp->f_path.mnt); 594 + ret = mnt_want_write_file(filp); 595 595 if (ret) 596 596 return ret; 597 597 ··· 675 675 vfree(kbufs[n]); 676 676 kfree(kbufs[4]); 677 677 out: 678 - mnt_drop_write(filp->f_path.mnt); 678 + mnt_drop_write_file(filp); 679 679 return ret; 680 680 } 681 681 ··· 710 710 if (!capable(CAP_SYS_ADMIN)) 711 711 goto out; 712 712 713 - ret = mnt_want_write(filp->f_path.mnt); 713 + ret = mnt_want_write_file(filp); 714 714 if (ret) 715 715 goto out; 716 716 ··· 721 721 ret = nilfs_resize_fs(inode->i_sb, newsize); 722 722 723 723 out_drop_write: 724 - mnt_drop_write(filp->f_path.mnt); 724 + mnt_drop_write_file(filp); 725 725 out: 726 726 return ret; 727 727 }
+3 -3
fs/nilfs2/namei.c
··· 84 84 * If the create succeeds, we fill in the inode information 85 85 * with d_instantiate(). 86 86 */ 87 - static int nilfs_create(struct inode *dir, struct dentry *dentry, int mode, 87 + static int nilfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 88 88 struct nameidata *nd) 89 89 { 90 90 struct inode *inode; ··· 112 112 } 113 113 114 114 static int 115 - nilfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) 115 + nilfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) 116 116 { 117 117 struct inode *inode; 118 118 struct nilfs_transaction_info ti; ··· 213 213 return err; 214 214 } 215 215 216 - static int nilfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 216 + static int nilfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 217 217 { 218 218 struct inode *inode; 219 219 struct nilfs_transaction_info ti;
+1 -1
fs/nilfs2/nilfs.h
··· 246 246 /* inode.c */ 247 247 void nilfs_inode_add_blocks(struct inode *inode, int n); 248 248 void nilfs_inode_sub_blocks(struct inode *inode, int n); 249 - extern struct inode *nilfs_new_inode(struct inode *, int); 249 + extern struct inode *nilfs_new_inode(struct inode *, umode_t); 250 250 extern void nilfs_free_inode(struct inode *); 251 251 extern int nilfs_get_block(struct inode *, sector_t, struct buffer_head *, int); 252 252 extern void nilfs_set_inode_flags(struct inode *);
+3 -5
fs/nilfs2/super.c
··· 175 175 struct inode *inode = container_of(head, struct inode, i_rcu); 176 176 struct nilfs_mdt_info *mdi = NILFS_MDT(inode); 177 177 178 - INIT_LIST_HEAD(&inode->i_dentry); 179 - 180 178 if (mdi) { 181 179 kfree(mdi->mi_bgl); /* kfree(NULL) is safe */ 182 180 kfree(mdi); ··· 648 650 return 0; 649 651 } 650 652 651 - static int nilfs_show_options(struct seq_file *seq, struct vfsmount *vfs) 653 + static int nilfs_show_options(struct seq_file *seq, struct dentry *dentry) 652 654 { 653 - struct super_block *sb = vfs->mnt_sb; 655 + struct super_block *sb = dentry->d_sb; 654 656 struct the_nilfs *nilfs = sb->s_fs_info; 655 - struct nilfs_root *root = NILFS_I(vfs->mnt_root->d_inode)->i_root; 657 + struct nilfs_root *root = NILFS_I(dentry->d_inode)->i_root; 656 658 657 659 if (!nilfs_test_opt(nilfs, BARRIER)) 658 660 seq_puts(seq, ",nobarrier");
+4 -2
fs/notify/fanotify/fanotify_user.c
··· 16 16 17 17 #include <asm/ioctls.h> 18 18 19 + #include "../../mount.h" 20 + 19 21 #define FANOTIFY_DEFAULT_MAX_EVENTS 16384 20 22 #define FANOTIFY_DEFAULT_MAX_MARKS 8192 21 23 #define FANOTIFY_DEFAULT_MAX_LISTENERS 128 ··· 548 546 549 547 removed = fanotify_mark_remove_from_mask(fsn_mark, mask, flags); 550 548 fsnotify_put_mark(fsn_mark); 551 - if (removed & mnt->mnt_fsnotify_mask) 549 + if (removed & real_mount(mnt)->mnt_fsnotify_mask) 552 550 fsnotify_recalc_vfsmount_mask(mnt); 553 551 554 552 return 0; ··· 625 623 } 626 624 added = fanotify_mark_add_to_mask(fsn_mark, mask, flags); 627 625 628 - if (added & ~mnt->mnt_fsnotify_mask) 626 + if (added & ~real_mount(mnt)->mnt_fsnotify_mask) 629 627 fsnotify_recalc_vfsmount_mask(mnt); 630 628 err: 631 629 fsnotify_put_mark(fsn_mark);
+5 -4
fs/notify/fsnotify.c
··· 26 26 27 27 #include <linux/fsnotify_backend.h> 28 28 #include "fsnotify.h" 29 + #include "../mount.h" 29 30 30 31 /* 31 32 * Clear all of the marks on an inode when it is being evicted from core ··· 206 205 struct fsnotify_mark *inode_mark = NULL, *vfsmount_mark = NULL; 207 206 struct fsnotify_group *inode_group, *vfsmount_group; 208 207 struct fsnotify_event *event = NULL; 209 - struct vfsmount *mnt; 208 + struct mount *mnt; 210 209 int idx, ret = 0; 211 210 /* global tests shouldn't care about events on child only the specific event */ 212 211 __u32 test_mask = (mask & ~FS_EVENT_ON_CHILD); 213 212 214 213 if (data_is == FSNOTIFY_EVENT_PATH) 215 - mnt = ((struct path *)data)->mnt; 214 + mnt = real_mount(((struct path *)data)->mnt); 216 215 else 217 216 mnt = NULL; 218 217 ··· 263 262 /* we didn't use the vfsmount_mark */ 264 263 vfsmount_group = NULL; 265 264 } else if (vfsmount_group > inode_group) { 266 - ret = send_to_group(to_tell, mnt, NULL, vfsmount_mark, mask, data, 265 + ret = send_to_group(to_tell, &mnt->mnt, NULL, vfsmount_mark, mask, data, 267 266 data_is, cookie, file_name, &event); 268 267 inode_group = NULL; 269 268 } else { 270 - ret = send_to_group(to_tell, mnt, inode_mark, vfsmount_mark, 269 + ret = send_to_group(to_tell, &mnt->mnt, inode_mark, vfsmount_mark, 271 270 mask, data, data_is, cookie, file_name, 272 271 &event); 273 272 }
+12 -7
fs/notify/vfsmount_mark.c
··· 28 28 29 29 #include <linux/fsnotify_backend.h> 30 30 #include "fsnotify.h" 31 + #include "../mount.h" 31 32 32 33 void fsnotify_clear_marks_by_mount(struct vfsmount *mnt) 33 34 { 34 35 struct fsnotify_mark *mark, *lmark; 35 36 struct hlist_node *pos, *n; 37 + struct mount *m = real_mount(mnt); 36 38 LIST_HEAD(free_list); 37 39 38 40 spin_lock(&mnt->mnt_root->d_lock); 39 - hlist_for_each_entry_safe(mark, pos, n, &mnt->mnt_fsnotify_marks, m.m_list) { 41 + hlist_for_each_entry_safe(mark, pos, n, &m->mnt_fsnotify_marks, m.m_list) { 40 42 list_add(&mark->m.free_m_list, &free_list); 41 43 hlist_del_init_rcu(&mark->m.m_list); 42 44 fsnotify_get_mark(mark); ··· 61 59 */ 62 60 static void fsnotify_recalc_vfsmount_mask_locked(struct vfsmount *mnt) 63 61 { 62 + struct mount *m = real_mount(mnt); 64 63 struct fsnotify_mark *mark; 65 64 struct hlist_node *pos; 66 65 __u32 new_mask = 0; 67 66 68 67 assert_spin_locked(&mnt->mnt_root->d_lock); 69 68 70 - hlist_for_each_entry(mark, pos, &mnt->mnt_fsnotify_marks, m.m_list) 69 + hlist_for_each_entry(mark, pos, &m->mnt_fsnotify_marks, m.m_list) 71 70 new_mask |= mark->mask; 72 - mnt->mnt_fsnotify_mask = new_mask; 71 + m->mnt_fsnotify_mask = new_mask; 73 72 } 74 73 75 74 /* ··· 104 101 static struct fsnotify_mark *fsnotify_find_vfsmount_mark_locked(struct fsnotify_group *group, 105 102 struct vfsmount *mnt) 106 103 { 104 + struct mount *m = real_mount(mnt); 107 105 struct fsnotify_mark *mark; 108 106 struct hlist_node *pos; 109 107 110 108 assert_spin_locked(&mnt->mnt_root->d_lock); 111 109 112 - hlist_for_each_entry(mark, pos, &mnt->mnt_fsnotify_marks, m.m_list) { 110 + hlist_for_each_entry(mark, pos, &m->mnt_fsnotify_marks, m.m_list) { 113 111 if (mark->group == group) { 114 112 fsnotify_get_mark(mark); 115 113 return mark; ··· 144 140 struct fsnotify_group *group, struct vfsmount *mnt, 145 141 int allow_dups) 146 142 { 143 + struct mount *m = real_mount(mnt); 147 144 struct fsnotify_mark *lmark; 148 145 struct hlist_node *node, *last = NULL; 149 146 int ret = 0; ··· 159 154 mark->m.mnt = mnt; 160 155 161 156 /* is mark the first mark? */ 162 - if (hlist_empty(&mnt->mnt_fsnotify_marks)) { 163 - hlist_add_head_rcu(&mark->m.m_list, &mnt->mnt_fsnotify_marks); 157 + if (hlist_empty(&m->mnt_fsnotify_marks)) { 158 + hlist_add_head_rcu(&mark->m.m_list, &m->mnt_fsnotify_marks); 164 159 goto out; 165 160 } 166 161 167 162 /* should mark be in the middle of the current list? */ 168 - hlist_for_each_entry(lmark, node, &mnt->mnt_fsnotify_marks, m.m_list) { 163 + hlist_for_each_entry(lmark, node, &m->mnt_fsnotify_marks, m.m_list) { 169 164 last = node; 170 165 171 166 if ((lmark->group == group) && !allow_dups) {
+4 -5
fs/ntfs/inode.c
··· 335 335 static void ntfs_i_callback(struct rcu_head *head) 336 336 { 337 337 struct inode *inode = container_of(head, struct inode, i_rcu); 338 - INIT_LIST_HEAD(&inode->i_dentry); 339 338 kmem_cache_free(ntfs_big_inode_cache, NTFS_I(inode)); 340 339 } 341 340 ··· 2300 2301 /** 2301 2302 * ntfs_show_options - show mount options in /proc/mounts 2302 2303 * @sf: seq_file in which to write our mount options 2303 - * @mnt: vfs mount whose mount options to display 2304 + * @root: root of the mounted tree whose mount options to display 2304 2305 * 2305 2306 * Called by the VFS once for each mounted ntfs volume when someone reads 2306 2307 * /proc/mounts in order to display the NTFS specific mount options of each 2307 - * mount. The mount options of the vfs mount @mnt are written to the seq file 2308 + * mount. The mount options of fs specified by @root are written to the seq file 2308 2309 * @sf and success is returned. 2309 2310 */ 2310 - int ntfs_show_options(struct seq_file *sf, struct vfsmount *mnt) 2311 + int ntfs_show_options(struct seq_file *sf, struct dentry *root) 2311 2312 { 2312 - ntfs_volume *vol = NTFS_SB(mnt->mnt_sb); 2313 + ntfs_volume *vol = NTFS_SB(root->d_sb); 2313 2314 int i; 2314 2315 2315 2316 seq_printf(sf, ",uid=%i", vol->uid);
+1 -1
fs/ntfs/inode.h
··· 298 298 299 299 extern int ntfs_read_inode_mount(struct inode *vi); 300 300 301 - extern int ntfs_show_options(struct seq_file *sf, struct vfsmount *mnt); 301 + extern int ntfs_show_options(struct seq_file *sf, struct dentry *root); 302 302 303 303 #ifdef NTFS_RW 304 304
+3 -3
fs/ntfs/super.c
··· 104 104 int errors = 0, sloppy = 0; 105 105 uid_t uid = (uid_t)-1; 106 106 gid_t gid = (gid_t)-1; 107 - mode_t fmask = (mode_t)-1, dmask = (mode_t)-1; 107 + umode_t fmask = (umode_t)-1, dmask = (umode_t)-1; 108 108 int mft_zone_multiplier = -1, on_errors = -1; 109 109 int show_sys_files = -1, case_sensitive = -1, disable_sparse = -1; 110 110 struct nls_table *nls_map = NULL, *old_nls; ··· 287 287 vol->uid = uid; 288 288 if (gid != (gid_t)-1) 289 289 vol->gid = gid; 290 - if (fmask != (mode_t)-1) 290 + if (fmask != (umode_t)-1) 291 291 vol->fmask = fmask; 292 - if (dmask != (mode_t)-1) 292 + if (dmask != (umode_t)-1) 293 293 vol->dmask = dmask; 294 294 if (show_sys_files != -1) { 295 295 if (show_sys_files)
+2 -2
fs/ntfs/volume.h
··· 48 48 unsigned long flags; /* Miscellaneous flags, see below. */ 49 49 uid_t uid; /* uid that files will be mounted as. */ 50 50 gid_t gid; /* gid that files will be mounted as. */ 51 - mode_t fmask; /* The mask for file permissions. */ 52 - mode_t dmask; /* The mask for directory 51 + umode_t fmask; /* The mask for file permissions. */ 52 + umode_t dmask; /* The mask for directory 53 53 permissions. */ 54 54 u8 mft_zone_multiplier; /* Initial mft zone multiplier. */ 55 55 u8 on_errors; /* What to do on filesystem errors. */
+1 -1
fs/ocfs2/cluster/netdebug.c
··· 553 553 554 554 int o2net_debugfs_init(void) 555 555 { 556 - mode_t mode = S_IFREG|S_IRUSR; 556 + umode_t mode = S_IFREG|S_IRUSR; 557 557 558 558 o2net_dentry = debugfs_create_dir(O2NET_DEBUG_DIR, NULL); 559 559 if (o2net_dentry)
+6 -18
fs/ocfs2/dlmfs/dlmfs.c
··· 354 354 static void dlmfs_i_callback(struct rcu_head *head) 355 355 { 356 356 struct inode *inode = container_of(head, struct inode, i_rcu); 357 - INIT_LIST_HEAD(&inode->i_dentry); 358 357 kmem_cache_free(dlmfs_inode_cache, DLMFS_I(inode)); 359 358 } 360 359 ··· 400 401 static struct inode *dlmfs_get_root_inode(struct super_block *sb) 401 402 { 402 403 struct inode *inode = new_inode(sb); 403 - int mode = S_IFDIR | 0755; 404 + umode_t mode = S_IFDIR | 0755; 404 405 struct dlmfs_inode_private *ip; 405 406 406 407 if (inode) { 407 408 ip = DLMFS_I(inode); 408 409 409 410 inode->i_ino = get_next_ino(); 410 - inode->i_mode = mode; 411 - inode->i_uid = current_fsuid(); 412 - inode->i_gid = current_fsgid(); 411 + inode_init_owner(inode, NULL, mode); 413 412 inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info; 414 413 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 415 414 inc_nlink(inode); ··· 421 424 422 425 static struct inode *dlmfs_get_inode(struct inode *parent, 423 426 struct dentry *dentry, 424 - int mode) 427 + umode_t mode) 425 428 { 426 429 struct super_block *sb = parent->i_sb; 427 430 struct inode * inode = new_inode(sb); ··· 431 434 return NULL; 432 435 433 436 inode->i_ino = get_next_ino(); 434 - inode->i_mode = mode; 435 - inode->i_uid = current_fsuid(); 436 - inode->i_gid = current_fsgid(); 437 + inode_init_owner(inode, parent, mode); 437 438 inode->i_mapping->backing_dev_info = &dlmfs_backing_dev_info; 438 439 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 439 440 ··· 468 473 inc_nlink(inode); 469 474 break; 470 475 } 471 - 472 - if (parent->i_mode & S_ISGID) { 473 - inode->i_gid = parent->i_gid; 474 - if (S_ISDIR(mode)) 475 - inode->i_mode |= S_ISGID; 476 - } 477 - 478 476 return inode; 479 477 } 480 478 ··· 477 489 /* SMP-safe */ 478 490 static int dlmfs_mkdir(struct inode * dir, 479 491 struct dentry * dentry, 480 - int mode) 492 + umode_t mode) 481 493 { 482 494 int status; 483 495 struct inode *inode = NULL; ··· 525 537 526 538 static int dlmfs_create(struct inode *dir, 527 539 struct dentry *dentry, 528 - int mode, 540 + umode_t mode, 529 541 struct nameidata *nd) 530 542 { 531 543 int status = 0;
+2 -2
fs/ocfs2/ioctl.c
··· 906 906 if (get_user(flags, (int __user *) arg)) 907 907 return -EFAULT; 908 908 909 - status = mnt_want_write(filp->f_path.mnt); 909 + status = mnt_want_write_file(filp); 910 910 if (status) 911 911 return status; 912 912 status = ocfs2_set_inode_attr(inode, flags, 913 913 OCFS2_FL_MODIFIABLE); 914 - mnt_drop_write(filp->f_path.mnt); 914 + mnt_drop_write_file(filp); 915 915 return status; 916 916 case OCFS2_IOC_RESVSP: 917 917 case OCFS2_IOC_RESVSP64:
+2 -2
fs/ocfs2/move_extents.c
··· 1059 1059 struct ocfs2_move_extents range; 1060 1060 struct ocfs2_move_extents_context *context = NULL; 1061 1061 1062 - status = mnt_want_write(filp->f_path.mnt); 1062 + status = mnt_want_write_file(filp); 1063 1063 if (status) 1064 1064 return status; 1065 1065 ··· 1145 1145 1146 1146 kfree(context); 1147 1147 1148 - mnt_drop_write(filp->f_path.mnt); 1148 + mnt_drop_write_file(filp); 1149 1149 1150 1150 return status; 1151 1151 }
+4 -4
fs/ocfs2/namei.c
··· 185 185 return ret; 186 186 } 187 187 188 - static struct inode *ocfs2_get_init_inode(struct inode *dir, int mode) 188 + static struct inode *ocfs2_get_init_inode(struct inode *dir, umode_t mode) 189 189 { 190 190 struct inode *inode; 191 191 ··· 207 207 208 208 static int ocfs2_mknod(struct inode *dir, 209 209 struct dentry *dentry, 210 - int mode, 210 + umode_t mode, 211 211 dev_t dev) 212 212 { 213 213 int status = 0; ··· 602 602 603 603 static int ocfs2_mkdir(struct inode *dir, 604 604 struct dentry *dentry, 605 - int mode) 605 + umode_t mode) 606 606 { 607 607 int ret; 608 608 ··· 617 617 618 618 static int ocfs2_create(struct inode *dir, 619 619 struct dentry *dentry, 620 - int mode, 620 + umode_t mode, 621 621 struct nameidata *nd) 622 622 { 623 623 int ret;
+4 -6
fs/ocfs2/super.c
··· 108 108 int is_remount); 109 109 static int ocfs2_check_set_options(struct super_block *sb, 110 110 struct mount_options *options); 111 - static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt); 111 + static int ocfs2_show_options(struct seq_file *s, struct dentry *root); 112 112 static void ocfs2_put_super(struct super_block *sb); 113 113 static int ocfs2_mount_volume(struct super_block *sb); 114 114 static int ocfs2_remount(struct super_block *sb, int *flags, char *data); ··· 569 569 static void ocfs2_i_callback(struct rcu_head *head) 570 570 { 571 571 struct inode *inode = container_of(head, struct inode, i_rcu); 572 - INIT_LIST_HEAD(&inode->i_dentry); 573 572 kmem_cache_free(ocfs2_inode_cachep, OCFS2_I(inode)); 574 573 } 575 574 ··· 1533 1534 return status; 1534 1535 } 1535 1536 1536 - static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt) 1537 + static int ocfs2_show_options(struct seq_file *s, struct dentry *root) 1537 1538 { 1538 - struct ocfs2_super *osb = OCFS2_SB(mnt->mnt_sb); 1539 + struct ocfs2_super *osb = OCFS2_SB(root->d_sb); 1539 1540 unsigned long opts = osb->s_mount_opt; 1540 1541 unsigned int local_alloc_megs; 1541 1542 ··· 1567 1568 if (osb->preferred_slot != OCFS2_INVALID_SLOT) 1568 1569 seq_printf(s, ",preferred_slot=%d", osb->preferred_slot); 1569 1570 1570 - if (!(mnt->mnt_flags & MNT_NOATIME) && !(mnt->mnt_flags & MNT_RELATIME)) 1571 - seq_printf(s, ",atime_quantum=%u", osb->s_atime_quantum); 1571 + seq_printf(s, ",atime_quantum=%u", osb->s_atime_quantum); 1572 1572 1573 1573 if (osb->osb_commit_interval) 1574 1574 seq_printf(s, ",commit=%u",
+1 -1
fs/ocfs2/xattr.c
··· 623 623 624 624 int ocfs2_calc_xattr_init(struct inode *dir, 625 625 struct buffer_head *dir_bh, 626 - int mode, 626 + umode_t mode, 627 627 struct ocfs2_security_xattr_info *si, 628 628 int *want_clusters, 629 629 int *xattr_credits,
+1 -1
fs/ocfs2/xattr.h
··· 68 68 struct ocfs2_security_xattr_info *, 69 69 int *, int *, struct ocfs2_alloc_context **); 70 70 int ocfs2_calc_xattr_init(struct inode *, struct buffer_head *, 71 - int, struct ocfs2_security_xattr_info *, 71 + umode_t, struct ocfs2_security_xattr_info *, 72 72 int *, int *, int *); 73 73 74 74 /*
+3 -3
fs/omfs/dir.c
··· 255 255 return 0; 256 256 } 257 257 258 - static int omfs_add_node(struct inode *dir, struct dentry *dentry, int mode) 258 + static int omfs_add_node(struct inode *dir, struct dentry *dentry, umode_t mode) 259 259 { 260 260 int err; 261 261 struct inode *inode = omfs_new_inode(dir, mode); ··· 279 279 return err; 280 280 } 281 281 282 - static int omfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 282 + static int omfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 283 283 { 284 284 return omfs_add_node(dir, dentry, mode | S_IFDIR); 285 285 } 286 286 287 - static int omfs_create(struct inode *dir, struct dentry *dentry, int mode, 287 + static int omfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 288 288 struct nameidata *nd) 289 289 { 290 290 return omfs_add_node(dir, dentry, mode | S_IFREG);
+1 -1
fs/omfs/inode.c
··· 28 28 return sb_bread(sb, clus_to_blk(sbi, block)); 29 29 } 30 30 31 - struct inode *omfs_new_inode(struct inode *dir, int mode) 31 + struct inode *omfs_new_inode(struct inode *dir, umode_t mode) 32 32 { 33 33 struct inode *inode; 34 34 u64 new_block;
+1 -1
fs/omfs/omfs.h
··· 60 60 /* inode.c */ 61 61 extern struct buffer_head *omfs_bread(struct super_block *sb, sector_t block); 62 62 extern struct inode *omfs_iget(struct super_block *sb, ino_t inode); 63 - extern struct inode *omfs_new_inode(struct inode *dir, int mode); 63 + extern struct inode *omfs_new_inode(struct inode *dir, umode_t mode); 64 64 extern int omfs_reserve_block(struct super_block *sb, sector_t block); 65 65 extern int omfs_find_empty_block(struct super_block *sb, int mode, ino_t *ino); 66 66 extern int omfs_sync_inode(struct inode *inode);
+11 -11
fs/open.c
··· 456 456 if (error) 457 457 return error; 458 458 mutex_lock(&inode->i_mutex); 459 - error = security_path_chmod(path->dentry, path->mnt, mode); 459 + error = security_path_chmod(path, mode); 460 460 if (error) 461 461 goto out_unlock; 462 462 newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO); ··· 468 468 return error; 469 469 } 470 470 471 - SYSCALL_DEFINE2(fchmod, unsigned int, fd, mode_t, mode) 471 + SYSCALL_DEFINE2(fchmod, unsigned int, fd, umode_t, mode) 472 472 { 473 473 struct file * file; 474 474 int err = -EBADF; ··· 482 482 return err; 483 483 } 484 484 485 - SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, mode_t, mode) 485 + SYSCALL_DEFINE3(fchmodat, int, dfd, const char __user *, filename, umode_t, mode) 486 486 { 487 487 struct path path; 488 488 int error; ··· 495 495 return error; 496 496 } 497 497 498 - SYSCALL_DEFINE2(chmod, const char __user *, filename, mode_t, mode) 498 + SYSCALL_DEFINE2(chmod, const char __user *, filename, umode_t, mode) 499 499 { 500 500 return sys_fchmodat(AT_FDCWD, filename, mode); 501 501 } ··· 608 608 dentry = file->f_path.dentry; 609 609 audit_inode(NULL, dentry); 610 610 error = chown_common(&file->f_path, user, group); 611 - mnt_drop_write(file->f_path.mnt); 611 + mnt_drop_write_file(file); 612 612 out_fput: 613 613 fput(file); 614 614 out: ··· 877 877 878 878 EXPORT_SYMBOL(fd_install); 879 879 880 - static inline int build_open_flags(int flags, int mode, struct open_flags *op) 880 + static inline int build_open_flags(int flags, umode_t mode, struct open_flags *op) 881 881 { 882 882 int lookup_flags = 0; 883 883 int acc_mode; ··· 948 948 * have to. But in generally you should not do this, so please move 949 949 * along, nothing to see here.. 950 950 */ 951 - struct file *filp_open(const char *filename, int flags, int mode) 951 + struct file *filp_open(const char *filename, int flags, umode_t mode) 952 952 { 953 953 struct open_flags op; 954 954 int lookup = build_open_flags(flags, mode, &op); ··· 970 970 } 971 971 EXPORT_SYMBOL(file_open_root); 972 972 973 - long do_sys_open(int dfd, const char __user *filename, int flags, int mode) 973 + long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode) 974 974 { 975 975 struct open_flags op; 976 976 int lookup = build_open_flags(flags, mode, &op); ··· 994 994 return fd; 995 995 } 996 996 997 - SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, int, mode) 997 + SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, umode_t, mode) 998 998 { 999 999 long ret; 1000 1000 ··· 1008 1008 } 1009 1009 1010 1010 SYSCALL_DEFINE4(openat, int, dfd, const char __user *, filename, int, flags, 1011 - int, mode) 1011 + umode_t, mode) 1012 1012 { 1013 1013 long ret; 1014 1014 ··· 1027 1027 * For backward compatibility? Maybe this should be moved 1028 1028 * into arch/i386 instead? 1029 1029 */ 1030 - SYSCALL_DEFINE2(creat, const char __user *, pathname, int, mode) 1030 + SYSCALL_DEFINE2(creat, const char __user *, pathname, umode_t, mode) 1031 1031 { 1032 1032 return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); 1033 1033 }
-1
fs/openpromfs/inode.c
··· 346 346 static void openprom_i_callback(struct rcu_head *head) 347 347 { 348 348 struct inode *inode = container_of(head, struct inode, i_rcu); 349 - INIT_LIST_HEAD(&inode->i_dentry); 350 349 kmem_cache_free(op_inode_cachep, OP_I(inode)); 351 350 } 352 351
fs/partitions/Kconfig block/partitions/Kconfig
fs/partitions/Makefile block/partitions/Makefile
fs/partitions/acorn.c block/partitions/acorn.c
fs/partitions/acorn.h block/partitions/acorn.h
fs/partitions/amiga.c block/partitions/amiga.c
fs/partitions/amiga.h block/partitions/amiga.h
fs/partitions/atari.c block/partitions/atari.c
fs/partitions/atari.h block/partitions/atari.h
+1 -151
fs/partitions/check.c block/partition-generic.c
··· 1 1 /* 2 - * fs/partitions/check.c 3 - * 4 2 * Code extracted from drivers/block/genhd.c 5 3 * Copyright (C) 1991-1998 Linus Torvalds 6 4 * Re-organised Feb 1998 Russell King ··· 7 9 * block drivers, which allows all the partition code to 8 10 * be grouped in one location, and it to be mostly self 9 11 * contained. 10 - * 11 - * Added needed MAJORS for new pairs, {hdi,hdj}, {hdk,hdl} 12 12 */ 13 13 14 14 #include <linux/init.h> ··· 18 22 #include <linux/genhd.h> 19 23 #include <linux/blktrace_api.h> 20 24 21 - #include "check.h" 22 - 23 - #include "acorn.h" 24 - #include "amiga.h" 25 - #include "atari.h" 26 - #include "ldm.h" 27 - #include "mac.h" 28 - #include "msdos.h" 29 - #include "osf.h" 30 - #include "sgi.h" 31 - #include "sun.h" 32 - #include "ibm.h" 33 - #include "ultrix.h" 34 - #include "efi.h" 35 - #include "karma.h" 36 - #include "sysv68.h" 25 + #include "partitions/check.h" 37 26 38 27 #ifdef CONFIG_BLK_DEV_MD 39 28 extern void md_autodetect_dev(dev_t dev); 40 29 #endif 41 - 42 - int warn_no_part = 1; /*This is ugly: should make genhd removable media aware*/ 43 - 44 - static int (*check_part[])(struct parsed_partitions *) = { 45 - /* 46 - * Probe partition formats with tables at disk address 0 47 - * that also have an ADFS boot block at 0xdc0. 48 - */ 49 - #ifdef CONFIG_ACORN_PARTITION_ICS 50 - adfspart_check_ICS, 51 - #endif 52 - #ifdef CONFIG_ACORN_PARTITION_POWERTEC 53 - adfspart_check_POWERTEC, 54 - #endif 55 - #ifdef CONFIG_ACORN_PARTITION_EESOX 56 - adfspart_check_EESOX, 57 - #endif 58 - 59 - /* 60 - * Now move on to formats that only have partition info at 61 - * disk address 0xdc0. Since these may also have stale 62 - * PC/BIOS partition tables, they need to come before 63 - * the msdos entry. 64 - */ 65 - #ifdef CONFIG_ACORN_PARTITION_CUMANA 66 - adfspart_check_CUMANA, 67 - #endif 68 - #ifdef CONFIG_ACORN_PARTITION_ADFS 69 - adfspart_check_ADFS, 70 - #endif 71 - 72 - #ifdef CONFIG_EFI_PARTITION 73 - efi_partition, /* this must come before msdos */ 74 - #endif 75 - #ifdef CONFIG_SGI_PARTITION 76 - sgi_partition, 77 - #endif 78 - #ifdef CONFIG_LDM_PARTITION 79 - ldm_partition, /* this must come before msdos */ 80 - #endif 81 - #ifdef CONFIG_MSDOS_PARTITION 82 - msdos_partition, 83 - #endif 84 - #ifdef CONFIG_OSF_PARTITION 85 - osf_partition, 86 - #endif 87 - #ifdef CONFIG_SUN_PARTITION 88 - sun_partition, 89 - #endif 90 - #ifdef CONFIG_AMIGA_PARTITION 91 - amiga_partition, 92 - #endif 93 - #ifdef CONFIG_ATARI_PARTITION 94 - atari_partition, 95 - #endif 96 - #ifdef CONFIG_MAC_PARTITION 97 - mac_partition, 98 - #endif 99 - #ifdef CONFIG_ULTRIX_PARTITION 100 - ultrix_partition, 101 - #endif 102 - #ifdef CONFIG_IBM_PARTITION 103 - ibm_partition, 104 - #endif 105 - #ifdef CONFIG_KARMA_PARTITION 106 - karma_partition, 107 - #endif 108 - #ifdef CONFIG_SYSV68_PARTITION 109 - sysv68_partition, 110 - #endif 111 - NULL 112 - }; 113 30 114 31 /* 115 32 * disk_name() is used by partition check code and the genhd driver. ··· 63 154 } 64 155 65 156 EXPORT_SYMBOL(__bdevname); 66 - 67 - static struct parsed_partitions * 68 - check_partition(struct gendisk *hd, struct block_device *bdev) 69 - { 70 - struct parsed_partitions *state; 71 - int i, res, err; 72 - 73 - state = kzalloc(sizeof(struct parsed_partitions), GFP_KERNEL); 74 - if (!state) 75 - return NULL; 76 - state->pp_buf = (char *)__get_free_page(GFP_KERNEL); 77 - if (!state->pp_buf) { 78 - kfree(state); 79 - return NULL; 80 - } 81 - state->pp_buf[0] = '\0'; 82 - 83 - state->bdev = bdev; 84 - disk_name(hd, 0, state->name); 85 - snprintf(state->pp_buf, PAGE_SIZE, " %s:", state->name); 86 - if (isdigit(state->name[strlen(state->name)-1])) 87 - sprintf(state->name, "p"); 88 - 89 - state->limit = disk_max_parts(hd); 90 - i = res = err = 0; 91 - while (!res && check_part[i]) { 92 - memset(&state->parts, 0, sizeof(state->parts)); 93 - res = check_part[i++](state); 94 - if (res < 0) { 95 - /* We have hit an I/O error which we don't report now. 96 - * But record it, and let the others do their job. 97 - */ 98 - err = res; 99 - res = 0; 100 - } 101 - 102 - } 103 - if (res > 0) { 104 - printk(KERN_INFO "%s", state->pp_buf); 105 - 106 - free_page((unsigned long)state->pp_buf); 107 - return state; 108 - } 109 - if (state->access_beyond_eod) 110 - err = -ENOSPC; 111 - if (err) 112 - /* The partition is unrecognized. So report I/O errors if there were any */ 113 - res = err; 114 - if (!res) 115 - strlcat(state->pp_buf, " unknown partition table\n", PAGE_SIZE); 116 - else if (warn_no_part) 117 - strlcat(state->pp_buf, " unable to read partition table\n", PAGE_SIZE); 118 - 119 - printk(KERN_INFO "%s", state->pp_buf); 120 - 121 - free_page((unsigned long)state->pp_buf); 122 - kfree(state); 123 - return ERR_PTR(res); 124 - } 125 157 126 158 static ssize_t part_partition_show(struct device *dev, 127 159 struct device_attribute *attr, char *buf)
+3
fs/partitions/check.h block/partitions/check.h
··· 22 22 char *pp_buf; 23 23 }; 24 24 25 + struct parsed_partitions * 26 + check_partition(struct gendisk *, struct block_device *); 27 + 25 28 static inline void *read_part_sector(struct parsed_partitions *state, 26 29 sector_t n, Sector *p) 27 30 {
fs/partitions/efi.c block/partitions/efi.c
fs/partitions/efi.h block/partitions/efi.h
fs/partitions/ibm.c block/partitions/ibm.c
fs/partitions/ibm.h block/partitions/ibm.h
fs/partitions/karma.c block/partitions/karma.c
fs/partitions/karma.h block/partitions/karma.h
fs/partitions/ldm.c block/partitions/ldm.c
fs/partitions/ldm.h block/partitions/ldm.h
fs/partitions/mac.c block/partitions/mac.c
fs/partitions/mac.h block/partitions/mac.h
fs/partitions/msdos.c block/partitions/msdos.c
fs/partitions/msdos.h block/partitions/msdos.h
fs/partitions/osf.c block/partitions/osf.c
fs/partitions/osf.h block/partitions/osf.h
fs/partitions/sgi.c block/partitions/sgi.c
fs/partitions/sgi.h block/partitions/sgi.h
fs/partitions/sun.c block/partitions/sun.c
fs/partitions/sun.h block/partitions/sun.h
fs/partitions/sysv68.c block/partitions/sysv68.c
fs/partitions/sysv68.h block/partitions/sysv68.h
fs/partitions/ultrix.c block/partitions/ultrix.c
fs/partitions/ultrix.h block/partitions/ultrix.h
-7
fs/pipe.c
··· 1290 1290 return err; 1291 1291 } 1292 1292 1293 - static void __exit exit_pipe_fs(void) 1294 - { 1295 - kern_unmount(pipe_mnt); 1296 - unregister_filesystem(&pipe_fs_type); 1297 - } 1298 - 1299 1293 fs_initcall(init_pipe_fs); 1300 - module_exit(exit_pipe_fs);
+52 -68
fs/pnode.c
··· 13 13 #include "pnode.h" 14 14 15 15 /* return the next shared peer mount of @p */ 16 - static inline struct vfsmount *next_peer(struct vfsmount *p) 16 + static inline struct mount *next_peer(struct mount *p) 17 17 { 18 - return list_entry(p->mnt_share.next, struct vfsmount, mnt_share); 18 + return list_entry(p->mnt_share.next, struct mount, mnt_share); 19 19 } 20 20 21 - static inline struct vfsmount *first_slave(struct vfsmount *p) 21 + static inline struct mount *first_slave(struct mount *p) 22 22 { 23 - return list_entry(p->mnt_slave_list.next, struct vfsmount, mnt_slave); 23 + return list_entry(p->mnt_slave_list.next, struct mount, mnt_slave); 24 24 } 25 25 26 - static inline struct vfsmount *next_slave(struct vfsmount *p) 26 + static inline struct mount *next_slave(struct mount *p) 27 27 { 28 - return list_entry(p->mnt_slave.next, struct vfsmount, mnt_slave); 28 + return list_entry(p->mnt_slave.next, struct mount, mnt_slave); 29 29 } 30 30 31 - /* 32 - * Return true if path is reachable from root 33 - * 34 - * namespace_sem is held, and mnt is attached 35 - */ 36 - static bool is_path_reachable(struct vfsmount *mnt, struct dentry *dentry, 37 - const struct path *root) 31 + static struct mount *get_peer_under_root(struct mount *mnt, 32 + struct mnt_namespace *ns, 33 + const struct path *root) 38 34 { 39 - while (mnt != root->mnt && mnt->mnt_parent != mnt) { 40 - dentry = mnt->mnt_mountpoint; 41 - mnt = mnt->mnt_parent; 42 - } 43 - return mnt == root->mnt && is_subdir(dentry, root->dentry); 44 - } 45 - 46 - static struct vfsmount *get_peer_under_root(struct vfsmount *mnt, 47 - struct mnt_namespace *ns, 48 - const struct path *root) 49 - { 50 - struct vfsmount *m = mnt; 35 + struct mount *m = mnt; 51 36 52 37 do { 53 38 /* Check the namespace first for optimization */ 54 - if (m->mnt_ns == ns && is_path_reachable(m, m->mnt_root, root)) 39 + if (m->mnt_ns == ns && is_path_reachable(m, m->mnt.mnt_root, root)) 55 40 return m; 56 41 57 42 m = next_peer(m); ··· 51 66 * 52 67 * Caller must hold namespace_sem 53 68 */ 54 - int get_dominating_id(struct vfsmount *mnt, const struct path *root) 69 + int get_dominating_id(struct mount *mnt, const struct path *root) 55 70 { 56 - struct vfsmount *m; 71 + struct mount *m; 57 72 58 73 for (m = mnt->mnt_master; m != NULL; m = m->mnt_master) { 59 - struct vfsmount *d = get_peer_under_root(m, mnt->mnt_ns, root); 74 + struct mount *d = get_peer_under_root(m, mnt->mnt_ns, root); 60 75 if (d) 61 76 return d->mnt_group_id; 62 77 } ··· 64 79 return 0; 65 80 } 66 81 67 - static int do_make_slave(struct vfsmount *mnt) 82 + static int do_make_slave(struct mount *mnt) 68 83 { 69 - struct vfsmount *peer_mnt = mnt, *master = mnt->mnt_master; 70 - struct vfsmount *slave_mnt; 84 + struct mount *peer_mnt = mnt, *master = mnt->mnt_master; 85 + struct mount *slave_mnt; 71 86 72 87 /* 73 88 * slave 'mnt' to a peer mount that has the ··· 75 90 * slave it to anything that is available. 76 91 */ 77 92 while ((peer_mnt = next_peer(peer_mnt)) != mnt && 78 - peer_mnt->mnt_root != mnt->mnt_root) ; 93 + peer_mnt->mnt.mnt_root != mnt->mnt.mnt_root) ; 79 94 80 95 if (peer_mnt == mnt) { 81 96 peer_mnt = next_peer(mnt); ··· 101 116 struct list_head *p = &mnt->mnt_slave_list; 102 117 while (!list_empty(p)) { 103 118 slave_mnt = list_first_entry(p, 104 - struct vfsmount, mnt_slave); 119 + struct mount, mnt_slave); 105 120 list_del_init(&slave_mnt->mnt_slave); 106 121 slave_mnt->mnt_master = NULL; 107 122 } ··· 114 129 /* 115 130 * vfsmount lock must be held for write 116 131 */ 117 - void change_mnt_propagation(struct vfsmount *mnt, int type) 132 + void change_mnt_propagation(struct mount *mnt, int type) 118 133 { 119 134 if (type == MS_SHARED) { 120 135 set_mnt_shared(mnt); ··· 125 140 list_del_init(&mnt->mnt_slave); 126 141 mnt->mnt_master = NULL; 127 142 if (type == MS_UNBINDABLE) 128 - mnt->mnt_flags |= MNT_UNBINDABLE; 143 + mnt->mnt.mnt_flags |= MNT_UNBINDABLE; 129 144 else 130 - mnt->mnt_flags &= ~MNT_UNBINDABLE; 145 + mnt->mnt.mnt_flags &= ~MNT_UNBINDABLE; 131 146 } 132 147 } 133 148 ··· 141 156 * vfsmount found while iterating with propagation_next() is 142 157 * a peer of one we'd found earlier. 143 158 */ 144 - static struct vfsmount *propagation_next(struct vfsmount *m, 145 - struct vfsmount *origin) 159 + static struct mount *propagation_next(struct mount *m, 160 + struct mount *origin) 146 161 { 147 162 /* are there any slaves of this mount? */ 148 163 if (!IS_MNT_NEW(m) && !list_empty(&m->mnt_slave_list)) 149 164 return first_slave(m); 150 165 151 166 while (1) { 152 - struct vfsmount *next; 153 - struct vfsmount *master = m->mnt_master; 167 + struct mount *master = m->mnt_master; 154 168 155 169 if (master == origin->mnt_master) { 156 - next = next_peer(m); 157 - return ((next == origin) ? NULL : next); 170 + struct mount *next = next_peer(m); 171 + return (next == origin) ? NULL : next; 158 172 } else if (m->mnt_slave.next != &master->mnt_slave_list) 159 173 return next_slave(m); 160 174 ··· 171 187 * @type return CL_SLAVE if the new mount has to be 172 188 * cloned as a slave. 173 189 */ 174 - static struct vfsmount *get_source(struct vfsmount *dest, 175 - struct vfsmount *last_dest, 176 - struct vfsmount *last_src, 177 - int *type) 190 + static struct mount *get_source(struct mount *dest, 191 + struct mount *last_dest, 192 + struct mount *last_src, 193 + int *type) 178 194 { 179 - struct vfsmount *p_last_src = NULL; 180 - struct vfsmount *p_last_dest = NULL; 195 + struct mount *p_last_src = NULL; 196 + struct mount *p_last_dest = NULL; 181 197 182 198 while (last_dest != dest->mnt_master) { 183 199 p_last_dest = last_dest; ··· 217 233 * @source_mnt: source mount. 218 234 * @tree_list : list of heads of trees to be attached. 219 235 */ 220 - int propagate_mnt(struct vfsmount *dest_mnt, struct dentry *dest_dentry, 221 - struct vfsmount *source_mnt, struct list_head *tree_list) 236 + int propagate_mnt(struct mount *dest_mnt, struct dentry *dest_dentry, 237 + struct mount *source_mnt, struct list_head *tree_list) 222 238 { 223 - struct vfsmount *m, *child; 239 + struct mount *m, *child; 224 240 int ret = 0; 225 - struct vfsmount *prev_dest_mnt = dest_mnt; 226 - struct vfsmount *prev_src_mnt = source_mnt; 241 + struct mount *prev_dest_mnt = dest_mnt; 242 + struct mount *prev_src_mnt = source_mnt; 227 243 LIST_HEAD(tmp_list); 228 244 LIST_HEAD(umount_list); 229 245 230 246 for (m = propagation_next(dest_mnt, dest_mnt); m; 231 247 m = propagation_next(m, dest_mnt)) { 232 248 int type; 233 - struct vfsmount *source; 249 + struct mount *source; 234 250 235 251 if (IS_MNT_NEW(m)) 236 252 continue; 237 253 238 254 source = get_source(m, prev_dest_mnt, prev_src_mnt, &type); 239 255 240 - if (!(child = copy_tree(source, source->mnt_root, type))) { 256 + if (!(child = copy_tree(source, source->mnt.mnt_root, type))) { 241 257 ret = -ENOMEM; 242 258 list_splice(tree_list, tmp_list.prev); 243 259 goto out; 244 260 } 245 261 246 - if (is_subdir(dest_dentry, m->mnt_root)) { 262 + if (is_subdir(dest_dentry, m->mnt.mnt_root)) { 247 263 mnt_set_mountpoint(m, dest_dentry, child); 248 264 list_add_tail(&child->mnt_hash, tree_list); 249 265 } else { ··· 259 275 out: 260 276 br_write_lock(vfsmount_lock); 261 277 while (!list_empty(&tmp_list)) { 262 - child = list_first_entry(&tmp_list, struct vfsmount, mnt_hash); 278 + child = list_first_entry(&tmp_list, struct mount, mnt_hash); 263 279 umount_tree(child, 0, &umount_list); 264 280 } 265 281 br_write_unlock(vfsmount_lock); ··· 270 286 /* 271 287 * return true if the refcount is greater than count 272 288 */ 273 - static inline int do_refcount_check(struct vfsmount *mnt, int count) 289 + static inline int do_refcount_check(struct mount *mnt, int count) 274 290 { 275 291 int mycount = mnt_get_count(mnt) - mnt->mnt_ghosts; 276 292 return (mycount > count); ··· 286 302 * 287 303 * vfsmount lock must be held for write 288 304 */ 289 - int propagate_mount_busy(struct vfsmount *mnt, int refcnt) 305 + int propagate_mount_busy(struct mount *mnt, int refcnt) 290 306 { 291 - struct vfsmount *m, *child; 292 - struct vfsmount *parent = mnt->mnt_parent; 307 + struct mount *m, *child; 308 + struct mount *parent = mnt->mnt_parent; 293 309 int ret = 0; 294 310 295 311 if (mnt == parent) ··· 305 321 306 322 for (m = propagation_next(parent, parent); m; 307 323 m = propagation_next(m, parent)) { 308 - child = __lookup_mnt(m, mnt->mnt_mountpoint, 0); 324 + child = __lookup_mnt(&m->mnt, mnt->mnt_mountpoint, 0); 309 325 if (child && list_empty(&child->mnt_mounts) && 310 326 (ret = do_refcount_check(child, 1))) 311 327 break; ··· 317 333 * NOTE: unmounting 'mnt' naturally propagates to all other mounts its 318 334 * parent propagates to. 319 335 */ 320 - static void __propagate_umount(struct vfsmount *mnt) 336 + static void __propagate_umount(struct mount *mnt) 321 337 { 322 - struct vfsmount *parent = mnt->mnt_parent; 323 - struct vfsmount *m; 338 + struct mount *parent = mnt->mnt_parent; 339 + struct mount *m; 324 340 325 341 BUG_ON(parent == mnt); 326 342 327 343 for (m = propagation_next(parent, parent); m; 328 344 m = propagation_next(m, parent)) { 329 345 330 - struct vfsmount *child = __lookup_mnt(m, 346 + struct mount *child = __lookup_mnt(&m->mnt, 331 347 mnt->mnt_mountpoint, 0); 332 348 /* 333 349 * umount the child only if the child has no ··· 347 363 */ 348 364 int propagate_umount(struct list_head *list) 349 365 { 350 - struct vfsmount *mnt; 366 + struct mount *mnt; 351 367 352 368 list_for_each_entry(mnt, list, mnt_hash) 353 369 __propagate_umount(mnt);
+22 -14
fs/pnode.h
··· 9 9 #define _LINUX_PNODE_H 10 10 11 11 #include <linux/list.h> 12 - #include <linux/mount.h> 12 + #include "mount.h" 13 13 14 - #define IS_MNT_SHARED(mnt) (mnt->mnt_flags & MNT_SHARED) 15 - #define IS_MNT_SLAVE(mnt) (mnt->mnt_master) 16 - #define IS_MNT_NEW(mnt) (!mnt->mnt_ns) 17 - #define CLEAR_MNT_SHARED(mnt) (mnt->mnt_flags &= ~MNT_SHARED) 18 - #define IS_MNT_UNBINDABLE(mnt) (mnt->mnt_flags & MNT_UNBINDABLE) 14 + #define IS_MNT_SHARED(m) ((m)->mnt.mnt_flags & MNT_SHARED) 15 + #define IS_MNT_SLAVE(m) ((m)->mnt_master) 16 + #define IS_MNT_NEW(m) (!(m)->mnt_ns) 17 + #define CLEAR_MNT_SHARED(m) ((m)->mnt.mnt_flags &= ~MNT_SHARED) 18 + #define IS_MNT_UNBINDABLE(m) ((m)->mnt.mnt_flags & MNT_UNBINDABLE) 19 19 20 20 #define CL_EXPIRE 0x01 21 21 #define CL_SLAVE 0x02 ··· 23 23 #define CL_MAKE_SHARED 0x08 24 24 #define CL_PRIVATE 0x10 25 25 26 - static inline void set_mnt_shared(struct vfsmount *mnt) 26 + static inline void set_mnt_shared(struct mount *mnt) 27 27 { 28 - mnt->mnt_flags &= ~MNT_SHARED_MASK; 29 - mnt->mnt_flags |= MNT_SHARED; 28 + mnt->mnt.mnt_flags &= ~MNT_SHARED_MASK; 29 + mnt->mnt.mnt_flags |= MNT_SHARED; 30 30 } 31 31 32 - void change_mnt_propagation(struct vfsmount *, int); 33 - int propagate_mnt(struct vfsmount *, struct dentry *, struct vfsmount *, 32 + void change_mnt_propagation(struct mount *, int); 33 + int propagate_mnt(struct mount *, struct dentry *, struct mount *, 34 34 struct list_head *); 35 35 int propagate_umount(struct list_head *); 36 - int propagate_mount_busy(struct vfsmount *, int); 37 - void mnt_release_group_id(struct vfsmount *); 38 - int get_dominating_id(struct vfsmount *mnt, const struct path *root); 36 + int propagate_mount_busy(struct mount *, int); 37 + void mnt_release_group_id(struct mount *); 38 + int get_dominating_id(struct mount *mnt, const struct path *root); 39 + unsigned int mnt_get_count(struct mount *mnt); 40 + void mnt_set_mountpoint(struct mount *, struct dentry *, 41 + struct mount *); 42 + void release_mounts(struct list_head *); 43 + void umount_tree(struct mount *, int, struct list_head *); 44 + struct mount *copy_tree(struct mount *, struct dentry *, int); 45 + bool is_path_reachable(struct mount *, struct dentry *, 46 + const struct path *root); 39 47 #endif /* _LINUX_PNODE_H */
+1 -115
fs/proc/base.c
··· 101 101 struct pid_entry { 102 102 char *name; 103 103 int len; 104 - mode_t mode; 104 + umode_t mode; 105 105 const struct inode_operations *iop; 106 106 const struct file_operations *fop; 107 107 union proc_op op; ··· 629 629 630 630 static const struct inode_operations proc_def_inode_operations = { 631 631 .setattr = proc_setattr, 632 - }; 633 - 634 - static int mounts_open_common(struct inode *inode, struct file *file, 635 - const struct seq_operations *op) 636 - { 637 - struct task_struct *task = get_proc_task(inode); 638 - struct nsproxy *nsp; 639 - struct mnt_namespace *ns = NULL; 640 - struct path root; 641 - struct proc_mounts *p; 642 - int ret = -EINVAL; 643 - 644 - if (task) { 645 - rcu_read_lock(); 646 - nsp = task_nsproxy(task); 647 - if (nsp) { 648 - ns = nsp->mnt_ns; 649 - if (ns) 650 - get_mnt_ns(ns); 651 - } 652 - rcu_read_unlock(); 653 - if (ns && get_task_root(task, &root) == 0) 654 - ret = 0; 655 - put_task_struct(task); 656 - } 657 - 658 - if (!ns) 659 - goto err; 660 - if (ret) 661 - goto err_put_ns; 662 - 663 - ret = -ENOMEM; 664 - p = kmalloc(sizeof(struct proc_mounts), GFP_KERNEL); 665 - if (!p) 666 - goto err_put_path; 667 - 668 - file->private_data = &p->m; 669 - ret = seq_open(file, op); 670 - if (ret) 671 - goto err_free; 672 - 673 - p->m.private = p; 674 - p->ns = ns; 675 - p->root = root; 676 - p->m.poll_event = ns->event; 677 - 678 - return 0; 679 - 680 - err_free: 681 - kfree(p); 682 - err_put_path: 683 - path_put(&root); 684 - err_put_ns: 685 - put_mnt_ns(ns); 686 - err: 687 - return ret; 688 - } 689 - 690 - static int mounts_release(struct inode *inode, struct file *file) 691 - { 692 - struct proc_mounts *p = file->private_data; 693 - path_put(&p->root); 694 - put_mnt_ns(p->ns); 695 - return seq_release(inode, file); 696 - } 697 - 698 - static unsigned mounts_poll(struct file *file, poll_table *wait) 699 - { 700 - struct proc_mounts *p = file->private_data; 701 - unsigned res = POLLIN | POLLRDNORM; 702 - 703 - poll_wait(file, &p->ns->poll, wait); 704 - if (mnt_had_events(p)) 705 - res |= POLLERR | POLLPRI; 706 - 707 - return res; 708 - } 709 - 710 - static int mounts_open(struct inode *inode, struct file *file) 711 - { 712 - return mounts_open_common(inode, file, &mounts_op); 713 - } 714 - 715 - static const struct file_operations proc_mounts_operations = { 716 - .open = mounts_open, 717 - .read = seq_read, 718 - .llseek = seq_lseek, 719 - .release = mounts_release, 720 - .poll = mounts_poll, 721 - }; 722 - 723 - static int mountinfo_open(struct inode *inode, struct file *file) 724 - { 725 - return mounts_open_common(inode, file, &mountinfo_op); 726 - } 727 - 728 - static const struct file_operations proc_mountinfo_operations = { 729 - .open = mountinfo_open, 730 - .read = seq_read, 731 - .llseek = seq_lseek, 732 - .release = mounts_release, 733 - .poll = mounts_poll, 734 - }; 735 - 736 - static int mountstats_open(struct inode *inode, struct file *file) 737 - { 738 - return mounts_open_common(inode, file, &mountstats_op); 739 - } 740 - 741 - static const struct file_operations proc_mountstats_operations = { 742 - .open = mountstats_open, 743 - .read = seq_read, 744 - .llseek = seq_lseek, 745 - .release = mounts_release, 746 632 }; 747 633 748 634 #define PROC_BLOCK_SIZE (3*1024) /* 4K page size but our output routines use some slack for overruns */
+4 -4
fs/proc/generic.c
··· 597 597 598 598 static struct proc_dir_entry *__proc_create(struct proc_dir_entry **parent, 599 599 const char *name, 600 - mode_t mode, 600 + umode_t mode, 601 601 nlink_t nlink) 602 602 { 603 603 struct proc_dir_entry *ent = NULL; ··· 659 659 } 660 660 EXPORT_SYMBOL(proc_symlink); 661 661 662 - struct proc_dir_entry *proc_mkdir_mode(const char *name, mode_t mode, 662 + struct proc_dir_entry *proc_mkdir_mode(const char *name, umode_t mode, 663 663 struct proc_dir_entry *parent) 664 664 { 665 665 struct proc_dir_entry *ent; ··· 699 699 } 700 700 EXPORT_SYMBOL(proc_mkdir); 701 701 702 - struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, 702 + struct proc_dir_entry *create_proc_entry(const char *name, umode_t mode, 703 703 struct proc_dir_entry *parent) 704 704 { 705 705 struct proc_dir_entry *ent; ··· 728 728 } 729 729 EXPORT_SYMBOL(create_proc_entry); 730 730 731 - struct proc_dir_entry *proc_create_data(const char *name, mode_t mode, 731 + struct proc_dir_entry *proc_create_data(const char *name, umode_t mode, 732 732 struct proc_dir_entry *parent, 733 733 const struct file_operations *proc_fops, 734 734 void *data)
-1
fs/proc/inode.c
··· 77 77 static void proc_i_callback(struct rcu_head *head) 78 78 { 79 79 struct inode *inode = container_of(head, struct inode, i_rcu); 80 - INIT_LIST_HEAD(&inode->i_dentry); 81 80 kmem_cache_free(proc_inode_cachep, PROC_I(inode)); 82 81 } 83 82
-1
fs/proc/namespaces.c
··· 9 9 #include <linux/file.h> 10 10 #include <linux/utsname.h> 11 11 #include <net/net_namespace.h> 12 - #include <linux/mnt_namespace.h> 13 12 #include <linux/ipc_namespace.h> 14 13 #include <linux/pid_namespace.h> 15 14 #include "internal.h"
+1 -1
fs/proc/proc_net.c
··· 179 179 180 180 181 181 struct proc_dir_entry *proc_net_fops_create(struct net *net, 182 - const char *name, mode_t mode, const struct file_operations *fops) 182 + const char *name, umode_t mode, const struct file_operations *fops) 183 183 { 184 184 return proc_create(name, mode, net->proc_net, fops); 185 185 }
+333
fs/proc_namespace.c
··· 1 + /* 2 + * fs/proc_namespace.c - handling of /proc/<pid>/{mounts,mountinfo,mountstats} 3 + * 4 + * In fact, that's a piece of procfs; it's *almost* isolated from 5 + * the rest of fs/proc, but has rather close relationships with 6 + * fs/namespace.c, thus here instead of fs/proc 7 + * 8 + */ 9 + #include <linux/mnt_namespace.h> 10 + #include <linux/nsproxy.h> 11 + #include <linux/security.h> 12 + #include <linux/fs_struct.h> 13 + #include "proc/internal.h" /* only for get_proc_task() in ->open() */ 14 + 15 + #include "pnode.h" 16 + #include "internal.h" 17 + 18 + static unsigned mounts_poll(struct file *file, poll_table *wait) 19 + { 20 + struct proc_mounts *p = file->private_data; 21 + struct mnt_namespace *ns = p->ns; 22 + unsigned res = POLLIN | POLLRDNORM; 23 + 24 + poll_wait(file, &p->ns->poll, wait); 25 + 26 + br_read_lock(vfsmount_lock); 27 + if (p->m.poll_event != ns->event) { 28 + p->m.poll_event = ns->event; 29 + res |= POLLERR | POLLPRI; 30 + } 31 + br_read_unlock(vfsmount_lock); 32 + 33 + return res; 34 + } 35 + 36 + struct proc_fs_info { 37 + int flag; 38 + const char *str; 39 + }; 40 + 41 + static int show_sb_opts(struct seq_file *m, struct super_block *sb) 42 + { 43 + static const struct proc_fs_info fs_info[] = { 44 + { MS_SYNCHRONOUS, ",sync" }, 45 + { MS_DIRSYNC, ",dirsync" }, 46 + { MS_MANDLOCK, ",mand" }, 47 + { 0, NULL } 48 + }; 49 + const struct proc_fs_info *fs_infop; 50 + 51 + for (fs_infop = fs_info; fs_infop->flag; fs_infop++) { 52 + if (sb->s_flags & fs_infop->flag) 53 + seq_puts(m, fs_infop->str); 54 + } 55 + 56 + return security_sb_show_options(m, sb); 57 + } 58 + 59 + static void show_mnt_opts(struct seq_file *m, struct vfsmount *mnt) 60 + { 61 + static const struct proc_fs_info mnt_info[] = { 62 + { MNT_NOSUID, ",nosuid" }, 63 + { MNT_NODEV, ",nodev" }, 64 + { MNT_NOEXEC, ",noexec" }, 65 + { MNT_NOATIME, ",noatime" }, 66 + { MNT_NODIRATIME, ",nodiratime" }, 67 + { MNT_RELATIME, ",relatime" }, 68 + { 0, NULL } 69 + }; 70 + const struct proc_fs_info *fs_infop; 71 + 72 + for (fs_infop = mnt_info; fs_infop->flag; fs_infop++) { 73 + if (mnt->mnt_flags & fs_infop->flag) 74 + seq_puts(m, fs_infop->str); 75 + } 76 + } 77 + 78 + static inline void mangle(struct seq_file *m, const char *s) 79 + { 80 + seq_escape(m, s, " \t\n\\"); 81 + } 82 + 83 + static void show_type(struct seq_file *m, struct super_block *sb) 84 + { 85 + mangle(m, sb->s_type->name); 86 + if (sb->s_subtype && sb->s_subtype[0]) { 87 + seq_putc(m, '.'); 88 + mangle(m, sb->s_subtype); 89 + } 90 + } 91 + 92 + static int show_vfsmnt(struct seq_file *m, struct vfsmount *mnt) 93 + { 94 + struct mount *r = real_mount(mnt); 95 + int err = 0; 96 + struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; 97 + struct super_block *sb = mnt_path.dentry->d_sb; 98 + 99 + if (sb->s_op->show_devname) { 100 + err = sb->s_op->show_devname(m, mnt_path.dentry); 101 + if (err) 102 + goto out; 103 + } else { 104 + mangle(m, r->mnt_devname ? r->mnt_devname : "none"); 105 + } 106 + seq_putc(m, ' '); 107 + seq_path(m, &mnt_path, " \t\n\\"); 108 + seq_putc(m, ' '); 109 + show_type(m, sb); 110 + seq_puts(m, __mnt_is_readonly(mnt) ? " ro" : " rw"); 111 + err = show_sb_opts(m, sb); 112 + if (err) 113 + goto out; 114 + show_mnt_opts(m, mnt); 115 + if (sb->s_op->show_options) 116 + err = sb->s_op->show_options(m, mnt_path.dentry); 117 + seq_puts(m, " 0 0\n"); 118 + out: 119 + return err; 120 + } 121 + 122 + static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt) 123 + { 124 + struct proc_mounts *p = m->private; 125 + struct mount *r = real_mount(mnt); 126 + struct super_block *sb = mnt->mnt_sb; 127 + struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; 128 + struct path root = p->root; 129 + int err = 0; 130 + 131 + seq_printf(m, "%i %i %u:%u ", r->mnt_id, r->mnt_parent->mnt_id, 132 + MAJOR(sb->s_dev), MINOR(sb->s_dev)); 133 + if (sb->s_op->show_path) 134 + err = sb->s_op->show_path(m, mnt->mnt_root); 135 + else 136 + seq_dentry(m, mnt->mnt_root, " \t\n\\"); 137 + if (err) 138 + goto out; 139 + seq_putc(m, ' '); 140 + 141 + /* mountpoints outside of chroot jail will give SEQ_SKIP on this */ 142 + err = seq_path_root(m, &mnt_path, &root, " \t\n\\"); 143 + if (err) 144 + goto out; 145 + 146 + seq_puts(m, mnt->mnt_flags & MNT_READONLY ? " ro" : " rw"); 147 + show_mnt_opts(m, mnt); 148 + 149 + /* Tagged fields ("foo:X" or "bar") */ 150 + if (IS_MNT_SHARED(r)) 151 + seq_printf(m, " shared:%i", r->mnt_group_id); 152 + if (IS_MNT_SLAVE(r)) { 153 + int master = r->mnt_master->mnt_group_id; 154 + int dom = get_dominating_id(r, &p->root); 155 + seq_printf(m, " master:%i", master); 156 + if (dom && dom != master) 157 + seq_printf(m, " propagate_from:%i", dom); 158 + } 159 + if (IS_MNT_UNBINDABLE(r)) 160 + seq_puts(m, " unbindable"); 161 + 162 + /* Filesystem specific data */ 163 + seq_puts(m, " - "); 164 + show_type(m, sb); 165 + seq_putc(m, ' '); 166 + if (sb->s_op->show_devname) 167 + err = sb->s_op->show_devname(m, mnt->mnt_root); 168 + else 169 + mangle(m, r->mnt_devname ? r->mnt_devname : "none"); 170 + if (err) 171 + goto out; 172 + seq_puts(m, sb->s_flags & MS_RDONLY ? " ro" : " rw"); 173 + err = show_sb_opts(m, sb); 174 + if (err) 175 + goto out; 176 + if (sb->s_op->show_options) 177 + err = sb->s_op->show_options(m, mnt->mnt_root); 178 + seq_putc(m, '\n'); 179 + out: 180 + return err; 181 + } 182 + 183 + static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt) 184 + { 185 + struct mount *r = real_mount(mnt); 186 + struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; 187 + struct super_block *sb = mnt_path.dentry->d_sb; 188 + int err = 0; 189 + 190 + /* device */ 191 + if (sb->s_op->show_devname) { 192 + seq_puts(m, "device "); 193 + err = sb->s_op->show_devname(m, mnt_path.dentry); 194 + } else { 195 + if (r->mnt_devname) { 196 + seq_puts(m, "device "); 197 + mangle(m, r->mnt_devname); 198 + } else 199 + seq_puts(m, "no device"); 200 + } 201 + 202 + /* mount point */ 203 + seq_puts(m, " mounted on "); 204 + seq_path(m, &mnt_path, " \t\n\\"); 205 + seq_putc(m, ' '); 206 + 207 + /* file system type */ 208 + seq_puts(m, "with fstype "); 209 + show_type(m, sb); 210 + 211 + /* optional statistics */ 212 + if (sb->s_op->show_stats) { 213 + seq_putc(m, ' '); 214 + if (!err) 215 + err = sb->s_op->show_stats(m, mnt_path.dentry); 216 + } 217 + 218 + seq_putc(m, '\n'); 219 + return err; 220 + } 221 + 222 + static int mounts_open_common(struct inode *inode, struct file *file, 223 + int (*show)(struct seq_file *, struct vfsmount *)) 224 + { 225 + struct task_struct *task = get_proc_task(inode); 226 + struct nsproxy *nsp; 227 + struct mnt_namespace *ns = NULL; 228 + struct path root; 229 + struct proc_mounts *p; 230 + int ret = -EINVAL; 231 + 232 + if (!task) 233 + goto err; 234 + 235 + rcu_read_lock(); 236 + nsp = task_nsproxy(task); 237 + if (!nsp) { 238 + rcu_read_unlock(); 239 + put_task_struct(task); 240 + goto err; 241 + } 242 + ns = nsp->mnt_ns; 243 + if (!ns) { 244 + rcu_read_unlock(); 245 + put_task_struct(task); 246 + goto err; 247 + } 248 + get_mnt_ns(ns); 249 + rcu_read_unlock(); 250 + task_lock(task); 251 + if (!task->fs) { 252 + task_unlock(task); 253 + put_task_struct(task); 254 + ret = -ENOENT; 255 + goto err_put_ns; 256 + } 257 + get_fs_root(task->fs, &root); 258 + task_unlock(task); 259 + put_task_struct(task); 260 + 261 + ret = -ENOMEM; 262 + p = kmalloc(sizeof(struct proc_mounts), GFP_KERNEL); 263 + if (!p) 264 + goto err_put_path; 265 + 266 + file->private_data = &p->m; 267 + ret = seq_open(file, &mounts_op); 268 + if (ret) 269 + goto err_free; 270 + 271 + p->m.private = p; 272 + p->ns = ns; 273 + p->root = root; 274 + p->m.poll_event = ns->event; 275 + p->show = show; 276 + 277 + return 0; 278 + 279 + err_free: 280 + kfree(p); 281 + err_put_path: 282 + path_put(&root); 283 + err_put_ns: 284 + put_mnt_ns(ns); 285 + err: 286 + return ret; 287 + } 288 + 289 + static int mounts_release(struct inode *inode, struct file *file) 290 + { 291 + struct proc_mounts *p = file->private_data; 292 + path_put(&p->root); 293 + put_mnt_ns(p->ns); 294 + return seq_release(inode, file); 295 + } 296 + 297 + static int mounts_open(struct inode *inode, struct file *file) 298 + { 299 + return mounts_open_common(inode, file, show_vfsmnt); 300 + } 301 + 302 + static int mountinfo_open(struct inode *inode, struct file *file) 303 + { 304 + return mounts_open_common(inode, file, show_mountinfo); 305 + } 306 + 307 + static int mountstats_open(struct inode *inode, struct file *file) 308 + { 309 + return mounts_open_common(inode, file, show_vfsstat); 310 + } 311 + 312 + const struct file_operations proc_mounts_operations = { 313 + .open = mounts_open, 314 + .read = seq_read, 315 + .llseek = seq_lseek, 316 + .release = mounts_release, 317 + .poll = mounts_poll, 318 + }; 319 + 320 + const struct file_operations proc_mountinfo_operations = { 321 + .open = mountinfo_open, 322 + .read = seq_read, 323 + .llseek = seq_lseek, 324 + .release = mounts_release, 325 + .poll = mounts_poll, 326 + }; 327 + 328 + const struct file_operations proc_mountstats_operations = { 329 + .open = mountstats_open, 330 + .read = seq_read, 331 + .llseek = seq_lseek, 332 + .release = mounts_release, 333 + };
-1
fs/qnx4/inode.c
··· 427 427 static void qnx4_i_callback(struct rcu_head *head) 428 428 { 429 429 struct inode *inode = container_of(head, struct inode, i_rcu); 430 - INIT_LIST_HEAD(&inode->i_dentry); 431 430 kmem_cache_free(qnx4_inode_cachep, qnx4_i(inode)); 432 431 } 433 432
+1 -2
fs/quota/dquot.c
··· 73 73 #include <linux/security.h> 74 74 #include <linux/kmod.h> 75 75 #include <linux/namei.h> 76 - #include <linux/buffer_head.h> 77 76 #include <linux/capability.h> 78 77 #include <linux/quotaops.h> 79 78 #include "../internal.h" /* ugh */ ··· 2198 2199 if (error) 2199 2200 return error; 2200 2201 /* Quota file not on the same filesystem? */ 2201 - if (path->mnt->mnt_sb != sb) 2202 + if (path->dentry->d_sb != sb) 2202 2203 error = -EXDEV; 2203 2204 else 2204 2205 error = vfs_load_quota_inode(path->dentry->d_inode, type,
-1
fs/quota/quota.c
··· 13 13 #include <linux/kernel.h> 14 14 #include <linux/security.h> 15 15 #include <linux/syscalls.h> 16 - #include <linux/buffer_head.h> 17 16 #include <linux/capability.h> 18 17 #include <linux/quotaops.h> 19 18 #include <linux/types.h>
+4 -4
fs/ramfs/inode.c
··· 52 52 }; 53 53 54 54 struct inode *ramfs_get_inode(struct super_block *sb, 55 - const struct inode *dir, int mode, dev_t dev) 55 + const struct inode *dir, umode_t mode, dev_t dev) 56 56 { 57 57 struct inode * inode = new_inode(sb); 58 58 ··· 92 92 */ 93 93 /* SMP-safe */ 94 94 static int 95 - ramfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev) 95 + ramfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) 96 96 { 97 97 struct inode * inode = ramfs_get_inode(dir->i_sb, dir, mode, dev); 98 98 int error = -ENOSPC; ··· 106 106 return error; 107 107 } 108 108 109 - static int ramfs_mkdir(struct inode * dir, struct dentry * dentry, int mode) 109 + static int ramfs_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode) 110 110 { 111 111 int retval = ramfs_mknod(dir, dentry, mode | S_IFDIR, 0); 112 112 if (!retval) ··· 114 114 return retval; 115 115 } 116 116 117 - static int ramfs_create(struct inode *dir, struct dentry *dentry, int mode, struct nameidata *nd) 117 + static int ramfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *nd) 118 118 { 119 119 return ramfs_mknod(dir, dentry, mode | S_IFREG, 0); 120 120 }
+91
fs/reiserfs/bitmap.c
··· 13 13 #include <linux/reiserfs_fs_sb.h> 14 14 #include <linux/reiserfs_fs_i.h> 15 15 #include <linux/quotaops.h> 16 + #include <linux/seq_file.h> 16 17 17 18 #define PREALLOCATION_SIZE 9 18 19 ··· 633 632 634 633 reiserfs_info(s, "allocator options = [%08x]\n", SB_ALLOC_OPTS(s)); 635 634 return 0; 635 + } 636 + 637 + static void print_sep(struct seq_file *seq, int *first) 638 + { 639 + if (!*first) 640 + seq_puts(seq, ":"); 641 + else 642 + *first = 0; 643 + } 644 + 645 + void show_alloc_options(struct seq_file *seq, struct super_block *s) 646 + { 647 + int first = 1; 648 + 649 + if (SB_ALLOC_OPTS(s) == ((1 << _ALLOC_skip_busy) | 650 + (1 << _ALLOC_dirid_groups) | (1 << _ALLOC_packing_groups))) 651 + return; 652 + 653 + seq_puts(seq, ",alloc="); 654 + 655 + if (TEST_OPTION(concentrating_formatted_nodes, s)) { 656 + print_sep(seq, &first); 657 + if (REISERFS_SB(s)->s_alloc_options.border != 10) { 658 + seq_printf(seq, "concentrating_formatted_nodes=%d", 659 + 100 / REISERFS_SB(s)->s_alloc_options.border); 660 + } else 661 + seq_puts(seq, "concentrating_formatted_nodes"); 662 + } 663 + if (TEST_OPTION(displacing_large_files, s)) { 664 + print_sep(seq, &first); 665 + if (REISERFS_SB(s)->s_alloc_options.large_file_size != 16) { 666 + seq_printf(seq, "displacing_large_files=%lu", 667 + REISERFS_SB(s)->s_alloc_options.large_file_size); 668 + } else 669 + seq_puts(seq, "displacing_large_files"); 670 + } 671 + if (TEST_OPTION(displacing_new_packing_localities, s)) { 672 + print_sep(seq, &first); 673 + seq_puts(seq, "displacing_new_packing_localities"); 674 + } 675 + if (TEST_OPTION(old_hashed_relocation, s)) { 676 + print_sep(seq, &first); 677 + seq_puts(seq, "old_hashed_relocation"); 678 + } 679 + if (TEST_OPTION(new_hashed_relocation, s)) { 680 + print_sep(seq, &first); 681 + seq_puts(seq, "new_hashed_relocation"); 682 + } 683 + if (TEST_OPTION(dirid_groups, s)) { 684 + print_sep(seq, &first); 685 + seq_puts(seq, "dirid_groups"); 686 + } 687 + if (TEST_OPTION(oid_groups, s)) { 688 + print_sep(seq, &first); 689 + seq_puts(seq, "oid_groups"); 690 + } 691 + if (TEST_OPTION(packing_groups, s)) { 692 + print_sep(seq, &first); 693 + seq_puts(seq, "packing_groups"); 694 + } 695 + if (TEST_OPTION(hashed_formatted_nodes, s)) { 696 + print_sep(seq, &first); 697 + seq_puts(seq, "hashed_formatted_nodes"); 698 + } 699 + if (TEST_OPTION(skip_busy, s)) { 700 + print_sep(seq, &first); 701 + seq_puts(seq, "skip_busy"); 702 + } 703 + if (TEST_OPTION(hundredth_slices, s)) { 704 + print_sep(seq, &first); 705 + seq_puts(seq, "hundredth_slices"); 706 + } 707 + if (TEST_OPTION(old_way, s)) { 708 + print_sep(seq, &first); 709 + seq_puts(seq, "old_way"); 710 + } 711 + if (TEST_OPTION(displace_based_on_dirid, s)) { 712 + print_sep(seq, &first); 713 + seq_puts(seq, "displace_based_on_dirid"); 714 + } 715 + if (REISERFS_SB(s)->s_alloc_options.preallocmin != 0) { 716 + print_sep(seq, &first); 717 + seq_printf(seq, "preallocmin=%d", 718 + REISERFS_SB(s)->s_alloc_options.preallocmin); 719 + } 720 + if (REISERFS_SB(s)->s_alloc_options.preallocsize != 17) { 721 + print_sep(seq, &first); 722 + seq_printf(seq, "preallocsize=%d", 723 + REISERFS_SB(s)->s_alloc_options.preallocsize); 724 + } 636 725 } 637 726 638 727 static inline void new_hashed_relocation(reiserfs_blocknr_hint_t * hint)
+1 -1
fs/reiserfs/inode.c
··· 1766 1766 for the fresh inode. This can only be done outside a transaction, so 1767 1767 if we return non-zero, we also end the transaction. */ 1768 1768 int reiserfs_new_inode(struct reiserfs_transaction_handle *th, 1769 - struct inode *dir, int mode, const char *symname, 1769 + struct inode *dir, umode_t mode, const char *symname, 1770 1770 /* 0 for regular, EMTRY_DIR_SIZE for dirs, 1771 1771 strlen (symname) for symlinks) */ 1772 1772 loff_t i_size, struct dentry *dentry,
+4 -4
fs/reiserfs/ioctl.c
··· 55 55 break; 56 56 } 57 57 58 - err = mnt_want_write(filp->f_path.mnt); 58 + err = mnt_want_write_file(filp); 59 59 if (err) 60 60 break; 61 61 ··· 96 96 inode->i_ctime = CURRENT_TIME_SEC; 97 97 mark_inode_dirty(inode); 98 98 setflags_out: 99 - mnt_drop_write(filp->f_path.mnt); 99 + mnt_drop_write_file(filp); 100 100 break; 101 101 } 102 102 case REISERFS_IOC_GETVERSION: ··· 107 107 err = -EPERM; 108 108 break; 109 109 } 110 - err = mnt_want_write(filp->f_path.mnt); 110 + err = mnt_want_write_file(filp); 111 111 if (err) 112 112 break; 113 113 if (get_user(inode->i_generation, (int __user *)arg)) { ··· 117 117 inode->i_ctime = CURRENT_TIME_SEC; 118 118 mark_inode_dirty(inode); 119 119 setversion_out: 120 - mnt_drop_write(filp->f_path.mnt); 120 + mnt_drop_write_file(filp); 121 121 break; 122 122 default: 123 123 err = -ENOTTY;
+4 -4
fs/reiserfs/namei.c
··· 559 559 ** outside of a transaction, so we had to pull some bits of 560 560 ** reiserfs_new_inode out into this func. 561 561 */ 562 - static int new_inode_init(struct inode *inode, struct inode *dir, int mode) 562 + static int new_inode_init(struct inode *inode, struct inode *dir, umode_t mode) 563 563 { 564 564 /* Make inode invalid - just in case we are going to drop it before 565 565 * the initialization happens */ ··· 572 572 return 0; 573 573 } 574 574 575 - static int reiserfs_create(struct inode *dir, struct dentry *dentry, int mode, 575 + static int reiserfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 576 576 struct nameidata *nd) 577 577 { 578 578 int retval; ··· 643 643 return retval; 644 644 } 645 645 646 - static int reiserfs_mknod(struct inode *dir, struct dentry *dentry, int mode, 646 + static int reiserfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, 647 647 dev_t rdev) 648 648 { 649 649 int retval; ··· 721 721 return retval; 722 722 } 723 723 724 - static int reiserfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 724 + static int reiserfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 725 725 { 726 726 int retval; 727 727 struct inode *inode;
+107 -12
fs/reiserfs/super.c
··· 28 28 #include <linux/mount.h> 29 29 #include <linux/namei.h> 30 30 #include <linux/crc32.h> 31 + #include <linux/seq_file.h> 31 32 32 33 struct file_system_type reiserfs_fs_type; 33 34 ··· 62 61 63 62 static int reiserfs_remount(struct super_block *s, int *flags, char *data); 64 63 static int reiserfs_statfs(struct dentry *dentry, struct kstatfs *buf); 64 + void show_alloc_options(struct seq_file *seq, struct super_block *s); 65 65 66 66 static int reiserfs_sync_fs(struct super_block *s, int wait) 67 67 { ··· 534 532 static void reiserfs_i_callback(struct rcu_head *head) 535 533 { 536 534 struct inode *inode = container_of(head, struct inode, i_rcu); 537 - INIT_LIST_HEAD(&inode->i_dentry); 538 535 kmem_cache_free(reiserfs_inode_cachep, REISERFS_I(inode)); 539 536 } 540 537 ··· 598 597 reiserfs_write_unlock_once(inode->i_sb, lock_depth); 599 598 } 600 599 600 + static int reiserfs_show_options(struct seq_file *seq, struct dentry *root) 601 + { 602 + struct super_block *s = root->d_sb; 603 + struct reiserfs_journal *journal = SB_JOURNAL(s); 604 + long opts = REISERFS_SB(s)->s_mount_opt; 605 + 606 + if (opts & (1 << REISERFS_LARGETAIL)) 607 + seq_puts(seq, ",tails=on"); 608 + else if (!(opts & (1 << REISERFS_SMALLTAIL))) 609 + seq_puts(seq, ",notail"); 610 + /* tails=small is default so we don't show it */ 611 + 612 + if (!(opts & (1 << REISERFS_BARRIER_FLUSH))) 613 + seq_puts(seq, ",barrier=none"); 614 + /* barrier=flush is default so we don't show it */ 615 + 616 + if (opts & (1 << REISERFS_ERROR_CONTINUE)) 617 + seq_puts(seq, ",errors=continue"); 618 + else if (opts & (1 << REISERFS_ERROR_PANIC)) 619 + seq_puts(seq, ",errors=panic"); 620 + /* errors=ro is default so we don't show it */ 621 + 622 + if (opts & (1 << REISERFS_DATA_LOG)) 623 + seq_puts(seq, ",data=journal"); 624 + else if (opts & (1 << REISERFS_DATA_WRITEBACK)) 625 + seq_puts(seq, ",data=writeback"); 626 + /* data=ordered is default so we don't show it */ 627 + 628 + if (opts & (1 << REISERFS_ATTRS)) 629 + seq_puts(seq, ",attrs"); 630 + 631 + if (opts & (1 << REISERFS_XATTRS_USER)) 632 + seq_puts(seq, ",user_xattr"); 633 + 634 + if (opts & (1 << REISERFS_EXPOSE_PRIVROOT)) 635 + seq_puts(seq, ",expose_privroot"); 636 + 637 + if (opts & (1 << REISERFS_POSIXACL)) 638 + seq_puts(seq, ",acl"); 639 + 640 + if (REISERFS_SB(s)->s_jdev) 641 + seq_printf(seq, ",jdev=%s", REISERFS_SB(s)->s_jdev); 642 + 643 + if (journal->j_max_commit_age != journal->j_default_max_commit_age) 644 + seq_printf(seq, ",commit=%d", journal->j_max_commit_age); 645 + 646 + #ifdef CONFIG_QUOTA 647 + if (REISERFS_SB(s)->s_qf_names[USRQUOTA]) 648 + seq_printf(seq, ",usrjquota=%s", REISERFS_SB(s)->s_qf_names[USRQUOTA]); 649 + else if (opts & (1 << REISERFS_USRQUOTA)) 650 + seq_puts(seq, ",usrquota"); 651 + if (REISERFS_SB(s)->s_qf_names[GRPQUOTA]) 652 + seq_printf(seq, ",grpjquota=%s", REISERFS_SB(s)->s_qf_names[GRPQUOTA]); 653 + else if (opts & (1 << REISERFS_GRPQUOTA)) 654 + seq_puts(seq, ",grpquota"); 655 + if (REISERFS_SB(s)->s_jquota_fmt) { 656 + if (REISERFS_SB(s)->s_jquota_fmt == QFMT_VFS_OLD) 657 + seq_puts(seq, ",jqfmt=vfsold"); 658 + else if (REISERFS_SB(s)->s_jquota_fmt == QFMT_VFS_V0) 659 + seq_puts(seq, ",jqfmt=vfsv0"); 660 + } 661 + #endif 662 + 663 + /* Block allocator options */ 664 + if (opts & (1 << REISERFS_NO_BORDER)) 665 + seq_puts(seq, ",block-allocator=noborder"); 666 + if (opts & (1 << REISERFS_NO_UNHASHED_RELOCATION)) 667 + seq_puts(seq, ",block-allocator=no_unhashed_relocation"); 668 + if (opts & (1 << REISERFS_HASHED_RELOCATION)) 669 + seq_puts(seq, ",block-allocator=hashed_relocation"); 670 + if (opts & (1 << REISERFS_TEST4)) 671 + seq_puts(seq, ",block-allocator=test4"); 672 + show_alloc_options(seq, s); 673 + return 0; 674 + } 675 + 601 676 #ifdef CONFIG_QUOTA 602 677 static ssize_t reiserfs_quota_write(struct super_block *, int, const char *, 603 678 size_t, loff_t); ··· 694 617 .unfreeze_fs = reiserfs_unfreeze, 695 618 .statfs = reiserfs_statfs, 696 619 .remount_fs = reiserfs_remount, 697 - .show_options = generic_show_options, 620 + .show_options = reiserfs_show_options, 698 621 #ifdef CONFIG_QUOTA 699 622 .quota_read = reiserfs_quota_read, 700 623 .quota_write = reiserfs_quota_write, ··· 992 915 {"jdev",.arg_required = 'j',.values = NULL}, 993 916 {"nolargeio",.arg_required = 'w',.values = NULL}, 994 917 {"commit",.arg_required = 'c',.values = NULL}, 995 - {"usrquota",.setmask = 1 << REISERFS_QUOTA}, 996 - {"grpquota",.setmask = 1 << REISERFS_QUOTA}, 997 - {"noquota",.clrmask = 1 << REISERFS_QUOTA}, 918 + {"usrquota",.setmask = 1 << REISERFS_USRQUOTA}, 919 + {"grpquota",.setmask = 1 << REISERFS_GRPQUOTA}, 920 + {"noquota",.clrmask = 1 << REISERFS_USRQUOTA | 1 << REISERFS_GRPQUOTA}, 998 921 {"errors",.arg_required = 'e',.values = error_actions}, 999 922 {"usrjquota",.arg_required = 1000 923 'u' | (1 << REISERFS_OPT_ALLOWEMPTY),.values = NULL}, ··· 1108 1031 return 0; 1109 1032 } 1110 1033 strcpy(qf_names[qtype], arg); 1111 - *mount_options |= 1 << REISERFS_QUOTA; 1034 + if (qtype == USRQUOTA) 1035 + *mount_options |= 1 << REISERFS_USRQUOTA; 1036 + else 1037 + *mount_options |= 1 << REISERFS_GRPQUOTA; 1112 1038 } else { 1113 1039 if (qf_names[qtype] != 1114 1040 REISERFS_SB(s)->s_qf_names[qtype]) 1115 1041 kfree(qf_names[qtype]); 1116 1042 qf_names[qtype] = NULL; 1043 + if (qtype == USRQUOTA) 1044 + *mount_options &= ~(1 << REISERFS_USRQUOTA); 1045 + else 1046 + *mount_options &= ~(1 << REISERFS_GRPQUOTA); 1117 1047 } 1118 1048 } 1119 1049 if (c == 'f') { ··· 1159 1075 "journaled quota format not specified."); 1160 1076 return 0; 1161 1077 } 1162 - /* This checking is not precise wrt the quota type but for our purposes it is sufficient */ 1163 - if (!(*mount_options & (1 << REISERFS_QUOTA)) 1164 - && sb_any_quota_loaded(s)) { 1078 + if ((!(*mount_options & (1 << REISERFS_USRQUOTA)) && 1079 + sb_has_quota_loaded(s, USRQUOTA)) || 1080 + (!(*mount_options & (1 << REISERFS_GRPQUOTA)) && 1081 + sb_has_quota_loaded(s, GRPQUOTA))) { 1165 1082 reiserfs_warning(s, "super-6516", "quota options must " 1166 1083 "be present when quota is turned on."); 1167 1084 return 0; ··· 1310 1225 safe_mask |= 1 << REISERFS_ERROR_RO; 1311 1226 safe_mask |= 1 << REISERFS_ERROR_CONTINUE; 1312 1227 safe_mask |= 1 << REISERFS_ERROR_PANIC; 1313 - safe_mask |= 1 << REISERFS_QUOTA; 1228 + safe_mask |= 1 << REISERFS_USRQUOTA; 1229 + safe_mask |= 1 << REISERFS_GRPQUOTA; 1314 1230 1315 1231 /* Update the bitmask, taking care to keep 1316 1232 * the bits we're not allowed to change here */ ··· 1758 1672 &commit_max_age, qf_names, &qfmt) == 0) { 1759 1673 goto error; 1760 1674 } 1675 + if (jdev_name && jdev_name[0]) { 1676 + REISERFS_SB(s)->s_jdev = kstrdup(jdev_name, GFP_KERNEL); 1677 + if (!REISERFS_SB(s)->s_jdev) { 1678 + SWARN(silent, s, "", "Cannot allocate memory for " 1679 + "journal device name"); 1680 + goto error; 1681 + } 1682 + } 1761 1683 #ifdef CONFIG_QUOTA 1762 1684 handle_quota_files(s, qf_names, &qfmt); 1763 1685 #endif ··· 2148 2054 int err; 2149 2055 struct inode *inode; 2150 2056 struct reiserfs_transaction_handle th; 2057 + int opt = type == USRQUOTA ? REISERFS_USRQUOTA : REISERFS_GRPQUOTA; 2151 2058 2152 - if (!(REISERFS_SB(sb)->s_mount_opt & (1 << REISERFS_QUOTA))) 2059 + if (!(REISERFS_SB(sb)->s_mount_opt & (1 << opt))) 2153 2060 return -EINVAL; 2154 2061 2155 2062 /* Quotafile not on the same filesystem? */ 2156 - if (path->mnt->mnt_sb != sb) { 2063 + if (path->dentry->d_sb != sb) { 2157 2064 err = -EXDEV; 2158 2065 goto out; 2159 2066 }
+1 -1
fs/reiserfs/xattr.c
··· 66 66 } 67 67 #endif 68 68 69 - static int xattr_mkdir(struct inode *dir, struct dentry *dentry, int mode) 69 + static int xattr_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 70 70 { 71 71 BUG_ON(!mutex_is_locked(&dir->i_mutex)); 72 72 return dir->i_op->mkdir(dir, dentry, mode);
-1
fs/romfs/super.c
··· 403 403 static void romfs_i_callback(struct rcu_head *head) 404 404 { 405 405 struct inode *inode = container_of(head, struct inode, i_rcu); 406 - INIT_LIST_HEAD(&inode->i_dentry); 407 406 kmem_cache_free(romfs_inode_cachep, ROMFS_I(inode)); 408 407 } 409 408
+5 -5
fs/seq_file.c
··· 397 397 * Returns pointer past last written character in @s, or NULL in case of 398 398 * failure. 399 399 */ 400 - char *mangle_path(char *s, char *p, char *esc) 400 + char *mangle_path(char *s, const char *p, const char *esc) 401 401 { 402 402 while (s <= p) { 403 403 char c = *p++; ··· 427 427 * return the absolute path of 'path', as represented by the 428 428 * dentry / mnt pair in the path parameter. 429 429 */ 430 - int seq_path(struct seq_file *m, struct path *path, char *esc) 430 + int seq_path(struct seq_file *m, const struct path *path, const char *esc) 431 431 { 432 432 char *buf; 433 433 size_t size = seq_get_buf(m, &buf); ··· 450 450 /* 451 451 * Same as seq_path, but relative to supplied root. 452 452 */ 453 - int seq_path_root(struct seq_file *m, struct path *path, struct path *root, 454 - char *esc) 453 + int seq_path_root(struct seq_file *m, const struct path *path, 454 + const struct path *root, const char *esc) 455 455 { 456 456 char *buf; 457 457 size_t size = seq_get_buf(m, &buf); ··· 480 480 /* 481 481 * returns the path of the 'dentry' from the root of its filesystem. 482 482 */ 483 - int seq_dentry(struct seq_file *m, struct dentry *dentry, char *esc) 483 + int seq_dentry(struct seq_file *m, struct dentry *dentry, const char *esc) 484 484 { 485 485 char *buf; 486 486 size_t size = seq_get_buf(m, &buf);
-1
fs/splice.c
··· 25 25 #include <linux/mm_inline.h> 26 26 #include <linux/swap.h> 27 27 #include <linux/writeback.h> 28 - #include <linux/buffer_head.h> 29 28 #include <linux/module.h> 30 29 #include <linux/syscalls.h> 31 30 #include <linux/uio.h>
-1
fs/squashfs/super.c
··· 464 464 static void squashfs_i_callback(struct rcu_head *head) 465 465 { 466 466 struct inode *inode = container_of(head, struct inode, i_rcu); 467 - INIT_LIST_HEAD(&inode->i_dentry); 468 467 kmem_cache_free(squashfs_inode_cachep, squashfs_i(inode)); 469 468 } 470 469
+13 -8
fs/statfs.c
··· 7 7 #include <linux/statfs.h> 8 8 #include <linux/security.h> 9 9 #include <linux/uaccess.h> 10 + #include "internal.h" 10 11 11 12 static int flags_by_mnt(int mnt_flags) 12 13 { ··· 46 45 flags_by_sb(mnt->mnt_sb->s_flags); 47 46 } 48 47 49 - int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf) 48 + static int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf) 50 49 { 51 50 int retval; 52 51 ··· 206 205 return error; 207 206 } 208 207 209 - SYSCALL_DEFINE2(ustat, unsigned, dev, struct ustat __user *, ubuf) 208 + int vfs_ustat(dev_t dev, struct kstatfs *sbuf) 210 209 { 211 - struct super_block *s; 212 - struct ustat tmp; 213 - struct kstatfs sbuf; 210 + struct super_block *s = user_get_super(dev); 214 211 int err; 215 - 216 - s = user_get_super(new_decode_dev(dev)); 217 212 if (!s) 218 213 return -EINVAL; 219 214 220 - err = statfs_by_dentry(s->s_root, &sbuf); 215 + err = statfs_by_dentry(s->s_root, sbuf); 221 216 drop_super(s); 217 + return err; 218 + } 219 + 220 + SYSCALL_DEFINE2(ustat, unsigned, dev, struct ustat __user *, ubuf) 221 + { 222 + struct ustat tmp; 223 + struct kstatfs sbuf; 224 + int err = vfs_ustat(new_decode_dev(dev), &sbuf); 222 225 if (err) 223 226 return err; 224 227
+45 -25
fs/super.c
··· 136 136 INIT_LIST_HEAD(&s->s_files); 137 137 #endif 138 138 s->s_bdi = &default_backing_dev_info; 139 - INIT_LIST_HEAD(&s->s_instances); 139 + INIT_HLIST_NODE(&s->s_instances); 140 140 INIT_HLIST_BL_HEAD(&s->s_anon); 141 141 INIT_LIST_HEAD(&s->s_inodes); 142 142 INIT_LIST_HEAD(&s->s_dentry_lru); 143 143 INIT_LIST_HEAD(&s->s_inode_lru); 144 144 spin_lock_init(&s->s_inode_lru_lock); 145 + INIT_LIST_HEAD(&s->s_mounts); 145 146 init_rwsem(&s->s_umount); 146 147 mutex_init(&s->s_lock); 147 148 lockdep_set_class(&s->s_umount, &type->s_umount_key); ··· 201 200 free_percpu(s->s_files); 202 201 #endif 203 202 security_sb_free(s); 203 + WARN_ON(!list_empty(&s->s_mounts)); 204 204 kfree(s->s_subtype); 205 205 kfree(s->s_options); 206 206 kfree(s); ··· 212 210 /* 213 211 * Drop a superblock's refcount. The caller must hold sb_lock. 214 212 */ 215 - void __put_super(struct super_block *sb) 213 + static void __put_super(struct super_block *sb) 216 214 { 217 215 if (!--sb->s_count) { 218 216 list_del_init(&sb->s_list); ··· 227 225 * Drops a temporary reference, frees superblock if there's no 228 226 * references left. 229 227 */ 230 - void put_super(struct super_block *sb) 228 + static void put_super(struct super_block *sb) 231 229 { 232 230 spin_lock(&sb_lock); 233 231 __put_super(sb); ··· 330 328 bool grab_super_passive(struct super_block *sb) 331 329 { 332 330 spin_lock(&sb_lock); 333 - if (list_empty(&sb->s_instances)) { 331 + if (hlist_unhashed(&sb->s_instances)) { 334 332 spin_unlock(&sb_lock); 335 333 return false; 336 334 } ··· 339 337 spin_unlock(&sb_lock); 340 338 341 339 if (down_read_trylock(&sb->s_umount)) { 342 - if (sb->s_root) 340 + if (sb->s_root && (sb->s_flags & MS_BORN)) 343 341 return true; 344 342 up_read(&sb->s_umount); 345 343 } ··· 402 400 } 403 401 spin_lock(&sb_lock); 404 402 /* should be initialized for __put_super_and_need_restart() */ 405 - list_del_init(&sb->s_instances); 403 + hlist_del_init(&sb->s_instances); 406 404 spin_unlock(&sb_lock); 407 405 up_write(&sb->s_umount); 408 406 } ··· 422 420 void *data) 423 421 { 424 422 struct super_block *s = NULL; 423 + struct hlist_node *node; 425 424 struct super_block *old; 426 425 int err; 427 426 428 427 retry: 429 428 spin_lock(&sb_lock); 430 429 if (test) { 431 - list_for_each_entry(old, &type->fs_supers, s_instances) { 430 + hlist_for_each_entry(old, node, &type->fs_supers, s_instances) { 432 431 if (!test(old, data)) 433 432 continue; 434 433 if (!grab_super(old)) ··· 465 462 s->s_type = type; 466 463 strlcpy(s->s_id, type->name, sizeof(s->s_id)); 467 464 list_add_tail(&s->s_list, &super_blocks); 468 - list_add(&s->s_instances, &type->fs_supers); 465 + hlist_add_head(&s->s_instances, &type->fs_supers); 469 466 spin_unlock(&sb_lock); 470 467 get_filesystem(type); 471 468 register_shrinker(&s->s_shrink); ··· 500 497 501 498 spin_lock(&sb_lock); 502 499 list_for_each_entry(sb, &super_blocks, s_list) { 503 - if (list_empty(&sb->s_instances)) 500 + if (hlist_unhashed(&sb->s_instances)) 504 501 continue; 505 502 if (sb->s_op->write_super && sb->s_dirt) { 506 503 sb->s_count++; 507 504 spin_unlock(&sb_lock); 508 505 509 506 down_read(&sb->s_umount); 510 - if (sb->s_root && sb->s_dirt) 507 + if (sb->s_root && sb->s_dirt && (sb->s_flags & MS_BORN)) 511 508 sb->s_op->write_super(sb); 512 509 up_read(&sb->s_umount); 513 510 ··· 536 533 537 534 spin_lock(&sb_lock); 538 535 list_for_each_entry(sb, &super_blocks, s_list) { 539 - if (list_empty(&sb->s_instances)) 536 + if (hlist_unhashed(&sb->s_instances)) 540 537 continue; 541 538 sb->s_count++; 542 539 spin_unlock(&sb_lock); 543 540 544 541 down_read(&sb->s_umount); 545 - if (sb->s_root) 542 + if (sb->s_root && (sb->s_flags & MS_BORN)) 546 543 f(sb, arg); 547 544 up_read(&sb->s_umount); 548 545 ··· 569 566 void (*f)(struct super_block *, void *), void *arg) 570 567 { 571 568 struct super_block *sb, *p = NULL; 569 + struct hlist_node *node; 572 570 573 571 spin_lock(&sb_lock); 574 - list_for_each_entry(sb, &type->fs_supers, s_instances) { 572 + hlist_for_each_entry(sb, node, &type->fs_supers, s_instances) { 575 573 sb->s_count++; 576 574 spin_unlock(&sb_lock); 577 575 578 576 down_read(&sb->s_umount); 579 - if (sb->s_root) 577 + if (sb->s_root && (sb->s_flags & MS_BORN)) 580 578 f(sb, arg); 581 579 up_read(&sb->s_umount); 582 580 ··· 611 607 spin_lock(&sb_lock); 612 608 rescan: 613 609 list_for_each_entry(sb, &super_blocks, s_list) { 614 - if (list_empty(&sb->s_instances)) 610 + if (hlist_unhashed(&sb->s_instances)) 615 611 continue; 616 612 if (sb->s_bdev == bdev) { 617 613 sb->s_count++; 618 614 spin_unlock(&sb_lock); 619 615 down_read(&sb->s_umount); 620 616 /* still alive? */ 621 - if (sb->s_root) 617 + if (sb->s_root && (sb->s_flags & MS_BORN)) 622 618 return sb; 623 619 up_read(&sb->s_umount); 624 620 /* nope, got unmounted */ ··· 651 647 restart: 652 648 spin_lock(&sb_lock); 653 649 list_for_each_entry(sb, &super_blocks, s_list) { 654 - if (list_empty(&sb->s_instances)) 650 + if (hlist_unhashed(&sb->s_instances)) 655 651 continue; 656 652 if (sb->s_bdev == bdev) { 657 653 if (grab_super(sb)) /* drops sb_lock */ ··· 671 667 spin_lock(&sb_lock); 672 668 rescan: 673 669 list_for_each_entry(sb, &super_blocks, s_list) { 674 - if (list_empty(&sb->s_instances)) 670 + if (hlist_unhashed(&sb->s_instances)) 675 671 continue; 676 672 if (sb->s_dev == dev) { 677 673 sb->s_count++; 678 674 spin_unlock(&sb_lock); 679 675 down_read(&sb->s_umount); 680 676 /* still alive? */ 681 - if (sb->s_root) 677 + if (sb->s_root && (sb->s_flags & MS_BORN)) 682 678 return sb; 683 679 up_read(&sb->s_umount); 684 680 /* nope, got unmounted */ ··· 723 719 /* If we are remounting RDONLY and current sb is read/write, 724 720 make sure there are no rw files opened */ 725 721 if (remount_ro) { 726 - if (force) 722 + if (force) { 727 723 mark_files_ro(sb); 728 - else if (!fs_may_remount_ro(sb)) 729 - return -EBUSY; 724 + } else { 725 + retval = sb_prepare_remount_readonly(sb); 726 + if (retval) 727 + return retval; 728 + } 730 729 } 731 730 732 731 if (sb->s_op->remount_fs) { 733 732 retval = sb->s_op->remount_fs(sb, &flags, data); 734 733 if (retval) { 735 734 if (!force) 736 - return retval; 735 + goto cancel_readonly; 737 736 /* If forced remount, go ahead despite any errors */ 738 737 WARN(1, "forced remount of a %s fs returned %i\n", 739 738 sb->s_type->name, retval); 740 739 } 741 740 } 742 741 sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK); 742 + /* Needs to be ordered wrt mnt_is_readonly() */ 743 + smp_wmb(); 744 + sb->s_readonly_remount = 0; 743 745 744 746 /* 745 747 * Some filesystems modify their metadata via some other path than the ··· 758 748 if (remount_ro && sb->s_bdev) 759 749 invalidate_bdev(sb->s_bdev); 760 750 return 0; 751 + 752 + cancel_readonly: 753 + sb->s_readonly_remount = 0; 754 + return retval; 761 755 } 762 756 763 757 static void do_emergency_remount(struct work_struct *work) ··· 770 756 771 757 spin_lock(&sb_lock); 772 758 list_for_each_entry(sb, &super_blocks, s_list) { 773 - if (list_empty(&sb->s_instances)) 759 + if (hlist_unhashed(&sb->s_instances)) 774 760 continue; 775 761 sb->s_count++; 776 762 spin_unlock(&sb_lock); 777 763 down_write(&sb->s_umount); 778 - if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY)) { 764 + if (sb->s_root && sb->s_bdev && (sb->s_flags & MS_BORN) && 765 + !(sb->s_flags & MS_RDONLY)) { 779 766 /* 780 767 * What lock protects sb->s_flags?? 781 768 */ ··· 1157 1142 if (sb->s_frozen) { 1158 1143 deactivate_locked_super(sb); 1159 1144 return -EBUSY; 1145 + } 1146 + 1147 + if (!(sb->s_flags & MS_BORN)) { 1148 + up_write(&sb->s_umount); 1149 + return 0; /* sic - it's "nothing to do" */ 1160 1150 } 1161 1151 1162 1152 if (sb->s_flags & MS_RDONLY) {
-1
fs/sync.c
··· 14 14 #include <linux/linkage.h> 15 15 #include <linux/pagemap.h> 16 16 #include <linux/quotaops.h> 17 - #include <linux/buffer_head.h> 18 17 #include <linux/backing-dev.h> 19 18 #include "internal.h" 20 19
+2 -2
fs/sysfs/file.c
··· 518 518 } 519 519 520 520 int sysfs_add_file_mode(struct sysfs_dirent *dir_sd, 521 - const struct attribute *attr, int type, mode_t amode) 521 + const struct attribute *attr, int type, umode_t amode) 522 522 { 523 523 umode_t mode = (amode & S_IALLUGO) | S_IFREG; 524 524 struct sysfs_addrm_cxt acxt; ··· 618 618 * 619 619 */ 620 620 int sysfs_chmod_file(struct kobject *kobj, const struct attribute *attr, 621 - mode_t mode) 621 + umode_t mode) 622 622 { 623 623 struct sysfs_dirent *sd; 624 624 struct iattr newattrs;
+1 -1
fs/sysfs/group.c
··· 33 33 int error = 0, i; 34 34 35 35 for (i = 0, attr = grp->attrs; *attr && !error; i++, attr++) { 36 - mode_t mode = 0; 36 + umode_t mode = 0; 37 37 38 38 /* in update mode, we're changing the permissions or 39 39 * visibility. Do this by first removing then
+1 -1
fs/sysfs/inode.c
··· 187 187 return error; 188 188 } 189 189 190 - static inline void set_default_inode_attr(struct inode * inode, mode_t mode) 190 + static inline void set_default_inode_attr(struct inode * inode, umode_t mode) 191 191 { 192 192 inode->i_mode = mode; 193 193 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+2 -2
fs/sysfs/sysfs.h
··· 79 79 }; 80 80 81 81 unsigned int s_flags; 82 - unsigned short s_mode; 82 + umode_t s_mode; 83 83 ino_t s_ino; 84 84 struct sysfs_inode_attrs *s_iattr; 85 85 }; ··· 229 229 const struct attribute *attr, int type); 230 230 231 231 int sysfs_add_file_mode(struct sysfs_dirent *dir_sd, 232 - const struct attribute *attr, int type, mode_t amode); 232 + const struct attribute *attr, int type, umode_t amode); 233 233 /* 234 234 * bin.c 235 235 */
+1 -1
fs/sysv/ialloc.c
··· 132 132 brelse(bh); 133 133 } 134 134 135 - struct inode * sysv_new_inode(const struct inode * dir, mode_t mode) 135 + struct inode * sysv_new_inode(const struct inode * dir, umode_t mode) 136 136 { 137 137 struct super_block *sb = dir->i_sb; 138 138 struct sysv_sb_info *sbi = SYSV_SB(sb);
-1
fs/sysv/inode.c
··· 336 336 static void sysv_i_callback(struct rcu_head *head) 337 337 { 338 338 struct inode *inode = container_of(head, struct inode, i_rcu); 339 - INIT_LIST_HEAD(&inode->i_dentry); 340 339 kmem_cache_free(sysv_inode_cachep, SYSV_I(inode)); 341 340 } 342 341
+1 -1
fs/sysv/itree.c
··· 442 442 443 443 int sysv_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) 444 444 { 445 - struct super_block *s = mnt->mnt_sb; 445 + struct super_block *s = dentry->d_sb; 446 446 generic_fillattr(dentry->d_inode, stat); 447 447 stat->blocks = (s->s_blocksize / 512) * sysv_nblocks(s, stat->size); 448 448 stat->blksize = s->s_blocksize;
+3 -3
fs/sysv/namei.c
··· 61 61 return NULL; 62 62 } 63 63 64 - static int sysv_mknod(struct inode * dir, struct dentry * dentry, int mode, dev_t rdev) 64 + static int sysv_mknod(struct inode * dir, struct dentry * dentry, umode_t mode, dev_t rdev) 65 65 { 66 66 struct inode * inode; 67 67 int err; ··· 80 80 return err; 81 81 } 82 82 83 - static int sysv_create(struct inode * dir, struct dentry * dentry, int mode, struct nameidata *nd) 83 + static int sysv_create(struct inode * dir, struct dentry * dentry, umode_t mode, struct nameidata *nd) 84 84 { 85 85 return sysv_mknod(dir, dentry, mode, 0); 86 86 } ··· 131 131 return add_nondir(dentry, inode); 132 132 } 133 133 134 - static int sysv_mkdir(struct inode * dir, struct dentry *dentry, int mode) 134 + static int sysv_mkdir(struct inode * dir, struct dentry *dentry, umode_t mode) 135 135 { 136 136 struct inode * inode; 137 137 int err = -EMLINK;
+1 -1
fs/sysv/sysv.h
··· 125 125 /* ialloc.c */ 126 126 extern struct sysv_inode *sysv_raw_inode(struct super_block *, unsigned, 127 127 struct buffer_head **); 128 - extern struct inode * sysv_new_inode(const struct inode *, mode_t); 128 + extern struct inode * sysv_new_inode(const struct inode *, umode_t); 129 129 extern void sysv_free_inode(struct inode *); 130 130 extern unsigned long sysv_count_free_inodes(struct super_block *); 131 131
+7 -7
fs/ubifs/dir.c
··· 56 56 * 57 57 * This function returns the inherited flags. 58 58 */ 59 - static int inherit_flags(const struct inode *dir, int mode) 59 + static int inherit_flags(const struct inode *dir, umode_t mode) 60 60 { 61 61 int flags; 62 62 const struct ubifs_inode *ui = ubifs_inode(dir); ··· 86 86 * case of failure. 87 87 */ 88 88 struct inode *ubifs_new_inode(struct ubifs_info *c, const struct inode *dir, 89 - int mode) 89 + umode_t mode) 90 90 { 91 91 struct inode *inode; 92 92 struct ubifs_inode *ui; ··· 253 253 return ERR_PTR(err); 254 254 } 255 255 256 - static int ubifs_create(struct inode *dir, struct dentry *dentry, int mode, 256 + static int ubifs_create(struct inode *dir, struct dentry *dentry, umode_t mode, 257 257 struct nameidata *nd) 258 258 { 259 259 struct inode *inode; ··· 268 268 * parent directory inode. 269 269 */ 270 270 271 - dbg_gen("dent '%.*s', mode %#x in dir ino %lu", 271 + dbg_gen("dent '%.*s', mode %#hx in dir ino %lu", 272 272 dentry->d_name.len, dentry->d_name.name, mode, dir->i_ino); 273 273 274 274 err = ubifs_budget_space(c, &req); ··· 712 712 return err; 713 713 } 714 714 715 - static int ubifs_mkdir(struct inode *dir, struct dentry *dentry, int mode) 715 + static int ubifs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 716 716 { 717 717 struct inode *inode; 718 718 struct ubifs_inode *dir_ui = ubifs_inode(dir); ··· 725 725 * directory inode. 726 726 */ 727 727 728 - dbg_gen("dent '%.*s', mode %#x in dir ino %lu", 728 + dbg_gen("dent '%.*s', mode %#hx in dir ino %lu", 729 729 dentry->d_name.len, dentry->d_name.name, mode, dir->i_ino); 730 730 731 731 err = ubifs_budget_space(c, &req); ··· 769 769 } 770 770 771 771 static int ubifs_mknod(struct inode *dir, struct dentry *dentry, 772 - int mode, dev_t rdev) 772 + umode_t mode, dev_t rdev) 773 773 { 774 774 struct inode *inode; 775 775 struct ubifs_inode *ui;
+2 -2
fs/ubifs/ioctl.c
··· 173 173 * Make sure the file-system is read-write and make sure it 174 174 * will not become read-only while we are changing the flags. 175 175 */ 176 - err = mnt_want_write(file->f_path.mnt); 176 + err = mnt_want_write_file(file); 177 177 if (err) 178 178 return err; 179 179 dbg_gen("set flags: %#x, i_flags %#x", flags, inode->i_flags); 180 180 err = setflags(inode, flags); 181 - mnt_drop_write(file->f_path.mnt); 181 + mnt_drop_write_file(file); 182 182 return err; 183 183 } 184 184
+2 -3
fs/ubifs/super.c
··· 276 276 { 277 277 struct inode *inode = container_of(head, struct inode, i_rcu); 278 278 struct ubifs_inode *ui = ubifs_inode(inode); 279 - INIT_LIST_HEAD(&inode->i_dentry); 280 279 kmem_cache_free(ubifs_inode_slab, ui); 281 280 } 282 281 ··· 419 420 return 0; 420 421 } 421 422 422 - static int ubifs_show_options(struct seq_file *s, struct vfsmount *mnt) 423 + static int ubifs_show_options(struct seq_file *s, struct dentry *root) 423 424 { 424 - struct ubifs_info *c = mnt->mnt_sb->s_fs_info; 425 + struct ubifs_info *c = root->d_sb->s_fs_info; 425 426 426 427 if (c->mount_opts.unmount_mode == 2) 427 428 seq_printf(s, ",fast_unmount");
+1 -1
fs/ubifs/ubifs.h
··· 1734 1734 1735 1735 /* dir.c */ 1736 1736 struct inode *ubifs_new_inode(struct ubifs_info *c, const struct inode *dir, 1737 - int mode); 1737 + umode_t mode); 1738 1738 int ubifs_getattr(struct vfsmount *mnt, struct dentry *dentry, 1739 1739 struct kstat *stat); 1740 1740
+1 -1
fs/udf/ialloc.c
··· 46 46 udf_free_blocks(sb, NULL, &UDF_I(inode)->i_location, 0, 1); 47 47 } 48 48 49 - struct inode *udf_new_inode(struct inode *dir, int mode, int *err) 49 + struct inode *udf_new_inode(struct inode *dir, umode_t mode, int *err) 50 50 { 51 51 struct super_block *sb = dir->i_sb; 52 52 struct udf_sb_info *sbi = UDF_SB(sb);
+3 -3
fs/udf/inode.c
··· 48 48 49 49 #define EXTENT_MERGE_SIZE 5 50 50 51 - static mode_t udf_convert_permissions(struct fileEntry *); 51 + static umode_t udf_convert_permissions(struct fileEntry *); 52 52 static int udf_update_inode(struct inode *, int); 53 53 static void udf_fill_inode(struct inode *, struct buffer_head *); 54 54 static int udf_sync_inode(struct inode *inode); ··· 1452 1452 return 0; 1453 1453 } 1454 1454 1455 - static mode_t udf_convert_permissions(struct fileEntry *fe) 1455 + static umode_t udf_convert_permissions(struct fileEntry *fe) 1456 1456 { 1457 - mode_t mode; 1457 + umode_t mode; 1458 1458 uint32_t permissions; 1459 1459 uint32_t flags; 1460 1460
+3 -3
fs/udf/namei.c
··· 552 552 return udf_write_fi(inode, cfi, fi, fibh, NULL, NULL); 553 553 } 554 554 555 - static int udf_create(struct inode *dir, struct dentry *dentry, int mode, 555 + static int udf_create(struct inode *dir, struct dentry *dentry, umode_t mode, 556 556 struct nameidata *nd) 557 557 { 558 558 struct udf_fileident_bh fibh; ··· 596 596 return 0; 597 597 } 598 598 599 - static int udf_mknod(struct inode *dir, struct dentry *dentry, int mode, 599 + static int udf_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, 600 600 dev_t rdev) 601 601 { 602 602 struct inode *inode; ··· 640 640 return err; 641 641 } 642 642 643 - static int udf_mkdir(struct inode *dir, struct dentry *dentry, int mode) 643 + static int udf_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 644 644 { 645 645 struct inode *inode; 646 646 struct udf_fileident_bh fibh;
+9 -10
fs/udf/super.c
··· 89 89 static void udf_close_lvid(struct super_block *); 90 90 static unsigned int udf_count_free(struct super_block *); 91 91 static int udf_statfs(struct dentry *, struct kstatfs *); 92 - static int udf_show_options(struct seq_file *, struct vfsmount *); 92 + static int udf_show_options(struct seq_file *, struct dentry *); 93 93 94 94 struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct udf_sb_info *sbi) 95 95 { ··· 138 138 static void udf_i_callback(struct rcu_head *head) 139 139 { 140 140 struct inode *inode = container_of(head, struct inode, i_rcu); 141 - INIT_LIST_HEAD(&inode->i_dentry); 142 141 kmem_cache_free(udf_inode_cachep, UDF_I(inode)); 143 142 } 144 143 ··· 195 196 unsigned int fileset; 196 197 unsigned int rootdir; 197 198 unsigned int flags; 198 - mode_t umask; 199 + umode_t umask; 199 200 gid_t gid; 200 201 uid_t uid; 201 - mode_t fmode; 202 - mode_t dmode; 202 + umode_t fmode; 203 + umode_t dmode; 203 204 struct nls_table *nls_map; 204 205 }; 205 206 ··· 249 250 return 0; 250 251 } 251 252 252 - static int udf_show_options(struct seq_file *seq, struct vfsmount *mnt) 253 + static int udf_show_options(struct seq_file *seq, struct dentry *root) 253 254 { 254 - struct super_block *sb = mnt->mnt_sb; 255 + struct super_block *sb = root->d_sb; 255 256 struct udf_sb_info *sbi = UDF_SB(sb); 256 257 257 258 if (!UDF_QUERY_FLAG(sb, UDF_FLAG_STRICT)) ··· 279 280 if (UDF_QUERY_FLAG(sb, UDF_FLAG_GID_SET)) 280 281 seq_printf(seq, ",gid=%u", sbi->s_gid); 281 282 if (sbi->s_umask != 0) 282 - seq_printf(seq, ",umask=%o", sbi->s_umask); 283 + seq_printf(seq, ",umask=%ho", sbi->s_umask); 283 284 if (sbi->s_fmode != UDF_INVALID_MODE) 284 - seq_printf(seq, ",mode=%o", sbi->s_fmode); 285 + seq_printf(seq, ",mode=%ho", sbi->s_fmode); 285 286 if (sbi->s_dmode != UDF_INVALID_MODE) 286 - seq_printf(seq, ",dmode=%o", sbi->s_dmode); 287 + seq_printf(seq, ",dmode=%ho", sbi->s_dmode); 287 288 if (UDF_QUERY_FLAG(sb, UDF_FLAG_SESSION_SET)) 288 289 seq_printf(seq, ",session=%u", sbi->s_session); 289 290 if (UDF_QUERY_FLAG(sb, UDF_FLAG_LASTBLOCK_SET))
+4 -4
fs/udf/udf_sb.h
··· 50 50 #define UDF_SPARABLE_MAP15 0x1522U 51 51 #define UDF_METADATA_MAP25 0x2511U 52 52 53 - #define UDF_INVALID_MODE ((mode_t)-1) 53 + #define UDF_INVALID_MODE ((umode_t)-1) 54 54 55 55 #pragma pack(1) /* XXX(hch): Why? This file just defines in-core structures */ 56 56 ··· 127 127 struct buffer_head *s_lvid_bh; 128 128 129 129 /* Default permissions */ 130 - mode_t s_umask; 130 + umode_t s_umask; 131 131 gid_t s_gid; 132 132 uid_t s_uid; 133 - mode_t s_fmode; 134 - mode_t s_dmode; 133 + umode_t s_fmode; 134 + umode_t s_dmode; 135 135 /* Lock protecting consistency of above permission settings */ 136 136 rwlock_t s_cred_lock; 137 137
+1 -1
fs/udf/udfdecl.h
··· 215 215 216 216 /* ialloc.c */ 217 217 extern void udf_free_inode(struct inode *); 218 - extern struct inode *udf_new_inode(struct inode *, int, int *); 218 + extern struct inode *udf_new_inode(struct inode *, umode_t, int *); 219 219 220 220 /* truncate.c */ 221 221 extern void udf_truncate_tail_extent(struct inode *);
+1 -1
fs/ufs/ialloc.c
··· 170 170 * For other inodes, search forward from the parent directory's block 171 171 * group to find a free inode. 172 172 */ 173 - struct inode * ufs_new_inode(struct inode * dir, int mode) 173 + struct inode *ufs_new_inode(struct inode *dir, umode_t mode) 174 174 { 175 175 struct super_block * sb; 176 176 struct ufs_sb_info * sbi;
+2 -2
fs/ufs/inode.c
··· 583 583 { 584 584 struct ufs_inode_info *ufsi = UFS_I(inode); 585 585 struct super_block *sb = inode->i_sb; 586 - mode_t mode; 586 + umode_t mode; 587 587 588 588 /* 589 589 * Copy data to the in-core inode. ··· 630 630 { 631 631 struct ufs_inode_info *ufsi = UFS_I(inode); 632 632 struct super_block *sb = inode->i_sb; 633 - mode_t mode; 633 + umode_t mode; 634 634 635 635 UFSD("Reading ufs2 inode, ino %lu\n", inode->i_ino); 636 636 /*
+3 -3
fs/ufs/namei.c
··· 70 70 * If the create succeeds, we fill in the inode information 71 71 * with d_instantiate(). 72 72 */ 73 - static int ufs_create (struct inode * dir, struct dentry * dentry, int mode, 73 + static int ufs_create (struct inode * dir, struct dentry * dentry, umode_t mode, 74 74 struct nameidata *nd) 75 75 { 76 76 struct inode *inode; ··· 94 94 return err; 95 95 } 96 96 97 - static int ufs_mknod (struct inode * dir, struct dentry *dentry, int mode, dev_t rdev) 97 + static int ufs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t rdev) 98 98 { 99 99 struct inode *inode; 100 100 int err; ··· 180 180 return error; 181 181 } 182 182 183 - static int ufs_mkdir(struct inode * dir, struct dentry * dentry, int mode) 183 + static int ufs_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode) 184 184 { 185 185 struct inode * inode; 186 186 int err = -EMLINK;
+2 -3
fs/ufs/super.c
··· 1351 1351 return 0; 1352 1352 } 1353 1353 1354 - static int ufs_show_options(struct seq_file *seq, struct vfsmount *vfs) 1354 + static int ufs_show_options(struct seq_file *seq, struct dentry *root) 1355 1355 { 1356 - struct ufs_sb_info *sbi = UFS_SB(vfs->mnt_sb); 1356 + struct ufs_sb_info *sbi = UFS_SB(root->d_sb); 1357 1357 unsigned mval = sbi->s_mount_opt & UFS_MOUNT_UFSTYPE; 1358 1358 const struct match_token *tp = tokens; 1359 1359 ··· 1425 1425 static void ufs_i_callback(struct rcu_head *head) 1426 1426 { 1427 1427 struct inode *inode = container_of(head, struct inode, i_rcu); 1428 - INIT_LIST_HEAD(&inode->i_dentry); 1429 1428 kmem_cache_free(ufs_inode_cachep, UFS_I(inode)); 1430 1429 } 1431 1430
+1 -1
fs/ufs/ufs.h
··· 104 104 105 105 /* ialloc.c */ 106 106 extern void ufs_free_inode (struct inode *inode); 107 - extern struct inode * ufs_new_inode (struct inode *, int); 107 + extern struct inode * ufs_new_inode (struct inode *, umode_t); 108 108 109 109 /* inode.c */ 110 110 extern struct inode *ufs_iget(struct super_block *, unsigned long);
+2 -2
fs/xattr.c
··· 397 397 error = mnt_want_write_file(f); 398 398 if (!error) { 399 399 error = setxattr(dentry, name, value, size, flags); 400 - mnt_drop_write(f->f_path.mnt); 400 + mnt_drop_write_file(f); 401 401 } 402 402 fput(f); 403 403 return error; ··· 624 624 error = mnt_want_write_file(f); 625 625 if (!error) { 626 626 error = removexattr(dentry, name); 627 - mnt_drop_write(f->f_path.mnt); 627 + mnt_drop_write_file(f); 628 628 } 629 629 fput(f); 630 630 return error;
+2 -2
fs/xfs/xfs_ialloc.c
··· 447 447 xfs_ialloc_ag_select( 448 448 xfs_trans_t *tp, /* transaction pointer */ 449 449 xfs_ino_t parent, /* parent directory inode number */ 450 - mode_t mode, /* bits set to indicate file type */ 450 + umode_t mode, /* bits set to indicate file type */ 451 451 int okalloc) /* ok to allocate more space */ 452 452 { 453 453 xfs_buf_t *agbp; /* allocation group header buffer */ ··· 640 640 xfs_dialloc( 641 641 xfs_trans_t *tp, /* transaction pointer */ 642 642 xfs_ino_t parent, /* parent inode (directory) */ 643 - mode_t mode, /* mode bits for new inode */ 643 + umode_t mode, /* mode bits for new inode */ 644 644 int okalloc, /* ok to allocate more space */ 645 645 xfs_buf_t **IO_agbp, /* in/out ag header's buffer */ 646 646 boolean_t *alloc_done, /* true if we needed to replenish
+1 -1
fs/xfs/xfs_ialloc.h
··· 81 81 xfs_dialloc( 82 82 struct xfs_trans *tp, /* transaction pointer */ 83 83 xfs_ino_t parent, /* parent inode (directory) */ 84 - mode_t mode, /* mode bits for new inode */ 84 + umode_t mode, /* mode bits for new inode */ 85 85 int okalloc, /* ok to allocate more space */ 86 86 struct xfs_buf **agbp, /* buf for a.g. inode header */ 87 87 boolean_t *alloc_done, /* an allocation was done to replenish
-1
fs/xfs/xfs_iget.c
··· 107 107 struct inode *inode = container_of(head, struct inode, i_rcu); 108 108 struct xfs_inode *ip = XFS_I(inode); 109 109 110 - INIT_LIST_HEAD(&inode->i_dentry); 111 110 kmem_zone_free(xfs_inode_zone, ip); 112 111 } 113 112
+2 -2
fs/xfs/xfs_inode.c
··· 961 961 xfs_ialloc( 962 962 xfs_trans_t *tp, 963 963 xfs_inode_t *pip, 964 - mode_t mode, 964 + umode_t mode, 965 965 xfs_nlink_t nlink, 966 966 xfs_dev_t rdev, 967 967 prid_t prid, ··· 1002 1002 return error; 1003 1003 ASSERT(ip != NULL); 1004 1004 1005 - ip->i_d.di_mode = (__uint16_t)mode; 1005 + ip->i_d.di_mode = mode; 1006 1006 ip->i_d.di_onlink = 0; 1007 1007 ip->i_d.di_nlink = nlink; 1008 1008 ASSERT(ip->i_d.di_nlink == nlink);
+1 -1
fs/xfs/xfs_inode.h
··· 481 481 /* 482 482 * xfs_inode.c prototypes. 483 483 */ 484 - int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, mode_t, 484 + int xfs_ialloc(struct xfs_trans *, xfs_inode_t *, umode_t, 485 485 xfs_nlink_t, xfs_dev_t, prid_t, int, 486 486 struct xfs_buf **, boolean_t *, xfs_inode_t **); 487 487
+4 -4
fs/xfs/xfs_ioctl.c
··· 559 559 ops[i].am_flags); 560 560 break; 561 561 case ATTR_OP_SET: 562 - ops[i].am_error = mnt_want_write(parfilp->f_path.mnt); 562 + ops[i].am_error = mnt_want_write_file(parfilp); 563 563 if (ops[i].am_error) 564 564 break; 565 565 ops[i].am_error = xfs_attrmulti_attr_set( 566 566 dentry->d_inode, attr_name, 567 567 ops[i].am_attrvalue, ops[i].am_length, 568 568 ops[i].am_flags); 569 - mnt_drop_write(parfilp->f_path.mnt); 569 + mnt_drop_write_file(parfilp); 570 570 break; 571 571 case ATTR_OP_REMOVE: 572 - ops[i].am_error = mnt_want_write(parfilp->f_path.mnt); 572 + ops[i].am_error = mnt_want_write_file(parfilp); 573 573 if (ops[i].am_error) 574 574 break; 575 575 ops[i].am_error = xfs_attrmulti_attr_remove( 576 576 dentry->d_inode, attr_name, 577 577 ops[i].am_flags); 578 - mnt_drop_write(parfilp->f_path.mnt); 578 + mnt_drop_write_file(parfilp); 579 579 break; 580 580 default: 581 581 ops[i].am_error = EINVAL;
+4 -4
fs/xfs/xfs_ioctl32.c
··· 454 454 &ops[i].am_length, ops[i].am_flags); 455 455 break; 456 456 case ATTR_OP_SET: 457 - ops[i].am_error = mnt_want_write(parfilp->f_path.mnt); 457 + ops[i].am_error = mnt_want_write_file(parfilp); 458 458 if (ops[i].am_error) 459 459 break; 460 460 ops[i].am_error = xfs_attrmulti_attr_set( 461 461 dentry->d_inode, attr_name, 462 462 compat_ptr(ops[i].am_attrvalue), 463 463 ops[i].am_length, ops[i].am_flags); 464 - mnt_drop_write(parfilp->f_path.mnt); 464 + mnt_drop_write_file(parfilp); 465 465 break; 466 466 case ATTR_OP_REMOVE: 467 - ops[i].am_error = mnt_want_write(parfilp->f_path.mnt); 467 + ops[i].am_error = mnt_want_write_file(parfilp); 468 468 if (ops[i].am_error) 469 469 break; 470 470 ops[i].am_error = xfs_attrmulti_attr_remove( 471 471 dentry->d_inode, attr_name, 472 472 ops[i].am_flags); 473 - mnt_drop_write(parfilp->f_path.mnt); 473 + mnt_drop_write_file(parfilp); 474 474 break; 475 475 default: 476 476 ops[i].am_error = EINVAL;
+4 -4
fs/xfs/xfs_iops.c
··· 168 168 xfs_vn_mknod( 169 169 struct inode *dir, 170 170 struct dentry *dentry, 171 - int mode, 171 + umode_t mode, 172 172 dev_t rdev) 173 173 { 174 174 struct inode *inode; ··· 231 231 xfs_vn_create( 232 232 struct inode *dir, 233 233 struct dentry *dentry, 234 - int mode, 234 + umode_t mode, 235 235 struct nameidata *nd) 236 236 { 237 237 return xfs_vn_mknod(dir, dentry, mode, 0); ··· 241 241 xfs_vn_mkdir( 242 242 struct inode *dir, 243 243 struct dentry *dentry, 244 - int mode) 244 + umode_t mode) 245 245 { 246 246 return xfs_vn_mknod(dir, dentry, mode|S_IFDIR, 0); 247 247 } ··· 366 366 struct xfs_inode *cip = NULL; 367 367 struct xfs_name name; 368 368 int error; 369 - mode_t mode; 369 + umode_t mode; 370 370 371 371 mode = S_IFLNK | 372 372 (irix_symlink_mode ? 0777 & ~current_umask() : S_IRWXUGO);
+2 -2
fs/xfs/xfs_super.c
··· 1238 1238 STATIC int 1239 1239 xfs_fs_show_options( 1240 1240 struct seq_file *m, 1241 - struct vfsmount *mnt) 1241 + struct dentry *root) 1242 1242 { 1243 - return -xfs_showargs(XFS_M(mnt->mnt_sb), m); 1243 + return -xfs_showargs(XFS_M(root->d_sb), m); 1244 1244 } 1245 1245 1246 1246 /*
+1 -1
fs/xfs/xfs_utils.c
··· 53 53 output: may be a new transaction. */ 54 54 xfs_inode_t *dp, /* directory within whose allocate 55 55 the inode. */ 56 - mode_t mode, 56 + umode_t mode, 57 57 xfs_nlink_t nlink, 58 58 xfs_dev_t rdev, 59 59 prid_t prid, /* project id */
+1 -1
fs/xfs/xfs_utils.h
··· 18 18 #ifndef __XFS_UTILS_H__ 19 19 #define __XFS_UTILS_H__ 20 20 21 - extern int xfs_dir_ialloc(xfs_trans_t **, xfs_inode_t *, mode_t, xfs_nlink_t, 21 + extern int xfs_dir_ialloc(xfs_trans_t **, xfs_inode_t *, umode_t, xfs_nlink_t, 22 22 xfs_dev_t, prid_t, int, xfs_inode_t **, int *); 23 23 extern int xfs_droplink(xfs_trans_t *, xfs_inode_t *); 24 24 extern int xfs_bumplink(xfs_trans_t *, xfs_inode_t *);
+2 -2
fs/xfs/xfs_vnodeops.c
··· 822 822 xfs_create( 823 823 xfs_inode_t *dp, 824 824 struct xfs_name *name, 825 - mode_t mode, 825 + umode_t mode, 826 826 xfs_dev_t rdev, 827 827 xfs_inode_t **ipp) 828 828 { ··· 1481 1481 xfs_inode_t *dp, 1482 1482 struct xfs_name *link_name, 1483 1483 const char *target_path, 1484 - mode_t mode, 1484 + umode_t mode, 1485 1485 xfs_inode_t **ipp) 1486 1486 { 1487 1487 xfs_mount_t *mp = dp->i_mount;
+2 -2
fs/xfs/xfs_vnodeops.h
··· 26 26 int xfs_inactive(struct xfs_inode *ip); 27 27 int xfs_lookup(struct xfs_inode *dp, struct xfs_name *name, 28 28 struct xfs_inode **ipp, struct xfs_name *ci_name); 29 - int xfs_create(struct xfs_inode *dp, struct xfs_name *name, mode_t mode, 29 + int xfs_create(struct xfs_inode *dp, struct xfs_name *name, umode_t mode, 30 30 xfs_dev_t rdev, struct xfs_inode **ipp); 31 31 int xfs_remove(struct xfs_inode *dp, struct xfs_name *name, 32 32 struct xfs_inode *ip); ··· 35 35 int xfs_readdir(struct xfs_inode *dp, void *dirent, size_t bufsize, 36 36 xfs_off_t *offset, filldir_t filldir); 37 37 int xfs_symlink(struct xfs_inode *dp, struct xfs_name *link_name, 38 - const char *target_path, mode_t mode, struct xfs_inode **ipp); 38 + const char *target_path, umode_t mode, struct xfs_inode **ipp); 39 39 int xfs_set_dmattrs(struct xfs_inode *ip, u_int evmask, u_int16_t state); 40 40 int xfs_change_file_space(struct xfs_inode *ip, int cmd, 41 41 xfs_flock64_t *bf, xfs_off_t offset, int attr_flags);
-6
include/asm-generic/types.h
··· 6 6 */ 7 7 #include <asm-generic/int-ll64.h> 8 8 9 - #ifndef __ASSEMBLY__ 10 - 11 - typedef unsigned short umode_t; 12 - 13 - #endif /* __ASSEMBLY__ */ 14 - 15 9 #endif /* _ASM_GENERIC_TYPES_H */
+4 -4
include/linux/audit.h
··· 468 468 #define audit_get_sessionid(t) ((t)->sessionid) 469 469 extern void audit_log_task_context(struct audit_buffer *ab); 470 470 extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); 471 - extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); 471 + extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); 472 472 extern int audit_bprm(struct linux_binprm *bprm); 473 473 extern void audit_socketcall(int nargs, unsigned long *args); 474 474 extern int audit_sockaddr(int len, void *addr); 475 475 extern void __audit_fd_pair(int fd1, int fd2); 476 476 extern int audit_set_macxattr(const char *name); 477 - extern void __audit_mq_open(int oflag, mode_t mode, struct mq_attr *attr); 477 + extern void __audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr); 478 478 extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout); 479 479 extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification); 480 480 extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); ··· 494 494 if (unlikely(!audit_dummy_context())) 495 495 __audit_fd_pair(fd1, fd2); 496 496 } 497 - static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) 497 + static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode) 498 498 { 499 499 if (unlikely(!audit_dummy_context())) 500 500 __audit_ipc_set_perm(qbytes, uid, gid, mode); 501 501 } 502 - static inline void audit_mq_open(int oflag, mode_t mode, struct mq_attr *attr) 502 + static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr) 503 503 { 504 504 if (unlikely(!audit_dummy_context())) 505 505 __audit_mq_open(oflag, mode, attr);
+1 -1
include/linux/cgroup.h
··· 319 319 * If not 0, file mode is set to this value, otherwise it will 320 320 * be figured out automatically 321 321 */ 322 - mode_t mode; 322 + umode_t mode; 323 323 324 324 /* 325 325 * If non-zero, defines the maximum length of string that can
+2 -2
include/linux/compat.h
··· 422 422 asmlinkage long compat_sys_vmsplice(int fd, const struct compat_iovec __user *, 423 423 unsigned int nr_segs, unsigned int flags); 424 424 asmlinkage long compat_sys_open(const char __user *filename, int flags, 425 - int mode); 425 + umode_t mode); 426 426 asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, 427 - int flags, int mode); 427 + int flags, umode_t mode); 428 428 asmlinkage long compat_sys_open_by_handle_at(int mountdirfd, 429 429 struct file_handle __user *handle, 430 430 int flags);
+1 -1
include/linux/configfs.h
··· 124 124 struct configfs_attribute { 125 125 const char *ca_name; 126 126 struct module *ca_owner; 127 - mode_t ca_mode; 127 + umode_t ca_mode; 128 128 }; 129 129 130 130 /*
+23 -23
include/linux/debugfs.h
··· 46 46 extern const struct file_operations debugfs_file_operations; 47 47 extern const struct inode_operations debugfs_link_operations; 48 48 49 - struct dentry *debugfs_create_file(const char *name, mode_t mode, 49 + struct dentry *debugfs_create_file(const char *name, umode_t mode, 50 50 struct dentry *parent, void *data, 51 51 const struct file_operations *fops); 52 52 ··· 61 61 struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, 62 62 struct dentry *new_dir, const char *new_name); 63 63 64 - struct dentry *debugfs_create_u8(const char *name, mode_t mode, 64 + struct dentry *debugfs_create_u8(const char *name, umode_t mode, 65 65 struct dentry *parent, u8 *value); 66 - struct dentry *debugfs_create_u16(const char *name, mode_t mode, 66 + struct dentry *debugfs_create_u16(const char *name, umode_t mode, 67 67 struct dentry *parent, u16 *value); 68 - struct dentry *debugfs_create_u32(const char *name, mode_t mode, 68 + struct dentry *debugfs_create_u32(const char *name, umode_t mode, 69 69 struct dentry *parent, u32 *value); 70 - struct dentry *debugfs_create_u64(const char *name, mode_t mode, 70 + struct dentry *debugfs_create_u64(const char *name, umode_t mode, 71 71 struct dentry *parent, u64 *value); 72 - struct dentry *debugfs_create_x8(const char *name, mode_t mode, 72 + struct dentry *debugfs_create_x8(const char *name, umode_t mode, 73 73 struct dentry *parent, u8 *value); 74 - struct dentry *debugfs_create_x16(const char *name, mode_t mode, 74 + struct dentry *debugfs_create_x16(const char *name, umode_t mode, 75 75 struct dentry *parent, u16 *value); 76 - struct dentry *debugfs_create_x32(const char *name, mode_t mode, 76 + struct dentry *debugfs_create_x32(const char *name, umode_t mode, 77 77 struct dentry *parent, u32 *value); 78 - struct dentry *debugfs_create_x64(const char *name, mode_t mode, 78 + struct dentry *debugfs_create_x64(const char *name, umode_t mode, 79 79 struct dentry *parent, u64 *value); 80 - struct dentry *debugfs_create_size_t(const char *name, mode_t mode, 80 + struct dentry *debugfs_create_size_t(const char *name, umode_t mode, 81 81 struct dentry *parent, size_t *value); 82 - struct dentry *debugfs_create_bool(const char *name, mode_t mode, 82 + struct dentry *debugfs_create_bool(const char *name, umode_t mode, 83 83 struct dentry *parent, u32 *value); 84 84 85 - struct dentry *debugfs_create_blob(const char *name, mode_t mode, 85 + struct dentry *debugfs_create_blob(const char *name, umode_t mode, 86 86 struct dentry *parent, 87 87 struct debugfs_blob_wrapper *blob); 88 88 ··· 105 105 * want to duplicate the design decision mistakes of procfs and devfs again. 106 106 */ 107 107 108 - static inline struct dentry *debugfs_create_file(const char *name, mode_t mode, 108 + static inline struct dentry *debugfs_create_file(const char *name, umode_t mode, 109 109 struct dentry *parent, void *data, 110 110 const struct file_operations *fops) 111 111 { ··· 137 137 return ERR_PTR(-ENODEV); 138 138 } 139 139 140 - static inline struct dentry *debugfs_create_u8(const char *name, mode_t mode, 140 + static inline struct dentry *debugfs_create_u8(const char *name, umode_t mode, 141 141 struct dentry *parent, 142 142 u8 *value) 143 143 { 144 144 return ERR_PTR(-ENODEV); 145 145 } 146 146 147 - static inline struct dentry *debugfs_create_u16(const char *name, mode_t mode, 147 + static inline struct dentry *debugfs_create_u16(const char *name, umode_t mode, 148 148 struct dentry *parent, 149 149 u16 *value) 150 150 { 151 151 return ERR_PTR(-ENODEV); 152 152 } 153 153 154 - static inline struct dentry *debugfs_create_u32(const char *name, mode_t mode, 154 + static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode, 155 155 struct dentry *parent, 156 156 u32 *value) 157 157 { 158 158 return ERR_PTR(-ENODEV); 159 159 } 160 160 161 - static inline struct dentry *debugfs_create_u64(const char *name, mode_t mode, 161 + static inline struct dentry *debugfs_create_u64(const char *name, umode_t mode, 162 162 struct dentry *parent, 163 163 u64 *value) 164 164 { 165 165 return ERR_PTR(-ENODEV); 166 166 } 167 167 168 - static inline struct dentry *debugfs_create_x8(const char *name, mode_t mode, 168 + static inline struct dentry *debugfs_create_x8(const char *name, umode_t mode, 169 169 struct dentry *parent, 170 170 u8 *value) 171 171 { 172 172 return ERR_PTR(-ENODEV); 173 173 } 174 174 175 - static inline struct dentry *debugfs_create_x16(const char *name, mode_t mode, 175 + static inline struct dentry *debugfs_create_x16(const char *name, umode_t mode, 176 176 struct dentry *parent, 177 177 u16 *value) 178 178 { 179 179 return ERR_PTR(-ENODEV); 180 180 } 181 181 182 - static inline struct dentry *debugfs_create_x32(const char *name, mode_t mode, 182 + static inline struct dentry *debugfs_create_x32(const char *name, umode_t mode, 183 183 struct dentry *parent, 184 184 u32 *value) 185 185 { 186 186 return ERR_PTR(-ENODEV); 187 187 } 188 188 189 - static inline struct dentry *debugfs_create_size_t(const char *name, mode_t mode, 189 + static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mode, 190 190 struct dentry *parent, 191 191 size_t *value) 192 192 { 193 193 return ERR_PTR(-ENODEV); 194 194 } 195 195 196 - static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, 196 + static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode, 197 197 struct dentry *parent, 198 198 u32 *value) 199 199 { 200 200 return ERR_PTR(-ENODEV); 201 201 } 202 202 203 - static inline struct dentry *debugfs_create_blob(const char *name, mode_t mode, 203 + static inline struct dentry *debugfs_create_blob(const char *name, umode_t mode, 204 204 struct dentry *parent, 205 205 struct debugfs_blob_wrapper *blob) 206 206 {
+3 -3
include/linux/device.h
··· 343 343 struct kobject *dev_kobj; 344 344 345 345 int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); 346 - char *(*devnode)(struct device *dev, mode_t *mode); 346 + char *(*devnode)(struct device *dev, umode_t *mode); 347 347 348 348 void (*class_release)(struct class *class); 349 349 void (*dev_release)(struct device *dev); ··· 472 472 const char *name; 473 473 const struct attribute_group **groups; 474 474 int (*uevent)(struct device *dev, struct kobj_uevent_env *env); 475 - char *(*devnode)(struct device *dev, mode_t *mode); 475 + char *(*devnode)(struct device *dev, umode_t *mode); 476 476 void (*release)(struct device *dev); 477 477 478 478 const struct dev_pm_ops *pm; ··· 793 793 extern int device_move(struct device *dev, struct device *new_parent, 794 794 enum dpm_order dpm_order); 795 795 extern const char *device_get_devnode(struct device *dev, 796 - mode_t *mode, const char **tmp); 796 + umode_t *mode, const char **tmp); 797 797 extern void *dev_get_drvdata(const struct device *dev); 798 798 extern int dev_set_drvdata(struct device *dev, void *data); 799 799
+1 -1
include/linux/ext3_fs.h
··· 884 884 885 885 /* ialloc.c */ 886 886 extern struct inode * ext3_new_inode (handle_t *, struct inode *, 887 - const struct qstr *, int); 887 + const struct qstr *, umode_t); 888 888 extern void ext3_free_inode (handle_t *, struct inode *); 889 889 extern struct inode * ext3_orphan_get (struct super_block *, unsigned long); 890 890 extern unsigned long ext3_count_free_inodes (struct super_block *);
+32 -75
include/linux/fs.h
··· 1428 1428 #else 1429 1429 struct list_head s_files; 1430 1430 #endif 1431 + struct list_head s_mounts; /* list of mounts; _not_ for fs use */ 1431 1432 /* s_dentry_lru, s_nr_dentry_unused protected by dcache.c lru locks */ 1432 1433 struct list_head s_dentry_lru; /* unused dentry lru */ 1433 1434 int s_nr_dentry_unused; /* # of dentry on lru */ ··· 1441 1440 struct block_device *s_bdev; 1442 1441 struct backing_dev_info *s_bdi; 1443 1442 struct mtd_info *s_mtd; 1444 - struct list_head s_instances; 1443 + struct hlist_node s_instances; 1445 1444 struct quota_info s_dquot; /* Diskquota specific options */ 1446 1445 1447 1446 int s_frozen; ··· 1482 1481 int cleancache_poolid; 1483 1482 1484 1483 struct shrinker s_shrink; /* per-sb shrinker handle */ 1484 + 1485 + /* Number of inodes with nlink == 0 but still referenced */ 1486 + atomic_long_t s_remove_count; 1487 + 1488 + /* Being remounted read-only */ 1489 + int s_readonly_remount; 1485 1490 }; 1486 1491 1487 1492 /* superblock cache pruning functions */ ··· 1523 1516 /* 1524 1517 * VFS helper functions.. 1525 1518 */ 1526 - extern int vfs_create(struct inode *, struct dentry *, int, struct nameidata *); 1527 - extern int vfs_mkdir(struct inode *, struct dentry *, int); 1528 - extern int vfs_mknod(struct inode *, struct dentry *, int, dev_t); 1519 + extern int vfs_create(struct inode *, struct dentry *, umode_t, struct nameidata *); 1520 + extern int vfs_mkdir(struct inode *, struct dentry *, umode_t); 1521 + extern int vfs_mknod(struct inode *, struct dentry *, umode_t, dev_t); 1529 1522 extern int vfs_symlink(struct inode *, struct dentry *, const char *); 1530 1523 extern int vfs_link(struct dentry *, struct inode *, struct dentry *); 1531 1524 extern int vfs_rmdir(struct inode *, struct dentry *); ··· 1541 1534 * VFS file helper functions. 1542 1535 */ 1543 1536 extern void inode_init_owner(struct inode *inode, const struct inode *dir, 1544 - mode_t mode); 1537 + umode_t mode); 1545 1538 /* 1546 1539 * VFS FS_IOC_FIEMAP helper definitions. 1547 1540 */ ··· 1626 1619 int (*readlink) (struct dentry *, char __user *,int); 1627 1620 void (*put_link) (struct dentry *, struct nameidata *, void *); 1628 1621 1629 - int (*create) (struct inode *,struct dentry *,int, struct nameidata *); 1622 + int (*create) (struct inode *,struct dentry *,umode_t,struct nameidata *); 1630 1623 int (*link) (struct dentry *,struct inode *,struct dentry *); 1631 1624 int (*unlink) (struct inode *,struct dentry *); 1632 1625 int (*symlink) (struct inode *,struct dentry *,const char *); 1633 - int (*mkdir) (struct inode *,struct dentry *,int); 1626 + int (*mkdir) (struct inode *,struct dentry *,umode_t); 1634 1627 int (*rmdir) (struct inode *,struct dentry *); 1635 - int (*mknod) (struct inode *,struct dentry *,int,dev_t); 1628 + int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); 1636 1629 int (*rename) (struct inode *, struct dentry *, 1637 1630 struct inode *, struct dentry *); 1638 1631 void (*truncate) (struct inode *); ··· 1679 1672 int (*remount_fs) (struct super_block *, int *, char *); 1680 1673 void (*umount_begin) (struct super_block *); 1681 1674 1682 - int (*show_options)(struct seq_file *, struct vfsmount *); 1683 - int (*show_devname)(struct seq_file *, struct vfsmount *); 1684 - int (*show_path)(struct seq_file *, struct vfsmount *); 1685 - int (*show_stats)(struct seq_file *, struct vfsmount *); 1675 + int (*show_options)(struct seq_file *, struct dentry *); 1676 + int (*show_devname)(struct seq_file *, struct dentry *); 1677 + int (*show_path)(struct seq_file *, struct dentry *); 1678 + int (*show_stats)(struct seq_file *, struct dentry *); 1686 1679 #ifdef CONFIG_QUOTA 1687 1680 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); 1688 1681 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); ··· 1771 1764 __mark_inode_dirty(inode, I_DIRTY_SYNC); 1772 1765 } 1773 1766 1774 - /** 1775 - * set_nlink - directly set an inode's link count 1776 - * @inode: inode 1777 - * @nlink: new nlink (should be non-zero) 1778 - * 1779 - * This is a low-level filesystem helper to replace any 1780 - * direct filesystem manipulation of i_nlink. 1781 - */ 1782 - static inline void set_nlink(struct inode *inode, unsigned int nlink) 1783 - { 1784 - inode->__i_nlink = nlink; 1785 - } 1786 - 1787 - /** 1788 - * inc_nlink - directly increment an inode's link count 1789 - * @inode: inode 1790 - * 1791 - * This is a low-level filesystem helper to replace any 1792 - * direct filesystem manipulation of i_nlink. Currently, 1793 - * it is only here for parity with dec_nlink(). 1794 - */ 1795 - static inline void inc_nlink(struct inode *inode) 1796 - { 1797 - inode->__i_nlink++; 1798 - } 1767 + extern void inc_nlink(struct inode *inode); 1768 + extern void drop_nlink(struct inode *inode); 1769 + extern void clear_nlink(struct inode *inode); 1770 + extern void set_nlink(struct inode *inode, unsigned int nlink); 1799 1771 1800 1772 static inline void inode_inc_link_count(struct inode *inode) 1801 1773 { 1802 1774 inc_nlink(inode); 1803 1775 mark_inode_dirty(inode); 1804 - } 1805 - 1806 - /** 1807 - * drop_nlink - directly drop an inode's link count 1808 - * @inode: inode 1809 - * 1810 - * This is a low-level filesystem helper to replace any 1811 - * direct filesystem manipulation of i_nlink. In cases 1812 - * where we are attempting to track writes to the 1813 - * filesystem, a decrement to zero means an imminent 1814 - * write when the file is truncated and actually unlinked 1815 - * on the filesystem. 1816 - */ 1817 - static inline void drop_nlink(struct inode *inode) 1818 - { 1819 - inode->__i_nlink--; 1820 - } 1821 - 1822 - /** 1823 - * clear_nlink - directly zero an inode's link count 1824 - * @inode: inode 1825 - * 1826 - * This is a low-level filesystem helper to replace any 1827 - * direct filesystem manipulation of i_nlink. See 1828 - * drop_nlink() for why we care about i_nlink hitting zero. 1829 - */ 1830 - static inline void clear_nlink(struct inode *inode) 1831 - { 1832 - inode->__i_nlink = 0; 1833 1776 } 1834 1777 1835 1778 static inline void inode_dec_link_count(struct inode *inode) ··· 1821 1864 void (*kill_sb) (struct super_block *); 1822 1865 struct module *owner; 1823 1866 struct file_system_type * next; 1824 - struct list_head fs_supers; 1867 + struct hlist_head fs_supers; 1825 1868 1826 1869 struct lock_class_key s_lock_key; 1827 1870 struct lock_class_key s_umount_key; ··· 1896 1939 extern int vfs_statfs(struct path *, struct kstatfs *); 1897 1940 extern int user_statfs(const char __user *, struct kstatfs *); 1898 1941 extern int fd_statfs(int, struct kstatfs *); 1899 - extern int statfs_by_dentry(struct dentry *, struct kstatfs *); 1942 + extern int vfs_ustat(dev_t, struct kstatfs *); 1900 1943 extern int freeze_super(struct super_block *super); 1901 1944 extern int thaw_super(struct super_block *super); 1902 1945 extern bool our_mnt(struct vfsmount *mnt); ··· 2011 2054 extern int do_fallocate(struct file *file, int mode, loff_t offset, 2012 2055 loff_t len); 2013 2056 extern long do_sys_open(int dfd, const char __user *filename, int flags, 2014 - int mode); 2015 - extern struct file *filp_open(const char *, int, int); 2057 + umode_t mode); 2058 + extern struct file *filp_open(const char *, int, umode_t); 2016 2059 extern struct file *file_open_root(struct dentry *, struct vfsmount *, 2017 2060 const char *, int); 2018 2061 extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, ··· 2049 2092 extern void bdput(struct block_device *); 2050 2093 extern void invalidate_bdev(struct block_device *); 2051 2094 extern int sync_blockdev(struct block_device *bdev); 2095 + extern void kill_bdev(struct block_device *); 2052 2096 extern struct super_block *freeze_bdev(struct block_device *); 2053 2097 extern void emergency_thaw_all(void); 2054 2098 extern int thaw_bdev(struct block_device *bdev, struct super_block *sb); ··· 2057 2099 #else 2058 2100 static inline void bd_forget(struct inode *inode) {} 2059 2101 static inline int sync_blockdev(struct block_device *bdev) { return 0; } 2102 + static inline void kill_bdev(struct block_device *bdev) {} 2060 2103 static inline void invalidate_bdev(struct block_device *bdev) {} 2061 2104 2062 2105 static inline struct super_block *freeze_bdev(struct block_device *sb) ··· 2149 2190 extern const struct file_operations read_pipefifo_fops; 2150 2191 extern const struct file_operations write_pipefifo_fops; 2151 2192 extern const struct file_operations rdwr_pipefifo_fops; 2152 - 2153 - extern int fs_may_remount_ro(struct super_block *); 2154 2193 2155 2194 #ifdef CONFIG_BLOCK 2156 2195 /* ··· 2372 2415 unsigned long nr_segs, loff_t pos); 2373 2416 extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, 2374 2417 int datasync); 2418 + extern void block_sync_page(struct page *page); 2375 2419 2376 2420 /* fs/splice.c */ 2377 2421 extern ssize_t generic_file_splice_read(struct file *, loff_t *, ··· 2489 2531 extern struct file_system_type *get_fs_type(const char *name); 2490 2532 extern struct super_block *get_super(struct block_device *); 2491 2533 extern struct super_block *get_active_super(struct block_device *bdev); 2492 - extern struct super_block *user_get_super(dev_t); 2493 2534 extern void drop_super(struct super_block *sb); 2494 2535 extern void iterate_supers(void (*)(struct super_block *, void *), void *); 2495 2536 extern void iterate_supers_type(struct file_system_type *, ··· 2547 2590 2548 2591 extern void file_update_time(struct file *file); 2549 2592 2550 - extern int generic_show_options(struct seq_file *m, struct vfsmount *mnt); 2593 + extern int generic_show_options(struct seq_file *m, struct dentry *root); 2551 2594 extern void save_mount_options(struct super_block *sb, char *options); 2552 2595 extern void replace_mount_options(struct super_block *sb, char *options); 2553 2596 ··· 2648 2691 #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \ 2649 2692 (flag & __FMODE_NONOTIFY))) 2650 2693 2651 - static inline int is_sxid(mode_t mode) 2694 + static inline int is_sxid(umode_t mode) 2652 2695 { 2653 2696 return (mode & S_ISUID) || ((mode & S_ISGID) && (mode & S_IXGRP)); 2654 2697 }
+1 -1
include/linux/genhd.h
··· 163 163 * disks that can't be partitioned. */ 164 164 165 165 char disk_name[DISK_NAME_LEN]; /* name of major driver */ 166 - char *(*devnode)(struct gendisk *gd, mode_t *mode); 166 + char *(*devnode)(struct gendisk *gd, umode_t *mode); 167 167 168 168 unsigned int events; /* supported events */ 169 169 unsigned int async_events; /* async events, subset of all */
+1 -1
include/linux/ide.h
··· 920 920 921 921 typedef struct { 922 922 const char *name; 923 - mode_t mode; 923 + umode_t mode; 924 924 const struct file_operations *proc_fops; 925 925 } ide_proc_entry_t; 926 926
+1 -1
include/linux/ipc.h
··· 93 93 gid_t gid; 94 94 uid_t cuid; 95 95 gid_t cgid; 96 - mode_t mode; 96 + umode_t mode; 97 97 unsigned long seq; 98 98 void *security; 99 99 };
+4 -4
include/linux/iscsi_boot_sysfs.h
··· 91 91 * The enum of the type. This can be any value of the above 92 92 * properties. 93 93 */ 94 - mode_t (*is_visible) (void *data, int type); 94 + umode_t (*is_visible) (void *data, int type); 95 95 96 96 /* 97 97 * Driver specific release function. ··· 110 110 iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index, 111 111 void *data, 112 112 ssize_t (*show) (void *data, int type, char *buf), 113 - mode_t (*is_visible) (void *data, int type), 113 + umode_t (*is_visible) (void *data, int type), 114 114 void (*release) (void *data)); 115 115 116 116 struct iscsi_boot_kobj * 117 117 iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index, 118 118 void *data, 119 119 ssize_t (*show) (void *data, int type, char *buf), 120 - mode_t (*is_visible) (void *data, int type), 120 + umode_t (*is_visible) (void *data, int type), 121 121 void (*release) (void *data)); 122 122 struct iscsi_boot_kobj * 123 123 iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index, 124 124 void *data, 125 125 ssize_t (*show) (void *data, int type, char *buf), 126 - mode_t (*is_visible) (void *data, int type), 126 + umode_t (*is_visible) (void *data, int type), 127 127 void (*release) (void *data)); 128 128 129 129 struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name);
+1 -1
include/linux/miscdevice.h
··· 54 54 struct device *parent; 55 55 struct device *this_device; 56 56 const char *nodename; 57 - mode_t mode; 57 + umode_t mode; 58 58 }; 59 59 60 60 extern int misc_register(struct miscdevice * misc);
+4 -27
include/linux/mnt_namespace.h
··· 2 2 #define _NAMESPACE_H_ 3 3 #ifdef __KERNEL__ 4 4 5 - #include <linux/path.h> 6 - #include <linux/seq_file.h> 7 - #include <linux/wait.h> 8 - 9 - struct mnt_namespace { 10 - atomic_t count; 11 - struct vfsmount * root; 12 - struct list_head list; 13 - wait_queue_head_t poll; 14 - int event; 15 - }; 16 - 17 - struct proc_mounts { 18 - struct seq_file m; /* must be the first element */ 19 - struct mnt_namespace *ns; 20 - struct path root; 21 - }; 22 - 5 + struct mnt_namespace; 23 6 struct fs_struct; 24 7 25 - extern struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt); 26 8 extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, 27 9 struct fs_struct *); 28 10 extern void put_mnt_ns(struct mnt_namespace *ns); 29 - static inline void get_mnt_ns(struct mnt_namespace *ns) 30 - { 31 - atomic_inc(&ns->count); 32 - } 33 11 34 - extern const struct seq_operations mounts_op; 35 - extern const struct seq_operations mountinfo_op; 36 - extern const struct seq_operations mountstats_op; 37 - extern int mnt_had_events(struct proc_mounts *); 12 + extern const struct file_operations proc_mounts_operations; 13 + extern const struct file_operations proc_mountinfo_operations; 14 + extern const struct file_operations proc_mountstats_operations; 38 15 39 16 #endif 40 17 #endif
+1 -38
include/linux/mount.h
··· 47 47 48 48 #define MNT_INTERNAL 0x4000 49 49 50 - struct mnt_pcp { 51 - int mnt_count; 52 - int mnt_writers; 53 - }; 54 - 55 50 struct vfsmount { 56 - struct list_head mnt_hash; 57 - struct vfsmount *mnt_parent; /* fs we are mounted on */ 58 - struct dentry *mnt_mountpoint; /* dentry of mountpoint */ 59 51 struct dentry *mnt_root; /* root of the mounted tree */ 60 52 struct super_block *mnt_sb; /* pointer to superblock */ 61 - #ifdef CONFIG_SMP 62 - struct mnt_pcp __percpu *mnt_pcp; 63 - atomic_t mnt_longterm; /* how many of the refs are longterm */ 64 - #else 65 - int mnt_count; 66 - int mnt_writers; 67 - #endif 68 - struct list_head mnt_mounts; /* list of children, anchored here */ 69 - struct list_head mnt_child; /* and going through their mnt_child */ 70 53 int mnt_flags; 71 - /* 4 bytes hole on 64bits arches without fsnotify */ 72 - #ifdef CONFIG_FSNOTIFY 73 - __u32 mnt_fsnotify_mask; 74 - struct hlist_head mnt_fsnotify_marks; 75 - #endif 76 - const char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ 77 - struct list_head mnt_list; 78 - struct list_head mnt_expire; /* link in fs-specific expiry list */ 79 - struct list_head mnt_share; /* circular list of shared mounts */ 80 - struct list_head mnt_slave_list;/* list of slave mounts */ 81 - struct list_head mnt_slave; /* slave list entry */ 82 - struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ 83 - struct mnt_namespace *mnt_ns; /* containing namespace */ 84 - int mnt_id; /* mount identifier */ 85 - int mnt_group_id; /* peer group identifier */ 86 - int mnt_expiry_mark; /* true if marked for expiry */ 87 - int mnt_pinned; 88 - int mnt_ghosts; 89 54 }; 90 55 91 56 struct file; /* forward dec */ ··· 59 94 extern int mnt_want_write_file(struct file *file); 60 95 extern int mnt_clone_write(struct vfsmount *mnt); 61 96 extern void mnt_drop_write(struct vfsmount *mnt); 97 + extern void mnt_drop_write_file(struct file *file); 62 98 extern void mntput(struct vfsmount *mnt); 63 99 extern struct vfsmount *mntget(struct vfsmount *mnt); 64 100 extern void mnt_pin(struct vfsmount *mnt); 65 101 extern void mnt_unpin(struct vfsmount *mnt); 66 102 extern int __mnt_is_readonly(struct vfsmount *mnt); 67 - 68 - extern struct vfsmount *do_kern_mount(const char *fstype, int flags, 69 - const char *name, void *data); 70 103 71 104 struct file_system_type; 72 105 extern struct vfsmount *vfs_kern_mount(struct file_system_type *type,
+1 -1
include/linux/nfs_fs.h
··· 373 373 extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); 374 374 extern void put_nfs_open_context(struct nfs_open_context *ctx); 375 375 extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); 376 - extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rpc_cred *cred, fmode_t f_mode); 376 + extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f_mode); 377 377 extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx); 378 378 extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); 379 379 extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx);
+12 -12
include/linux/proc_fs.h
··· 50 50 51 51 struct proc_dir_entry { 52 52 unsigned int low_ino; 53 - mode_t mode; 53 + umode_t mode; 54 54 nlink_t nlink; 55 55 uid_t uid; 56 56 gid_t gid; ··· 106 106 107 107 void proc_flush_task(struct task_struct *task); 108 108 109 - extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, 109 + extern struct proc_dir_entry *create_proc_entry(const char *name, umode_t mode, 110 110 struct proc_dir_entry *parent); 111 - struct proc_dir_entry *proc_create_data(const char *name, mode_t mode, 111 + struct proc_dir_entry *proc_create_data(const char *name, umode_t mode, 112 112 struct proc_dir_entry *parent, 113 113 const struct file_operations *proc_fops, 114 114 void *data); ··· 146 146 extern struct proc_dir_entry *proc_symlink(const char *, 147 147 struct proc_dir_entry *, const char *); 148 148 extern struct proc_dir_entry *proc_mkdir(const char *,struct proc_dir_entry *); 149 - extern struct proc_dir_entry *proc_mkdir_mode(const char *name, mode_t mode, 149 + extern struct proc_dir_entry *proc_mkdir_mode(const char *name, umode_t mode, 150 150 struct proc_dir_entry *parent); 151 151 152 - static inline struct proc_dir_entry *proc_create(const char *name, mode_t mode, 152 + static inline struct proc_dir_entry *proc_create(const char *name, umode_t mode, 153 153 struct proc_dir_entry *parent, const struct file_operations *proc_fops) 154 154 { 155 155 return proc_create_data(name, mode, parent, proc_fops, NULL); 156 156 } 157 157 158 158 static inline struct proc_dir_entry *create_proc_read_entry(const char *name, 159 - mode_t mode, struct proc_dir_entry *base, 159 + umode_t mode, struct proc_dir_entry *base, 160 160 read_proc_t *read_proc, void * data) 161 161 { 162 162 struct proc_dir_entry *res=create_proc_entry(name,mode,base); ··· 168 168 } 169 169 170 170 extern struct proc_dir_entry *proc_net_fops_create(struct net *net, 171 - const char *name, mode_t mode, const struct file_operations *fops); 171 + const char *name, umode_t mode, const struct file_operations *fops); 172 172 extern void proc_net_remove(struct net *net, const char *name); 173 173 extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name, 174 174 struct proc_dir_entry *parent); ··· 185 185 } 186 186 187 187 static inline struct proc_dir_entry *create_proc_entry(const char *name, 188 - mode_t mode, struct proc_dir_entry *parent) { return NULL; } 188 + umode_t mode, struct proc_dir_entry *parent) { return NULL; } 189 189 static inline struct proc_dir_entry *proc_create(const char *name, 190 - mode_t mode, struct proc_dir_entry *parent, 190 + umode_t mode, struct proc_dir_entry *parent, 191 191 const struct file_operations *proc_fops) 192 192 { 193 193 return NULL; 194 194 } 195 195 static inline struct proc_dir_entry *proc_create_data(const char *name, 196 - mode_t mode, struct proc_dir_entry *parent, 196 + umode_t mode, struct proc_dir_entry *parent, 197 197 const struct file_operations *proc_fops, void *data) 198 198 { 199 199 return NULL; ··· 205 205 static inline struct proc_dir_entry *proc_mkdir(const char *name, 206 206 struct proc_dir_entry *parent) {return NULL;} 207 207 static inline struct proc_dir_entry *proc_mkdir_mode(const char *name, 208 - mode_t mode, struct proc_dir_entry *parent) { return NULL; } 208 + umode_t mode, struct proc_dir_entry *parent) { return NULL; } 209 209 210 210 static inline struct proc_dir_entry *create_proc_read_entry(const char *name, 211 - mode_t mode, struct proc_dir_entry *base, 211 + umode_t mode, struct proc_dir_entry *base, 212 212 read_proc_t *read_proc, void * data) { return NULL; } 213 213 214 214 struct tty_driver;
+1 -1
include/linux/ramfs.h
··· 2 2 #define _LINUX_RAMFS_H 3 3 4 4 struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir, 5 - int mode, dev_t dev); 5 + umode_t mode, dev_t dev); 6 6 extern struct dentry *ramfs_mount(struct file_system_type *fs_type, 7 7 int flags, const char *dev_name, void *data); 8 8
+5 -4
include/linux/reiserfs_fs.h
··· 1759 1759 REISERFS_QUOTA_TRANS_BLOCKS(sb))) 1760 1760 1761 1761 #ifdef CONFIG_QUOTA 1762 + #define REISERFS_QUOTA_OPTS ((1 << REISERFS_USRQUOTA) | (1 << REISERFS_GRPQUOTA)) 1762 1763 /* We need to update data and inode (atime) */ 1763 - #define REISERFS_QUOTA_TRANS_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? 2 : 0) 1764 + #define REISERFS_QUOTA_TRANS_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & REISERFS_QUOTA_OPTS ? 2 : 0) 1764 1765 /* 1 balancing, 1 bitmap, 1 data per write + stat data update */ 1765 - #define REISERFS_QUOTA_INIT_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? \ 1766 + #define REISERFS_QUOTA_INIT_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & REISERFS_QUOTA_OPTS ? \ 1766 1767 (DQUOT_INIT_ALLOC*(JOURNAL_PER_BALANCE_CNT+2)+DQUOT_INIT_REWRITE+1) : 0) 1767 1768 /* same as with INIT */ 1768 - #define REISERFS_QUOTA_DEL_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? \ 1769 + #define REISERFS_QUOTA_DEL_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & REISERFS_QUOTA_OPTS ? \ 1769 1770 (DQUOT_DEL_ALLOC*(JOURNAL_PER_BALANCE_CNT+2)+DQUOT_DEL_REWRITE+1) : 0) 1770 1771 #else 1771 1772 #define REISERFS_QUOTA_TRANS_BLOCKS(s) 0 ··· 2057 2056 2058 2057 struct reiserfs_security_handle; 2059 2058 int reiserfs_new_inode(struct reiserfs_transaction_handle *th, 2060 - struct inode *dir, int mode, 2059 + struct inode *dir, umode_t mode, 2061 2060 const char *symname, loff_t i_size, 2062 2061 struct dentry *dentry, struct inode *inode, 2063 2062 struct reiserfs_security_handle *security);
+3 -1
include/linux/reiserfs_fs_sb.h
··· 417 417 char *s_qf_names[MAXQUOTAS]; 418 418 int s_jquota_fmt; 419 419 #endif 420 + char *s_jdev; /* Stored jdev for mount option showing */ 420 421 #ifdef CONFIG_REISERFS_CHECK 421 422 422 423 struct tree_balance *cur_tb; /* ··· 483 482 REISERFS_ERROR_RO, 484 483 REISERFS_ERROR_CONTINUE, 485 484 486 - REISERFS_QUOTA, /* Some quota option specified */ 485 + REISERFS_USRQUOTA, /* User quota option specified */ 486 + REISERFS_GRPQUOTA, /* Group quota option specified */ 487 487 488 488 REISERFS_TEST1, 489 489 REISERFS_TEST2,
+1 -1
include/linux/relay.h
··· 144 144 */ 145 145 struct dentry *(*create_buf_file)(const char *filename, 146 146 struct dentry *parent, 147 - int mode, 147 + umode_t mode, 148 148 struct rchan_buf *buf, 149 149 int *is_global); 150 150
+18 -22
include/linux/security.h
··· 1424 1424 1425 1425 #ifdef CONFIG_SECURITY_PATH 1426 1426 int (*path_unlink) (struct path *dir, struct dentry *dentry); 1427 - int (*path_mkdir) (struct path *dir, struct dentry *dentry, int mode); 1427 + int (*path_mkdir) (struct path *dir, struct dentry *dentry, umode_t mode); 1428 1428 int (*path_rmdir) (struct path *dir, struct dentry *dentry); 1429 - int (*path_mknod) (struct path *dir, struct dentry *dentry, int mode, 1429 + int (*path_mknod) (struct path *dir, struct dentry *dentry, umode_t mode, 1430 1430 unsigned int dev); 1431 1431 int (*path_truncate) (struct path *path); 1432 1432 int (*path_symlink) (struct path *dir, struct dentry *dentry, ··· 1435 1435 struct dentry *new_dentry); 1436 1436 int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, 1437 1437 struct path *new_dir, struct dentry *new_dentry); 1438 - int (*path_chmod) (struct dentry *dentry, struct vfsmount *mnt, 1439 - mode_t mode); 1438 + int (*path_chmod) (struct path *path, umode_t mode); 1440 1439 int (*path_chown) (struct path *path, uid_t uid, gid_t gid); 1441 1440 int (*path_chroot) (struct path *path); 1442 1441 #endif ··· 1446 1447 const struct qstr *qstr, char **name, 1447 1448 void **value, size_t *len); 1448 1449 int (*inode_create) (struct inode *dir, 1449 - struct dentry *dentry, int mode); 1450 + struct dentry *dentry, umode_t mode); 1450 1451 int (*inode_link) (struct dentry *old_dentry, 1451 1452 struct inode *dir, struct dentry *new_dentry); 1452 1453 int (*inode_unlink) (struct inode *dir, struct dentry *dentry); 1453 1454 int (*inode_symlink) (struct inode *dir, 1454 1455 struct dentry *dentry, const char *old_name); 1455 - int (*inode_mkdir) (struct inode *dir, struct dentry *dentry, int mode); 1456 + int (*inode_mkdir) (struct inode *dir, struct dentry *dentry, umode_t mode); 1456 1457 int (*inode_rmdir) (struct inode *dir, struct dentry *dentry); 1457 1458 int (*inode_mknod) (struct inode *dir, struct dentry *dentry, 1458 - int mode, dev_t dev); 1459 + umode_t mode, dev_t dev); 1459 1460 int (*inode_rename) (struct inode *old_dir, struct dentry *old_dentry, 1460 1461 struct inode *new_dir, struct dentry *new_dentry); 1461 1462 int (*inode_readlink) (struct dentry *dentry); ··· 1715 1716 int security_old_inode_init_security(struct inode *inode, struct inode *dir, 1716 1717 const struct qstr *qstr, char **name, 1717 1718 void **value, size_t *len); 1718 - int security_inode_create(struct inode *dir, struct dentry *dentry, int mode); 1719 + int security_inode_create(struct inode *dir, struct dentry *dentry, umode_t mode); 1719 1720 int security_inode_link(struct dentry *old_dentry, struct inode *dir, 1720 1721 struct dentry *new_dentry); 1721 1722 int security_inode_unlink(struct inode *dir, struct dentry *dentry); 1722 1723 int security_inode_symlink(struct inode *dir, struct dentry *dentry, 1723 1724 const char *old_name); 1724 - int security_inode_mkdir(struct inode *dir, struct dentry *dentry, int mode); 1725 + int security_inode_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode); 1725 1726 int security_inode_rmdir(struct inode *dir, struct dentry *dentry); 1726 - int security_inode_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev); 1727 + int security_inode_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev); 1727 1728 int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry, 1728 1729 struct inode *new_dir, struct dentry *new_dentry); 1729 1730 int security_inode_readlink(struct dentry *dentry); ··· 2060 2061 2061 2062 static inline int security_inode_create(struct inode *dir, 2062 2063 struct dentry *dentry, 2063 - int mode) 2064 + umode_t mode) 2064 2065 { 2065 2066 return 0; 2066 2067 } ··· 2854 2855 2855 2856 #ifdef CONFIG_SECURITY_PATH 2856 2857 int security_path_unlink(struct path *dir, struct dentry *dentry); 2857 - int security_path_mkdir(struct path *dir, struct dentry *dentry, int mode); 2858 + int security_path_mkdir(struct path *dir, struct dentry *dentry, umode_t mode); 2858 2859 int security_path_rmdir(struct path *dir, struct dentry *dentry); 2859 - int security_path_mknod(struct path *dir, struct dentry *dentry, int mode, 2860 + int security_path_mknod(struct path *dir, struct dentry *dentry, umode_t mode, 2860 2861 unsigned int dev); 2861 2862 int security_path_truncate(struct path *path); 2862 2863 int security_path_symlink(struct path *dir, struct dentry *dentry, ··· 2865 2866 struct dentry *new_dentry); 2866 2867 int security_path_rename(struct path *old_dir, struct dentry *old_dentry, 2867 2868 struct path *new_dir, struct dentry *new_dentry); 2868 - int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, 2869 - mode_t mode); 2869 + int security_path_chmod(struct path *path, umode_t mode); 2870 2870 int security_path_chown(struct path *path, uid_t uid, gid_t gid); 2871 2871 int security_path_chroot(struct path *path); 2872 2872 #else /* CONFIG_SECURITY_PATH */ ··· 2875 2877 } 2876 2878 2877 2879 static inline int security_path_mkdir(struct path *dir, struct dentry *dentry, 2878 - int mode) 2880 + umode_t mode) 2879 2881 { 2880 2882 return 0; 2881 2883 } ··· 2886 2888 } 2887 2889 2888 2890 static inline int security_path_mknod(struct path *dir, struct dentry *dentry, 2889 - int mode, unsigned int dev) 2891 + umode_t mode, unsigned int dev) 2890 2892 { 2891 2893 return 0; 2892 2894 } ··· 2917 2919 return 0; 2918 2920 } 2919 2921 2920 - static inline int security_path_chmod(struct dentry *dentry, 2921 - struct vfsmount *mnt, 2922 - mode_t mode) 2922 + static inline int security_path_chmod(struct path *path, umode_t mode) 2923 2923 { 2924 2924 return 0; 2925 2925 } ··· 3006 3010 3007 3011 #ifdef CONFIG_SECURITYFS 3008 3012 3009 - extern struct dentry *securityfs_create_file(const char *name, mode_t mode, 3013 + extern struct dentry *securityfs_create_file(const char *name, umode_t mode, 3010 3014 struct dentry *parent, void *data, 3011 3015 const struct file_operations *fops); 3012 3016 extern struct dentry *securityfs_create_dir(const char *name, struct dentry *parent); ··· 3021 3025 } 3022 3026 3023 3027 static inline struct dentry *securityfs_create_file(const char *name, 3024 - mode_t mode, 3028 + umode_t mode, 3025 3029 struct dentry *parent, 3026 3030 void *data, 3027 3031 const struct file_operations *fops)
+5 -5
include/linux/seq_file.h
··· 74 74 } 75 75 } 76 76 77 - char *mangle_path(char *s, char *p, char *esc); 77 + char *mangle_path(char *s, const char *p, const char *esc); 78 78 int seq_open(struct file *, const struct seq_operations *); 79 79 ssize_t seq_read(struct file *, char __user *, size_t, loff_t *); 80 80 loff_t seq_lseek(struct file *, loff_t, int); ··· 86 86 87 87 __printf(2, 3) int seq_printf(struct seq_file *, const char *, ...); 88 88 89 - int seq_path(struct seq_file *, struct path *, char *); 90 - int seq_dentry(struct seq_file *, struct dentry *, char *); 91 - int seq_path_root(struct seq_file *m, struct path *path, struct path *root, 92 - char *esc); 89 + int seq_path(struct seq_file *, const struct path *, const char *); 90 + int seq_dentry(struct seq_file *, struct dentry *, const char *); 91 + int seq_path_root(struct seq_file *m, const struct path *path, 92 + const struct path *root, const char *esc); 93 93 int seq_bitmap(struct seq_file *m, const unsigned long *bits, 94 94 unsigned int nr_bits); 95 95 static inline int seq_cpumask(struct seq_file *m, const struct cpumask *mask)
+1 -1
include/linux/shmem_fs.h
··· 30 30 spinlock_t stat_lock; /* Serialize shmem_sb_info changes */ 31 31 uid_t uid; /* Mount uid for root directory */ 32 32 gid_t gid; /* Mount gid for root directory */ 33 - mode_t mode; /* Mount mode for root directory */ 33 + umode_t mode; /* Mount mode for root directory */ 34 34 struct mempolicy *mpol; /* default memory policy for mappings */ 35 35 }; 36 36
+1 -1
include/linux/sunrpc/cache.h
··· 203 203 extern void cache_unregister_net(struct cache_detail *cd, struct net *net); 204 204 205 205 extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *, 206 - mode_t, struct cache_detail *); 206 + umode_t, struct cache_detail *); 207 207 extern void sunrpc_cache_unregister_pipefs(struct cache_detail *); 208 208 209 209 extern void qword_add(char **bpp, int *lp, char *str);
+1 -1
include/linux/sunrpc/rpc_pipe_fs.h
··· 55 55 struct cache_detail; 56 56 extern struct dentry *rpc_create_cache_dir(struct dentry *, 57 57 struct qstr *, 58 - mode_t umode, 58 + umode_t umode, 59 59 struct cache_detail *); 60 60 extern void rpc_remove_cache_dir(struct dentry *); 61 61
+12 -12
include/linux/syscalls.h
··· 475 475 asmlinkage long sys_pivot_root(const char __user *new_root, 476 476 const char __user *put_old); 477 477 asmlinkage long sys_chroot(const char __user *filename); 478 - asmlinkage long sys_mknod(const char __user *filename, int mode, 478 + asmlinkage long sys_mknod(const char __user *filename, umode_t mode, 479 479 unsigned dev); 480 480 asmlinkage long sys_link(const char __user *oldname, 481 481 const char __user *newname); ··· 483 483 asmlinkage long sys_unlink(const char __user *pathname); 484 484 asmlinkage long sys_rename(const char __user *oldname, 485 485 const char __user *newname); 486 - asmlinkage long sys_chmod(const char __user *filename, mode_t mode); 487 - asmlinkage long sys_fchmod(unsigned int fd, mode_t mode); 486 + asmlinkage long sys_chmod(const char __user *filename, umode_t mode); 487 + asmlinkage long sys_fchmod(unsigned int fd, umode_t mode); 488 488 489 489 asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg); 490 490 #if BITS_PER_LONG == 32 ··· 517 517 loff_t __user *offset, size_t count); 518 518 asmlinkage long sys_readlink(const char __user *path, 519 519 char __user *buf, int bufsiz); 520 - asmlinkage long sys_creat(const char __user *pathname, int mode); 520 + asmlinkage long sys_creat(const char __user *pathname, umode_t mode); 521 521 asmlinkage long sys_open(const char __user *filename, 522 - int flags, int mode); 522 + int flags, umode_t mode); 523 523 asmlinkage long sys_close(unsigned int fd); 524 524 asmlinkage long sys_access(const char __user *filename, int mode); 525 525 asmlinkage long sys_vhangup(void); ··· 582 582 asmlinkage long sys_pwritev(unsigned long fd, const struct iovec __user *vec, 583 583 unsigned long vlen, unsigned long pos_l, unsigned long pos_h); 584 584 asmlinkage long sys_getcwd(char __user *buf, unsigned long size); 585 - asmlinkage long sys_mkdir(const char __user *pathname, int mode); 585 + asmlinkage long sys_mkdir(const char __user *pathname, umode_t mode); 586 586 asmlinkage long sys_chdir(const char __user *filename); 587 587 asmlinkage long sys_fchdir(unsigned int fd); 588 588 asmlinkage long sys_rmdir(const char __user *pathname); ··· 679 679 asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second, 680 680 unsigned long third, void __user *ptr, long fifth); 681 681 682 - asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); 682 + asmlinkage long sys_mq_open(const char __user *name, int oflag, umode_t mode, struct mq_attr __user *attr); 683 683 asmlinkage long sys_mq_unlink(const char __user *name); 684 684 asmlinkage long sys_mq_timedsend(mqd_t mqdes, const char __user *msg_ptr, size_t msg_len, unsigned int msg_prio, const struct timespec __user *abs_timeout); 685 685 asmlinkage long sys_mq_timedreceive(mqd_t mqdes, char __user *msg_ptr, size_t msg_len, unsigned int __user *msg_prio, const struct timespec __user *abs_timeout); ··· 753 753 asmlinkage long sys_spu_run(int fd, __u32 __user *unpc, 754 754 __u32 __user *ustatus); 755 755 asmlinkage long sys_spu_create(const char __user *name, 756 - unsigned int flags, mode_t mode, int fd); 756 + unsigned int flags, umode_t mode, int fd); 757 757 758 - asmlinkage long sys_mknodat(int dfd, const char __user * filename, int mode, 758 + asmlinkage long sys_mknodat(int dfd, const char __user * filename, umode_t mode, 759 759 unsigned dev); 760 - asmlinkage long sys_mkdirat(int dfd, const char __user * pathname, int mode); 760 + asmlinkage long sys_mkdirat(int dfd, const char __user * pathname, umode_t mode); 761 761 asmlinkage long sys_unlinkat(int dfd, const char __user * pathname, int flag); 762 762 asmlinkage long sys_symlinkat(const char __user * oldname, 763 763 int newdfd, const char __user * newname); ··· 769 769 struct timeval __user *utimes); 770 770 asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode); 771 771 asmlinkage long sys_fchmodat(int dfd, const char __user * filename, 772 - mode_t mode); 772 + umode_t mode); 773 773 asmlinkage long sys_fchownat(int dfd, const char __user *filename, uid_t user, 774 774 gid_t group, int flag); 775 775 asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, 776 - int mode); 776 + umode_t mode); 777 777 asmlinkage long sys_newfstatat(int dfd, const char __user *filename, 778 778 struct stat __user *statbuf, int flag); 779 779 asmlinkage long sys_fstatat64(int dfd, const char __user *filename,
+1 -1
include/linux/sysctl.h
··· 1038 1038 const char *procname; /* Text ID for /proc/sys, or zero */ 1039 1039 void *data; 1040 1040 int maxlen; 1041 - mode_t mode; 1041 + umode_t mode; 1042 1042 struct ctl_table *child; 1043 1043 struct ctl_table *parent; /* Automatically set */ 1044 1044 proc_handler *proc_handler; /* Callback for text formatting */
+4 -4
include/linux/sysfs.h
··· 25 25 26 26 struct attribute { 27 27 const char *name; 28 - mode_t mode; 28 + umode_t mode; 29 29 #ifdef CONFIG_DEBUG_LOCK_ALLOC 30 30 struct lock_class_key *key; 31 31 struct lock_class_key skey; ··· 55 55 56 56 struct attribute_group { 57 57 const char *name; 58 - mode_t (*is_visible)(struct kobject *, 58 + umode_t (*is_visible)(struct kobject *, 59 59 struct attribute *, int); 60 60 struct attribute **attrs; 61 61 }; ··· 133 133 int __must_check sysfs_create_files(struct kobject *kobj, 134 134 const struct attribute **attr); 135 135 int __must_check sysfs_chmod_file(struct kobject *kobj, 136 - const struct attribute *attr, mode_t mode); 136 + const struct attribute *attr, umode_t mode); 137 137 void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr); 138 138 void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr); 139 139 ··· 221 221 } 222 222 223 223 static inline int sysfs_chmod_file(struct kobject *kobj, 224 - const struct attribute *attr, mode_t mode) 224 + const struct attribute *attr, umode_t mode) 225 225 { 226 226 return 0; 227 227 }
+1
include/linux/types.h
··· 24 24 typedef __kernel_dev_t dev_t; 25 25 typedef __kernel_ino_t ino_t; 26 26 typedef __kernel_mode_t mode_t; 27 + typedef unsigned short umode_t; 27 28 typedef __kernel_nlink_t nlink_t; 28 29 typedef __kernel_off_t off_t; 29 30 typedef __kernel_pid_t pid_t;
+1 -1
include/linux/usb.h
··· 935 935 */ 936 936 struct usb_class_driver { 937 937 char *name; 938 - char *(*devnode)(struct device *dev, mode_t *mode); 938 + char *(*devnode)(struct device *dev, umode_t *mode); 939 939 const struct file_operations *fops; 940 940 int minor_base; 941 941 };
+1 -1
include/scsi/scsi_transport_iscsi.h
··· 142 142 int (*get_iface_param) (struct iscsi_iface *iface, 143 143 enum iscsi_param_type param_type, 144 144 int param, char *buf); 145 - mode_t (*attr_is_visible)(int param_type, int param); 145 + umode_t (*attr_is_visible)(int param_type, int param); 146 146 int (*bsg_request)(struct bsg_job *job); 147 147 }; 148 148
+1 -1
include/sound/info.h
··· 72 72 73 73 struct snd_info_entry { 74 74 const char *name; 75 - mode_t mode; 75 + umode_t mode; 76 76 long size; 77 77 unsigned short content; 78 78 union {
+6 -4
init/do_mounts.c
··· 325 325 326 326 static int __init do_mount_root(char *name, char *fs, int flags, void *data) 327 327 { 328 + struct super_block *s; 328 329 int err = sys_mount(name, "/root", fs, flags, data); 329 330 if (err) 330 331 return err; 331 332 332 333 sys_chdir((const char __user __force *)"/root"); 333 - ROOT_DEV = current->fs->pwd.mnt->mnt_sb->s_dev; 334 + s = current->fs->pwd.dentry->d_sb; 335 + ROOT_DEV = s->s_dev; 334 336 printk(KERN_INFO 335 337 "VFS: Mounted root (%s filesystem)%s on device %u:%u.\n", 336 - current->fs->pwd.mnt->mnt_sb->s_type->name, 337 - current->fs->pwd.mnt->mnt_sb->s_flags & MS_RDONLY ? 338 - " readonly" : "", MAJOR(ROOT_DEV), MINOR(ROOT_DEV)); 338 + s->s_type->name, 339 + s->s_flags & MS_RDONLY ? " readonly" : "", 340 + MAJOR(ROOT_DEV), MINOR(ROOT_DEV)); 339 341 return 0; 340 342 } 341 343
+4 -4
init/initramfs.c
··· 22 22 23 23 static __initdata struct hash { 24 24 int ino, minor, major; 25 - mode_t mode; 25 + umode_t mode; 26 26 struct hash *next; 27 27 char name[N_ALIGN(PATH_MAX)]; 28 28 } *head[32]; ··· 35 35 } 36 36 37 37 static char __init *find_link(int major, int minor, int ino, 38 - mode_t mode, char *name) 38 + umode_t mode, char *name) 39 39 { 40 40 struct hash **p, *q; 41 41 for (p = head + hash(major, minor, ino); *p; p = &(*p)->next) { ··· 120 120 /* cpio header parsing */ 121 121 122 122 static __initdata unsigned long ino, major, minor, nlink; 123 - static __initdata mode_t mode; 123 + static __initdata umode_t mode; 124 124 static __initdata unsigned long body_len, name_len; 125 125 static __initdata uid_t uid; 126 126 static __initdata gid_t gid; ··· 276 276 return 0; 277 277 } 278 278 279 - static void __init clean_path(char *path, mode_t mode) 279 + static void __init clean_path(char *path, umode_t mode) 280 280 { 281 281 struct stat st; 282 282
+4 -5
ipc/mqueue.c
··· 108 108 } 109 109 110 110 static struct inode *mqueue_get_inode(struct super_block *sb, 111 - struct ipc_namespace *ipc_ns, int mode, 111 + struct ipc_namespace *ipc_ns, umode_t mode, 112 112 struct mq_attr *attr) 113 113 { 114 114 struct user_struct *u = current_user(); ··· 243 243 static void mqueue_i_callback(struct rcu_head *head) 244 244 { 245 245 struct inode *inode = container_of(head, struct inode, i_rcu); 246 - INIT_LIST_HEAD(&inode->i_dentry); 247 246 kmem_cache_free(mqueue_inode_cachep, MQUEUE_I(inode)); 248 247 } 249 248 ··· 295 296 } 296 297 297 298 static int mqueue_create(struct inode *dir, struct dentry *dentry, 298 - int mode, struct nameidata *nd) 299 + umode_t mode, struct nameidata *nd) 299 300 { 300 301 struct inode *inode; 301 302 struct mq_attr *attr = dentry->d_fsdata; ··· 610 611 * Invoked when creating a new queue via sys_mq_open 611 612 */ 612 613 static struct file *do_create(struct ipc_namespace *ipc_ns, struct dentry *dir, 613 - struct dentry *dentry, int oflag, mode_t mode, 614 + struct dentry *dentry, int oflag, umode_t mode, 614 615 struct mq_attr *attr) 615 616 { 616 617 const struct cred *cred = current_cred(); ··· 679 680 return ERR_PTR(ret); 680 681 } 681 682 682 - SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, mode_t, mode, 683 + SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, umode_t, mode, 683 684 struct mq_attr __user *, u_attr) 684 685 { 685 686 struct dentry *dentry;
+11 -31
kernel/acct.c
··· 84 84 * the cache line to have the data after getting the lock. 85 85 */ 86 86 struct bsd_acct_struct { 87 - volatile int active; 88 - volatile int needcheck; 87 + int active; 88 + unsigned long needcheck; 89 89 struct file *file; 90 90 struct pid_namespace *ns; 91 - struct timer_list timer; 92 91 struct list_head list; 93 92 }; 94 93 95 94 static DEFINE_SPINLOCK(acct_lock); 96 95 static LIST_HEAD(acct_list); 97 - 98 - /* 99 - * Called whenever the timer says to check the free space. 100 - */ 101 - static void acct_timeout(unsigned long x) 102 - { 103 - struct bsd_acct_struct *acct = (struct bsd_acct_struct *)x; 104 - acct->needcheck = 1; 105 - } 106 96 107 97 /* 108 98 * Check the amount of free space and suspend/resume accordingly. ··· 102 112 struct kstatfs sbuf; 103 113 int res; 104 114 int act; 105 - sector_t resume; 106 - sector_t suspend; 115 + u64 resume; 116 + u64 suspend; 107 117 108 118 spin_lock(&acct_lock); 109 119 res = acct->active; 110 - if (!file || !acct->needcheck) 120 + if (!file || time_is_before_jiffies(acct->needcheck)) 111 121 goto out; 112 122 spin_unlock(&acct_lock); 113 123 ··· 117 127 suspend = sbuf.f_blocks * SUSPEND; 118 128 resume = sbuf.f_blocks * RESUME; 119 129 120 - sector_div(suspend, 100); 121 - sector_div(resume, 100); 130 + do_div(suspend, 100); 131 + do_div(resume, 100); 122 132 123 133 if (sbuf.f_bavail <= suspend) 124 134 act = -1; ··· 150 160 } 151 161 } 152 162 153 - del_timer(&acct->timer); 154 - acct->needcheck = 0; 155 - acct->timer.expires = jiffies + ACCT_TIMEOUT*HZ; 156 - add_timer(&acct->timer); 163 + acct->needcheck = jiffies + ACCT_TIMEOUT*HZ; 157 164 res = acct->active; 158 165 out: 159 166 spin_unlock(&acct_lock); ··· 172 185 if (acct->file) { 173 186 old_acct = acct->file; 174 187 old_ns = acct->ns; 175 - del_timer(&acct->timer); 176 188 acct->active = 0; 177 - acct->needcheck = 0; 178 189 acct->file = NULL; 179 190 acct->ns = NULL; 180 191 list_del(&acct->list); ··· 180 195 if (file) { 181 196 acct->file = file; 182 197 acct->ns = ns; 183 - acct->needcheck = 0; 198 + acct->needcheck = jiffies + ACCT_TIMEOUT*HZ; 184 199 acct->active = 1; 185 200 list_add(&acct->list, &acct_list); 186 - /* It's been deleted if it was used before so this is safe */ 187 - setup_timer(&acct->timer, acct_timeout, (unsigned long)acct); 188 - acct->timer.expires = jiffies + ACCT_TIMEOUT*HZ; 189 - add_timer(&acct->timer); 190 201 } 191 202 if (old_acct) { 192 203 mnt_unpin(old_acct->f_path.mnt); ··· 315 334 spin_lock(&acct_lock); 316 335 restart: 317 336 list_for_each_entry(acct, &acct_list, list) 318 - if (acct->file && acct->file->f_path.mnt->mnt_sb == sb) { 337 + if (acct->file && acct->file->f_path.dentry->d_sb == sb) { 319 338 acct_file_reopen(acct, NULL, NULL); 320 339 goto restart; 321 340 } ··· 329 348 if (acct == NULL) 330 349 return; 331 350 332 - del_timer_sync(&acct->timer); 333 351 spin_lock(&acct_lock); 334 352 if (acct->file != NULL) 335 353 acct_file_reopen(acct, NULL, NULL); ··· 478 498 * Fill the accounting struct with the needed info as recorded 479 499 * by the different kernel functions. 480 500 */ 481 - memset((caddr_t)&ac, 0, sizeof(acct_t)); 501 + memset(&ac, 0, sizeof(acct_t)); 482 502 483 503 ac.ac_version = ACCT_VERSION | ACCT_BYTEORDER; 484 504 strlcpy(ac.ac_comm, current->comm, sizeof(ac.ac_comm));
+10 -10
kernel/auditsc.c
··· 210 210 struct { 211 211 uid_t uid; 212 212 gid_t gid; 213 - mode_t mode; 213 + umode_t mode; 214 214 u32 osid; 215 215 int has_perm; 216 216 uid_t perm_uid; 217 217 gid_t perm_gid; 218 - mode_t perm_mode; 218 + umode_t perm_mode; 219 219 unsigned long qbytes; 220 220 } ipc; 221 221 struct { ··· 234 234 } mq_sendrecv; 235 235 struct { 236 236 int oflag; 237 - mode_t mode; 237 + umode_t mode; 238 238 struct mq_attr attr; 239 239 } mq_open; 240 240 struct { ··· 308 308 static int audit_match_filetype(struct audit_context *ctx, int which) 309 309 { 310 310 unsigned index = which & ~S_IFMT; 311 - mode_t mode = which & S_IFMT; 311 + umode_t mode = which & S_IFMT; 312 312 313 313 if (unlikely(!ctx)) 314 314 return 0; ··· 1249 1249 case AUDIT_IPC: { 1250 1250 u32 osid = context->ipc.osid; 1251 1251 1252 - audit_log_format(ab, "ouid=%u ogid=%u mode=%#o", 1252 + audit_log_format(ab, "ouid=%u ogid=%u mode=%#ho", 1253 1253 context->ipc.uid, context->ipc.gid, context->ipc.mode); 1254 1254 if (osid) { 1255 1255 char *ctx = NULL; ··· 1267 1267 ab = audit_log_start(context, GFP_KERNEL, 1268 1268 AUDIT_IPC_SET_PERM); 1269 1269 audit_log_format(ab, 1270 - "qbytes=%lx ouid=%u ogid=%u mode=%#o", 1270 + "qbytes=%lx ouid=%u ogid=%u mode=%#ho", 1271 1271 context->ipc.qbytes, 1272 1272 context->ipc.perm_uid, 1273 1273 context->ipc.perm_gid, ··· 1278 1278 break; } 1279 1279 case AUDIT_MQ_OPEN: { 1280 1280 audit_log_format(ab, 1281 - "oflag=0x%x mode=%#o mq_flags=0x%lx mq_maxmsg=%ld " 1281 + "oflag=0x%x mode=%#ho mq_flags=0x%lx mq_maxmsg=%ld " 1282 1282 "mq_msgsize=%ld mq_curmsgs=%ld", 1283 1283 context->mq_open.oflag, context->mq_open.mode, 1284 1284 context->mq_open.attr.mq_flags, ··· 1502 1502 1503 1503 if (n->ino != (unsigned long)-1) { 1504 1504 audit_log_format(ab, " inode=%lu" 1505 - " dev=%02x:%02x mode=%#o" 1505 + " dev=%02x:%02x mode=%#ho" 1506 1506 " ouid=%u ogid=%u rdev=%02x:%02x", 1507 1507 n->ino, 1508 1508 MAJOR(n->dev), ··· 2160 2160 * @attr: queue attributes 2161 2161 * 2162 2162 */ 2163 - void __audit_mq_open(int oflag, mode_t mode, struct mq_attr *attr) 2163 + void __audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr) 2164 2164 { 2165 2165 struct audit_context *context = current->audit_context; 2166 2166 ··· 2260 2260 * 2261 2261 * Called only after audit_ipc_obj(). 2262 2262 */ 2263 - void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) 2263 + void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode) 2264 2264 { 2265 2265 struct audit_context *context = current->audit_context; 2266 2266
+11 -11
kernel/cgroup.c
··· 760 760 * -> cgroup_mkdir. 761 761 */ 762 762 763 - static int cgroup_mkdir(struct inode *dir, struct dentry *dentry, int mode); 763 + static int cgroup_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode); 764 764 static struct dentry *cgroup_lookup(struct inode *, struct dentry *, struct nameidata *); 765 765 static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry); 766 766 static int cgroup_populate_dir(struct cgroup *cgrp); ··· 775 775 static int alloc_css_id(struct cgroup_subsys *ss, 776 776 struct cgroup *parent, struct cgroup *child); 777 777 778 - static struct inode *cgroup_new_inode(mode_t mode, struct super_block *sb) 778 + static struct inode *cgroup_new_inode(umode_t mode, struct super_block *sb) 779 779 { 780 780 struct inode *inode = new_inode(sb); 781 781 ··· 1038 1038 return 0; 1039 1039 } 1040 1040 1041 - static int cgroup_show_options(struct seq_file *seq, struct vfsmount *vfs) 1041 + static int cgroup_show_options(struct seq_file *seq, struct dentry *dentry) 1042 1042 { 1043 - struct cgroupfs_root *root = vfs->mnt_sb->s_fs_info; 1043 + struct cgroupfs_root *root = dentry->d_sb->s_fs_info; 1044 1044 struct cgroup_subsys *ss; 1045 1045 1046 1046 mutex_lock(&cgroup_mutex); ··· 2585 2585 return __d_cft(file->f_dentry); 2586 2586 } 2587 2587 2588 - static int cgroup_create_file(struct dentry *dentry, mode_t mode, 2588 + static int cgroup_create_file(struct dentry *dentry, umode_t mode, 2589 2589 struct super_block *sb) 2590 2590 { 2591 2591 struct inode *inode; ··· 2626 2626 * @mode: mode to set on new directory. 2627 2627 */ 2628 2628 static int cgroup_create_dir(struct cgroup *cgrp, struct dentry *dentry, 2629 - mode_t mode) 2629 + umode_t mode) 2630 2630 { 2631 2631 struct dentry *parent; 2632 2632 int error = 0; ··· 2653 2653 * returns S_IRUGO if it has only a read handler 2654 2654 * returns S_IWUSR if it has only a write hander 2655 2655 */ 2656 - static mode_t cgroup_file_mode(const struct cftype *cft) 2656 + static umode_t cgroup_file_mode(const struct cftype *cft) 2657 2657 { 2658 - mode_t mode = 0; 2658 + umode_t mode = 0; 2659 2659 2660 2660 if (cft->mode) 2661 2661 return cft->mode; ··· 2678 2678 struct dentry *dir = cgrp->dentry; 2679 2679 struct dentry *dentry; 2680 2680 int error; 2681 - mode_t mode; 2681 + umode_t mode; 2682 2682 2683 2683 char name[MAX_CGROUP_TYPE_NAMELEN + MAX_CFTYPE_NAME + 2] = { 0 }; 2684 2684 if (subsys && !test_bit(ROOT_NOPREFIX, &cgrp->root->flags)) { ··· 3752 3752 * Must be called with the mutex on the parent inode held 3753 3753 */ 3754 3754 static long cgroup_create(struct cgroup *parent, struct dentry *dentry, 3755 - mode_t mode) 3755 + umode_t mode) 3756 3756 { 3757 3757 struct cgroup *cgrp; 3758 3758 struct cgroupfs_root *root = parent->root; ··· 3846 3846 return err; 3847 3847 } 3848 3848 3849 - static int cgroup_mkdir(struct inode *dir, struct dentry *dentry, int mode) 3849 + static int cgroup_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 3850 3850 { 3851 3851 struct cgroup *c_parent = dentry->d_parent->d_fsdata; 3852 3852
-1
kernel/power/swap.c
··· 18 18 #include <linux/bitops.h> 19 19 #include <linux/genhd.h> 20 20 #include <linux/device.h> 21 - #include <linux/buffer_head.h> 22 21 #include <linux/bio.h> 23 22 #include <linux/blkdev.h> 24 23 #include <linux/swap.h>
+1 -1
kernel/relay.c
··· 302 302 */ 303 303 static struct dentry *create_buf_file_default_callback(const char *filename, 304 304 struct dentry *parent, 305 - int mode, 305 + umode_t mode, 306 306 struct rchan_buf *buf, 307 307 int *is_global) 308 308 {
+1 -1
kernel/sched/core.c
··· 5176 5176 static void 5177 5177 set_table_entry(struct ctl_table *entry, 5178 5178 const char *procname, void *data, int maxlen, 5179 - mode_t mode, proc_handler *proc_handler) 5179 + umode_t mode, proc_handler *proc_handler) 5180 5180 { 5181 5181 entry->procname = procname; 5182 5182 entry->data = data;
+1 -1
kernel/trace/blktrace.c
··· 402 402 403 403 static struct dentry *blk_create_buf_file_callback(const char *filename, 404 404 struct dentry *parent, 405 - int mode, 405 + umode_t mode, 406 406 struct rchan_buf *buf, 407 407 int *is_global) 408 408 {
+1 -1
kernel/trace/trace.c
··· 4438 4438 }; 4439 4439 4440 4440 struct dentry *trace_create_file(const char *name, 4441 - mode_t mode, 4441 + umode_t mode, 4442 4442 struct dentry *parent, 4443 4443 void *data, 4444 4444 const struct file_operations *fops)
+1 -1
kernel/trace/trace.h
··· 312 312 void tracing_reset_current_online_cpus(void); 313 313 int tracing_open_generic(struct inode *inode, struct file *filp); 314 314 struct dentry *trace_create_file(const char *name, 315 - mode_t mode, 315 + umode_t mode, 316 316 struct dentry *parent, 317 317 void *data, 318 318 const struct file_operations *fops);
+4 -4
lib/fault-inject.c
··· 149 149 150 150 DEFINE_SIMPLE_ATTRIBUTE(fops_ul, debugfs_ul_get, debugfs_ul_set, "%llu\n"); 151 151 152 - static struct dentry *debugfs_create_ul(const char *name, mode_t mode, 152 + static struct dentry *debugfs_create_ul(const char *name, umode_t mode, 153 153 struct dentry *parent, unsigned long *value) 154 154 { 155 155 return debugfs_create_file(name, mode, parent, value, &fops_ul); ··· 169 169 debugfs_stacktrace_depth_set, "%llu\n"); 170 170 171 171 static struct dentry *debugfs_create_stacktrace_depth( 172 - const char *name, mode_t mode, 172 + const char *name, umode_t mode, 173 173 struct dentry *parent, unsigned long *value) 174 174 { 175 175 return debugfs_create_file(name, mode, parent, value, ··· 193 193 DEFINE_SIMPLE_ATTRIBUTE(fops_atomic_t, debugfs_atomic_t_get, 194 194 debugfs_atomic_t_set, "%lld\n"); 195 195 196 - static struct dentry *debugfs_create_atomic_t(const char *name, mode_t mode, 196 + static struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode, 197 197 struct dentry *parent, atomic_t *value) 198 198 { 199 199 return debugfs_create_file(name, mode, parent, value, &fops_atomic_t); ··· 202 202 struct dentry *fault_create_debugfs_attr(const char *name, 203 203 struct dentry *parent, struct fault_attr *attr) 204 204 { 205 - mode_t mode = S_IFREG | S_IRUSR | S_IWUSR; 205 + umode_t mode = S_IFREG | S_IRUSR | S_IWUSR; 206 206 struct dentry *dir; 207 207 208 208 dir = debugfs_create_dir(name, parent);
+1 -1
mm/failslab.c
··· 35 35 static int __init failslab_debugfs_init(void) 36 36 { 37 37 struct dentry *dir; 38 - mode_t mode = S_IFREG | S_IRUSR | S_IWUSR; 38 + umode_t mode = S_IFREG | S_IRUSR | S_IWUSR; 39 39 40 40 dir = fault_create_debugfs_attr("failslab", NULL, &failslab.attr); 41 41 if (IS_ERR(dir))
+1 -1
mm/filemap.c
··· 1968 1968 */ 1969 1969 int should_remove_suid(struct dentry *dentry) 1970 1970 { 1971 - mode_t mode = dentry->d_inode->i_mode; 1971 + umode_t mode = dentry->d_inode->i_mode; 1972 1972 int kill = 0; 1973 1973 1974 1974 /* suid always must be killed */
+1 -1
mm/page-writeback.c
··· 32 32 #include <linux/sysctl.h> 33 33 #include <linux/cpu.h> 34 34 #include <linux/syscalls.h> 35 - #include <linux/buffer_head.h> 35 + #include <linux/buffer_head.h> /* __set_page_dirty_buffers */ 36 36 #include <linux/pagevec.h> 37 37 #include <trace/events/writeback.h> 38 38
+1 -1
mm/page_alloc.c
··· 1386 1386 1387 1387 static int __init fail_page_alloc_debugfs(void) 1388 1388 { 1389 - mode_t mode = S_IFREG | S_IRUSR | S_IWUSR; 1389 + umode_t mode = S_IFREG | S_IRUSR | S_IWUSR; 1390 1390 struct dentry *dir; 1391 1391 1392 1392 dir = fault_create_debugfs_attr("fail_page_alloc", NULL,
+8 -9
mm/shmem.c
··· 1092 1092 } 1093 1093 1094 1094 static struct inode *shmem_get_inode(struct super_block *sb, const struct inode *dir, 1095 - int mode, dev_t dev, unsigned long flags) 1095 + umode_t mode, dev_t dev, unsigned long flags) 1096 1096 { 1097 1097 struct inode *inode; 1098 1098 struct shmem_inode_info *info; ··· 1456 1456 * File creation. Allocate an inode, and we're done.. 1457 1457 */ 1458 1458 static int 1459 - shmem_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev) 1459 + shmem_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) 1460 1460 { 1461 1461 struct inode *inode; 1462 1462 int error = -ENOSPC; ··· 1489 1489 return error; 1490 1490 } 1491 1491 1492 - static int shmem_mkdir(struct inode *dir, struct dentry *dentry, int mode) 1492 + static int shmem_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 1493 1493 { 1494 1494 int error; 1495 1495 ··· 1499 1499 return 0; 1500 1500 } 1501 1501 1502 - static int shmem_create(struct inode *dir, struct dentry *dentry, int mode, 1502 + static int shmem_create(struct inode *dir, struct dentry *dentry, umode_t mode, 1503 1503 struct nameidata *nd) 1504 1504 { 1505 1505 return shmem_mknod(dir, dentry, mode | S_IFREG, 0); ··· 2118 2118 return error; 2119 2119 } 2120 2120 2121 - static int shmem_show_options(struct seq_file *seq, struct vfsmount *vfs) 2121 + static int shmem_show_options(struct seq_file *seq, struct dentry *root) 2122 2122 { 2123 - struct shmem_sb_info *sbinfo = SHMEM_SB(vfs->mnt_sb); 2123 + struct shmem_sb_info *sbinfo = SHMEM_SB(root->d_sb); 2124 2124 2125 2125 if (sbinfo->max_blocks != shmem_default_max_blocks()) 2126 2126 seq_printf(seq, ",size=%luk", ··· 2128 2128 if (sbinfo->max_inodes != shmem_default_max_inodes()) 2129 2129 seq_printf(seq, ",nr_inodes=%lu", sbinfo->max_inodes); 2130 2130 if (sbinfo->mode != (S_IRWXUGO | S_ISVTX)) 2131 - seq_printf(seq, ",mode=%03o", sbinfo->mode); 2131 + seq_printf(seq, ",mode=%03ho", sbinfo->mode); 2132 2132 if (sbinfo->uid != 0) 2133 2133 seq_printf(seq, ",uid=%u", sbinfo->uid); 2134 2134 if (sbinfo->gid != 0) ··· 2234 2234 static void shmem_destroy_callback(struct rcu_head *head) 2235 2235 { 2236 2236 struct inode *inode = container_of(head, struct inode, i_rcu); 2237 - INIT_LIST_HEAD(&inode->i_dentry); 2238 2237 kmem_cache_free(shmem_inode_cachep, SHMEM_I(inode)); 2239 2238 } 2240 2239 2241 2240 static void shmem_destroy_inode(struct inode *inode) 2242 2241 { 2243 - if ((inode->i_mode & S_IFMT) == S_IFREG) 2242 + if (S_ISREG(inode->i_mode)) 2244 2243 mpol_free_shared_policy(&SHMEM_I(inode)->policy); 2245 2244 call_rcu(&inode->i_rcu, shmem_destroy_callback); 2246 2245 }
-1
mm/swap_state.c
··· 13 13 #include <linux/swapops.h> 14 14 #include <linux/init.h> 15 15 #include <linux/pagemap.h> 16 - #include <linux/buffer_head.h> 17 16 #include <linux/backing-dev.h> 18 17 #include <linux/pagevec.h> 19 18 #include <linux/migrate.h>
+1 -1
net/sunrpc/cache.c
··· 1778 1778 }; 1779 1779 1780 1780 int sunrpc_cache_register_pipefs(struct dentry *parent, 1781 - const char *name, mode_t umode, 1781 + const char *name, umode_t umode, 1782 1782 struct cache_detail *cd) 1783 1783 { 1784 1784 struct qstr q;
+1 -2
net/sunrpc/rpc_pipe.c
··· 185 185 rpc_i_callback(struct rcu_head *head) 186 186 { 187 187 struct inode *inode = container_of(head, struct inode, i_rcu); 188 - INIT_LIST_HEAD(&inode->i_dentry); 189 188 kmem_cache_free(rpc_inode_cachep, RPC_I(inode)); 190 189 } 191 190 ··· 953 954 } 954 955 955 956 struct dentry *rpc_create_cache_dir(struct dentry *parent, struct qstr *name, 956 - mode_t umode, struct cache_detail *cd) 957 + umode_t umode, struct cache_detail *cd) 957 958 { 958 959 return rpc_mkdir_populate(parent, name, umode, NULL, 959 960 rpc_cachedir_populate, cd);
+1 -1
net/unix/af_unix.c
··· 850 850 atomic_set(&addr->refcnt, 1); 851 851 852 852 if (sun_path[0]) { 853 - unsigned int mode; 853 + umode_t mode; 854 854 err = 0; 855 855 /* 856 856 * Get the parent directory, calculate the hash for last
+1 -1
security/apparmor/apparmorfs.c
··· 165 165 * 166 166 * Used aafs_remove to remove entries created with this fn. 167 167 */ 168 - static int __init aafs_create(const char *name, int mask, 168 + static int __init aafs_create(const char *name, umode_t mask, 169 169 const struct file_operations *fops) 170 170 { 171 171 struct dentry *dentry;
+5 -6
security/apparmor/lsm.c
··· 262 262 } 263 263 264 264 static int apparmor_path_mkdir(struct path *dir, struct dentry *dentry, 265 - int mode) 265 + umode_t mode) 266 266 { 267 267 return common_perm_create(OP_MKDIR, dir, dentry, AA_MAY_CREATE, 268 268 S_IFDIR); ··· 274 274 } 275 275 276 276 static int apparmor_path_mknod(struct path *dir, struct dentry *dentry, 277 - int mode, unsigned int dev) 277 + umode_t mode, unsigned int dev) 278 278 { 279 279 return common_perm_create(OP_MKNOD, dir, dentry, AA_MAY_CREATE, mode); 280 280 } ··· 344 344 return error; 345 345 } 346 346 347 - static int apparmor_path_chmod(struct dentry *dentry, struct vfsmount *mnt, 348 - mode_t mode) 347 + static int apparmor_path_chmod(struct path *path, umode_t mode) 349 348 { 350 - if (!mediated_filesystem(dentry->d_inode)) 349 + if (!mediated_filesystem(path->dentry->d_inode)) 351 350 return 0; 352 351 353 - return common_perm_mnt_dentry(OP_CHMOD, mnt, dentry, AA_MAY_CHMOD); 352 + return common_perm_mnt_dentry(OP_CHMOD, path->mnt, path->dentry, AA_MAY_CHMOD); 354 353 } 355 354 356 355 static int apparmor_path_chown(struct path *path, uid_t uid, gid_t gid)
-1
security/apparmor/path.c
··· 13 13 */ 14 14 15 15 #include <linux/magic.h> 16 - #include <linux/mnt_namespace.h> 17 16 #include <linux/mount.h> 18 17 #include <linux/namei.h> 19 18 #include <linux/nsproxy.h>
+6 -7
security/capability.c
··· 125 125 } 126 126 127 127 static int cap_inode_create(struct inode *inode, struct dentry *dentry, 128 - int mask) 128 + umode_t mask) 129 129 { 130 130 return 0; 131 131 } ··· 148 148 } 149 149 150 150 static int cap_inode_mkdir(struct inode *inode, struct dentry *dentry, 151 - int mask) 151 + umode_t mask) 152 152 { 153 153 return 0; 154 154 } ··· 159 159 } 160 160 161 161 static int cap_inode_mknod(struct inode *inode, struct dentry *dentry, 162 - int mode, dev_t dev) 162 + umode_t mode, dev_t dev) 163 163 { 164 164 return 0; 165 165 } ··· 235 235 } 236 236 237 237 #ifdef CONFIG_SECURITY_PATH 238 - static int cap_path_mknod(struct path *dir, struct dentry *dentry, int mode, 238 + static int cap_path_mknod(struct path *dir, struct dentry *dentry, umode_t mode, 239 239 unsigned int dev) 240 240 { 241 241 return 0; 242 242 } 243 243 244 - static int cap_path_mkdir(struct path *dir, struct dentry *dentry, int mode) 244 + static int cap_path_mkdir(struct path *dir, struct dentry *dentry, umode_t mode) 245 245 { 246 246 return 0; 247 247 } ··· 279 279 return 0; 280 280 } 281 281 282 - static int cap_path_chmod(struct dentry *dentry, struct vfsmount *mnt, 283 - mode_t mode) 282 + static int cap_path_chmod(struct path *path, umode_t mode) 284 283 { 285 284 return 0; 286 285 }
+8 -8
security/inode.c
··· 56 56 .llseek = noop_llseek, 57 57 }; 58 58 59 - static struct inode *get_inode(struct super_block *sb, int mode, dev_t dev) 59 + static struct inode *get_inode(struct super_block *sb, umode_t mode, dev_t dev) 60 60 { 61 61 struct inode *inode = new_inode(sb); 62 62 ··· 85 85 86 86 /* SMP-safe */ 87 87 static int mknod(struct inode *dir, struct dentry *dentry, 88 - int mode, dev_t dev) 88 + umode_t mode, dev_t dev) 89 89 { 90 90 struct inode *inode; 91 91 int error = -ENOMEM; ··· 102 102 return error; 103 103 } 104 104 105 - static int mkdir(struct inode *dir, struct dentry *dentry, int mode) 105 + static int mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 106 106 { 107 107 int res; 108 108 ··· 113 113 return res; 114 114 } 115 115 116 - static int create(struct inode *dir, struct dentry *dentry, int mode) 116 + static int create(struct inode *dir, struct dentry *dentry, umode_t mode) 117 117 { 118 118 mode = (mode & S_IALLUGO) | S_IFREG; 119 119 return mknod(dir, dentry, mode, 0); ··· 145 145 .kill_sb = kill_litter_super, 146 146 }; 147 147 148 - static int create_by_name(const char *name, mode_t mode, 148 + static int create_by_name(const char *name, umode_t mode, 149 149 struct dentry *parent, 150 150 struct dentry **dentry) 151 151 { ··· 159 159 * have around. 160 160 */ 161 161 if (!parent) 162 - parent = mount->mnt_sb->s_root; 162 + parent = mount->mnt_root; 163 163 164 164 mutex_lock(&parent->d_inode->i_mutex); 165 165 *dentry = lookup_one_len(name, parent, strlen(name)); 166 166 if (!IS_ERR(*dentry)) { 167 - if ((mode & S_IFMT) == S_IFDIR) 167 + if (S_ISDIR(mode)) 168 168 error = mkdir(parent->d_inode, *dentry, mode); 169 169 else 170 170 error = create(parent->d_inode, *dentry, mode); ··· 205 205 * If securityfs is not enabled in the kernel, the value %-ENODEV is 206 206 * returned. 207 207 */ 208 - struct dentry *securityfs_create_file(const char *name, mode_t mode, 208 + struct dentry *securityfs_create_file(const char *name, umode_t mode, 209 209 struct dentry *parent, void *data, 210 210 const struct file_operations *fops) 211 211 {
+8 -9
security/security.c
··· 388 388 EXPORT_SYMBOL(security_old_inode_init_security); 389 389 390 390 #ifdef CONFIG_SECURITY_PATH 391 - int security_path_mknod(struct path *dir, struct dentry *dentry, int mode, 391 + int security_path_mknod(struct path *dir, struct dentry *dentry, umode_t mode, 392 392 unsigned int dev) 393 393 { 394 394 if (unlikely(IS_PRIVATE(dir->dentry->d_inode))) ··· 397 397 } 398 398 EXPORT_SYMBOL(security_path_mknod); 399 399 400 - int security_path_mkdir(struct path *dir, struct dentry *dentry, int mode) 400 + int security_path_mkdir(struct path *dir, struct dentry *dentry, umode_t mode) 401 401 { 402 402 if (unlikely(IS_PRIVATE(dir->dentry->d_inode))) 403 403 return 0; ··· 454 454 return security_ops->path_truncate(path); 455 455 } 456 456 457 - int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, 458 - mode_t mode) 457 + int security_path_chmod(struct path *path, umode_t mode) 459 458 { 460 - if (unlikely(IS_PRIVATE(dentry->d_inode))) 459 + if (unlikely(IS_PRIVATE(path->dentry->d_inode))) 461 460 return 0; 462 - return security_ops->path_chmod(dentry, mnt, mode); 461 + return security_ops->path_chmod(path, mode); 463 462 } 464 463 465 464 int security_path_chown(struct path *path, uid_t uid, gid_t gid) ··· 474 475 } 475 476 #endif 476 477 477 - int security_inode_create(struct inode *dir, struct dentry *dentry, int mode) 478 + int security_inode_create(struct inode *dir, struct dentry *dentry, umode_t mode) 478 479 { 479 480 if (unlikely(IS_PRIVATE(dir))) 480 481 return 0; ··· 505 506 return security_ops->inode_symlink(dir, dentry, old_name); 506 507 } 507 508 508 - int security_inode_mkdir(struct inode *dir, struct dentry *dentry, int mode) 509 + int security_inode_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) 509 510 { 510 511 if (unlikely(IS_PRIVATE(dir))) 511 512 return 0; ··· 520 521 return security_ops->inode_rmdir(dir, dentry); 521 522 } 522 523 523 - int security_inode_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev) 524 + int security_inode_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) 524 525 { 525 526 if (unlikely(IS_PRIVATE(dir))) 526 527 return 0;
+5 -5
security/selinux/hooks.c
··· 1740 1740 { 1741 1741 u32 av = 0; 1742 1742 1743 - if ((mode & S_IFMT) != S_IFDIR) { 1743 + if (!S_ISDIR(mode)) { 1744 1744 if (mask & MAY_EXEC) 1745 1745 av |= FILE__EXECUTE; 1746 1746 if (mask & MAY_READ) ··· 2507 2507 const struct cred *cred = current_cred(); 2508 2508 2509 2509 if (flags & MS_REMOUNT) 2510 - return superblock_has_perm(cred, path->mnt->mnt_sb, 2510 + return superblock_has_perm(cred, path->dentry->d_sb, 2511 2511 FILESYSTEM__REMOUNT, NULL); 2512 2512 else 2513 2513 return path_has_perm(cred, path, FILE__MOUNTON); ··· 2598 2598 return 0; 2599 2599 } 2600 2600 2601 - static int selinux_inode_create(struct inode *dir, struct dentry *dentry, int mask) 2601 + static int selinux_inode_create(struct inode *dir, struct dentry *dentry, umode_t mode) 2602 2602 { 2603 2603 return may_create(dir, dentry, SECCLASS_FILE); 2604 2604 } ··· 2618 2618 return may_create(dir, dentry, SECCLASS_LNK_FILE); 2619 2619 } 2620 2620 2621 - static int selinux_inode_mkdir(struct inode *dir, struct dentry *dentry, int mask) 2621 + static int selinux_inode_mkdir(struct inode *dir, struct dentry *dentry, umode_t mask) 2622 2622 { 2623 2623 return may_create(dir, dentry, SECCLASS_DIR); 2624 2624 } ··· 2628 2628 return may_link(dir, dentry, MAY_RMDIR); 2629 2629 } 2630 2630 2631 - static int selinux_inode_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev) 2631 + static int selinux_inode_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) 2632 2632 { 2633 2633 return may_create(dir, dentry, inode_mode_to_security_class(mode)); 2634 2634 }
+2 -2
security/smack/smack_lsm.c
··· 406 406 static int smack_sb_mount(char *dev_name, struct path *path, 407 407 char *type, unsigned long flags, void *data) 408 408 { 409 - struct superblock_smack *sbp = path->mnt->mnt_sb->s_security; 409 + struct superblock_smack *sbp = path->dentry->d_sb->s_security; 410 410 struct smk_audit_info ad; 411 411 412 412 smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH); ··· 435 435 smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH); 436 436 smk_ad_setfield_u_fs_path(&ad, path); 437 437 438 - sbp = mnt->mnt_sb->s_security; 438 + sbp = path.dentry->d_sb->s_security; 439 439 return smk_curacc(sbp->smk_floor, MAY_WRITE, &ad); 440 440 } 441 441
+2 -2
security/tomoyo/audit.c
··· 112 112 * 113 113 * Returns file type string. 114 114 */ 115 - static inline const char *tomoyo_filetype(const mode_t mode) 115 + static inline const char *tomoyo_filetype(const umode_t mode) 116 116 { 117 117 switch (mode & S_IFMT) { 118 118 case S_IFREG: ··· 180 180 for (i = 0; i < TOMOYO_MAX_PATH_STAT; i++) { 181 181 struct tomoyo_mini_stat *stat; 182 182 unsigned int dev; 183 - mode_t mode; 183 + umode_t mode; 184 184 if (!obj->stat_valid[i]) 185 185 continue; 186 186 stat = &obj->stat[i];
+1 -1
security/tomoyo/common.h
··· 564 564 uid_t uid; 565 565 gid_t gid; 566 566 ino_t ino; 567 - mode_t mode; 567 + umode_t mode; 568 568 dev_t dev; 569 569 dev_t rdev; 570 570 };
+1 -8
security/tomoyo/realpath.c
··· 4 4 * Copyright (C) 2005-2011 NTT DATA CORPORATION 5 5 */ 6 6 7 - #include <linux/types.h> 8 - #include <linux/mount.h> 9 - #include <linux/mnt_namespace.h> 10 - #include <linux/fs_struct.h> 11 - #include <linux/magic.h> 12 - #include <linux/slab.h> 13 - #include <net/sock.h> 14 7 #include "common.h" 15 - #include "../../fs/internal.h" 8 + #include <linux/magic.h> 16 9 17 10 /** 18 11 * tomoyo_encode2 - Encode binary string to ascii string.
+1 -1
security/tomoyo/securityfs_if.c
··· 224 224 * 225 225 * Returns nothing. 226 226 */ 227 - static void __init tomoyo_create_entry(const char *name, const mode_t mode, 227 + static void __init tomoyo_create_entry(const char *name, const umode_t mode, 228 228 struct dentry *parent, const u8 key) 229 229 { 230 230 securityfs_create_file(name, mode, parent, ((u8 *) NULL) + key,
+6 -9
security/tomoyo/tomoyo.c
··· 186 186 * Returns 0 on success, negative value otherwise. 187 187 */ 188 188 static int tomoyo_path_mkdir(struct path *parent, struct dentry *dentry, 189 - int mode) 189 + umode_t mode) 190 190 { 191 191 struct path path = { parent->mnt, dentry }; 192 192 return tomoyo_path_number_perm(TOMOYO_TYPE_MKDIR, &path, ··· 234 234 * Returns 0 on success, negative value otherwise. 235 235 */ 236 236 static int tomoyo_path_mknod(struct path *parent, struct dentry *dentry, 237 - int mode, unsigned int dev) 237 + umode_t mode, unsigned int dev) 238 238 { 239 239 struct path path = { parent->mnt, dentry }; 240 240 int type = TOMOYO_TYPE_CREATE; ··· 353 353 /** 354 354 * tomoyo_path_chmod - Target for security_path_chmod(). 355 355 * 356 - * @dentry: Pointer to "struct dentry". 357 - * @mnt: Pointer to "struct vfsmount". 358 - * @mode: DAC permission mode. 356 + * @path: Pointer to "struct path". 357 + * @mode: DAC permission mode. 359 358 * 360 359 * Returns 0 on success, negative value otherwise. 361 360 */ 362 - static int tomoyo_path_chmod(struct dentry *dentry, struct vfsmount *mnt, 363 - mode_t mode) 361 + static int tomoyo_path_chmod(struct path *path, umode_t mode) 364 362 { 365 - struct path path = { mnt, dentry }; 366 - return tomoyo_path_number_perm(TOMOYO_TYPE_CHMOD, &path, 363 + return tomoyo_path_number_perm(TOMOYO_TYPE_CHMOD, path, 367 364 mode & S_IALLUGO); 368 365 } 369 366
+1 -1
sound/sound_core.c
··· 29 29 MODULE_AUTHOR("Alan Cox"); 30 30 MODULE_LICENSE("GPL"); 31 31 32 - static char *sound_devnode(struct device *dev, mode_t *mode) 32 + static char *sound_devnode(struct device *dev, umode_t *mode) 33 33 { 34 34 if (MAJOR(dev->devt) == SOUND_MAJOR) 35 35 return NULL;