diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-26 23:16:07 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-26 23:16:07 -0500 |
commit | d895cb1af15c04c522a25c79cc429076987c089b (patch) | |
tree | 895dc9157e28f603d937a58be664e4e440d5530c /arch | |
parent | 9626357371b519f2b955fef399647181034a77fe (diff) | |
parent | d3d009cb965eae7e002ea5badf603ea8f4c34915 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile (part one) from Al Viro:
"Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent
locking violations, etc.
The most visible changes here are death of FS_REVAL_DOT (replaced with
"has ->d_weak_revalidate()") and a new helper getting from struct file
to inode. Some bits of preparation to xattr method interface changes.
Misc patches by various people sent this cycle *and* ocfs2 fixes from
several cycles ago that should've been upstream right then.
PS: the next vfs pile will be xattr stuff."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits)
saner proc_get_inode() calling conventions
proc: avoid extra pde_put() in proc_fill_super()
fs: change return values from -EACCES to -EPERM
fs/exec.c: make bprm_mm_init() static
ocfs2/dlm: use GFP_ATOMIC inside a spin_lock
ocfs2: fix possible use-after-free with AIO
ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path
get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero
target: writev() on single-element vector is pointless
export kernel_write(), convert open-coded instances
fs: encode_fh: return FILEID_INVALID if invalid fid_type
kill f_vfsmnt
vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op
nfsd: handle vfs_getattr errors in acl protocol
switch vfs_getattr() to struct path
default SET_PERSONALITY() in linux/elf.h
ceph: prepopulate inodes only when request is aborted
d_hash_and_lookup(): export, switch open-coded instances
9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate()
9p: split dropping the acls from v9fs_set_create_acl()
...
Diffstat (limited to 'arch')
41 files changed, 75 insertions, 162 deletions
diff --git a/arch/alpha/kernel/srm_env.c b/arch/alpha/kernel/srm_env.c index b9fc6c309d2e..e64559f0a82d 100644 --- a/arch/alpha/kernel/srm_env.c +++ b/arch/alpha/kernel/srm_env.c | |||
@@ -111,7 +111,7 @@ static ssize_t srm_env_proc_write(struct file *file, const char __user *buffer, | |||
111 | size_t count, loff_t *pos) | 111 | size_t count, loff_t *pos) |
112 | { | 112 | { |
113 | int res; | 113 | int res; |
114 | srm_env_t *entry = PDE(file->f_path.dentry->d_inode)->data; | 114 | srm_env_t *entry = PDE(file_inode(file))->data; |
115 | char *buf = (char *) __get_free_page(GFP_USER); | 115 | char *buf = (char *) __get_free_page(GFP_USER); |
116 | unsigned long ret1, ret2; | 116 | unsigned long ret1, ret2; |
117 | 117 | ||
diff --git a/arch/avr32/include/asm/elf.h b/arch/avr32/include/asm/elf.h index e2c328739808..d232888b99d5 100644 --- a/arch/avr32/include/asm/elf.h +++ b/arch/avr32/include/asm/elf.h | |||
@@ -102,7 +102,4 @@ typedef struct user_fpu_struct elf_fpregset_t; | |||
102 | 102 | ||
103 | #define ELF_PLATFORM (NULL) | 103 | #define ELF_PLATFORM (NULL) |
104 | 104 | ||
105 | #define SET_PERSONALITY(ex) \ | ||
106 | set_personality(PER_LINUX_32BIT | (current->personality & (~PER_MASK))) | ||
107 | |||
108 | #endif /* __ASM_AVR32_ELF_H */ | 105 | #endif /* __ASM_AVR32_ELF_H */ |
diff --git a/arch/blackfin/include/asm/elf.h b/arch/blackfin/include/asm/elf.h index 14bc98ff668f..d15cb9b5d52c 100644 --- a/arch/blackfin/include/asm/elf.h +++ b/arch/blackfin/include/asm/elf.h | |||
@@ -132,7 +132,4 @@ do { \ | |||
132 | 132 | ||
133 | #define ELF_PLATFORM (NULL) | 133 | #define ELF_PLATFORM (NULL) |
134 | 134 | ||
135 | #define SET_PERSONALITY(ex) \ | ||
136 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
137 | |||
138 | #endif | 135 | #endif |
diff --git a/arch/blackfin/kernel/cplbinfo.c b/arch/blackfin/kernel/cplbinfo.c index 0bdaa517a501..e1d0b24c6070 100644 --- a/arch/blackfin/kernel/cplbinfo.c +++ b/arch/blackfin/kernel/cplbinfo.c | |||
@@ -116,7 +116,7 @@ static const struct seq_operations cplbinfo_sops = { | |||
116 | 116 | ||
117 | static int cplbinfo_open(struct inode *inode, struct file *file) | 117 | static int cplbinfo_open(struct inode *inode, struct file *file) |
118 | { | 118 | { |
119 | struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); | 119 | struct proc_dir_entry *pde = PDE(file_inode(file)); |
120 | char cplb_type; | 120 | char cplb_type; |
121 | unsigned int cpu; | 121 | unsigned int cpu; |
122 | int ret; | 122 | int ret; |
diff --git a/arch/c6x/include/asm/elf.h b/arch/c6x/include/asm/elf.h index 32b997126adf..9a4dfc5eb249 100644 --- a/arch/c6x/include/asm/elf.h +++ b/arch/c6x/include/asm/elf.h | |||
@@ -77,9 +77,6 @@ do { \ | |||
77 | 77 | ||
78 | #define ELF_PLATFORM (NULL) | 78 | #define ELF_PLATFORM (NULL) |
79 | 79 | ||
80 | #define SET_PERSONALITY(ex) \ | ||
81 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
82 | |||
83 | /* C6X specific section types */ | 80 | /* C6X specific section types */ |
84 | #define SHT_C6000_UNWIND 0x70000001 | 81 | #define SHT_C6000_UNWIND 0x70000001 |
85 | #define SHT_C6000_PREEMPTMAP 0x70000002 | 82 | #define SHT_C6000_PREEMPTMAP 0x70000002 |
diff --git a/arch/cris/arch-v10/drivers/sync_serial.c b/arch/cris/arch-v10/drivers/sync_serial.c index c4b71710fb0e..a1c498d18d31 100644 --- a/arch/cris/arch-v10/drivers/sync_serial.c +++ b/arch/cris/arch-v10/drivers/sync_serial.c | |||
@@ -654,7 +654,7 @@ static int sync_serial_release(struct inode *inode, struct file *file) | |||
654 | 654 | ||
655 | static unsigned int sync_serial_poll(struct file *file, poll_table *wait) | 655 | static unsigned int sync_serial_poll(struct file *file, poll_table *wait) |
656 | { | 656 | { |
657 | int dev = MINOR(file->f_dentry->d_inode->i_rdev); | 657 | int dev = MINOR(file_inode(file)->i_rdev); |
658 | unsigned int mask = 0; | 658 | unsigned int mask = 0; |
659 | struct sync_port *port; | 659 | struct sync_port *port; |
660 | DEBUGPOLL(static unsigned int prev_mask = 0); | 660 | DEBUGPOLL(static unsigned int prev_mask = 0); |
@@ -685,7 +685,7 @@ static int sync_serial_ioctl_unlocked(struct file *file, | |||
685 | int return_val = 0; | 685 | int return_val = 0; |
686 | unsigned long flags; | 686 | unsigned long flags; |
687 | 687 | ||
688 | int dev = MINOR(file->f_dentry->d_inode->i_rdev); | 688 | int dev = MINOR(file_inode(file)->i_rdev); |
689 | struct sync_port *port; | 689 | struct sync_port *port; |
690 | 690 | ||
691 | if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) { | 691 | if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) { |
@@ -973,7 +973,7 @@ static long sync_serial_ioctl(struct file *file, | |||
973 | static ssize_t sync_serial_write(struct file *file, const char *buf, | 973 | static ssize_t sync_serial_write(struct file *file, const char *buf, |
974 | size_t count, loff_t *ppos) | 974 | size_t count, loff_t *ppos) |
975 | { | 975 | { |
976 | int dev = MINOR(file->f_dentry->d_inode->i_rdev); | 976 | int dev = MINOR(file_inode(file)->i_rdev); |
977 | DECLARE_WAITQUEUE(wait, current); | 977 | DECLARE_WAITQUEUE(wait, current); |
978 | struct sync_port *port; | 978 | struct sync_port *port; |
979 | unsigned long flags; | 979 | unsigned long flags; |
@@ -1097,7 +1097,7 @@ static ssize_t sync_serial_write(struct file *file, const char *buf, | |||
1097 | static ssize_t sync_serial_read(struct file *file, char *buf, | 1097 | static ssize_t sync_serial_read(struct file *file, char *buf, |
1098 | size_t count, loff_t *ppos) | 1098 | size_t count, loff_t *ppos) |
1099 | { | 1099 | { |
1100 | int dev = MINOR(file->f_dentry->d_inode->i_rdev); | 1100 | int dev = MINOR(file_inode(file)->i_rdev); |
1101 | int avail; | 1101 | int avail; |
1102 | struct sync_port *port; | 1102 | struct sync_port *port; |
1103 | unsigned char *start; | 1103 | unsigned char *start; |
diff --git a/arch/cris/arch-v32/drivers/cryptocop.c b/arch/cris/arch-v32/drivers/cryptocop.c index f8476d9e856b..877da1908234 100644 --- a/arch/cris/arch-v32/drivers/cryptocop.c +++ b/arch/cris/arch-v32/drivers/cryptocop.c | |||
@@ -3135,11 +3135,10 @@ static long cryptocop_ioctl_unlocked(struct inode *inode, | |||
3135 | static long | 3135 | static long |
3136 | cryptocop_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 3136 | cryptocop_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
3137 | { | 3137 | { |
3138 | struct inode *inode = file->f_path.dentry->d_inode; | ||
3139 | long ret; | 3138 | long ret; |
3140 | 3139 | ||
3141 | mutex_lock(&cryptocop_mutex); | 3140 | mutex_lock(&cryptocop_mutex); |
3142 | ret = cryptocop_ioctl_unlocked(inode, filp, cmd, arg); | 3141 | ret = cryptocop_ioctl_unlocked(file_inode(filp), filp, cmd, arg); |
3143 | mutex_unlock(&cryptocop_mutex); | 3142 | mutex_unlock(&cryptocop_mutex); |
3144 | 3143 | ||
3145 | return ret; | 3144 | return ret; |
diff --git a/arch/cris/arch-v32/drivers/sync_serial.c b/arch/cris/arch-v32/drivers/sync_serial.c index a6a180bc566f..219f704e3221 100644 --- a/arch/cris/arch-v32/drivers/sync_serial.c +++ b/arch/cris/arch-v32/drivers/sync_serial.c | |||
@@ -609,7 +609,7 @@ static int sync_serial_release(struct inode *inode, struct file *file) | |||
609 | 609 | ||
610 | static unsigned int sync_serial_poll(struct file *file, poll_table *wait) | 610 | static unsigned int sync_serial_poll(struct file *file, poll_table *wait) |
611 | { | 611 | { |
612 | int dev = iminor(file->f_path.dentry->d_inode); | 612 | int dev = iminor(file_inode(file)); |
613 | unsigned int mask = 0; | 613 | unsigned int mask = 0; |
614 | sync_port *port; | 614 | sync_port *port; |
615 | DEBUGPOLL( static unsigned int prev_mask = 0; ); | 615 | DEBUGPOLL( static unsigned int prev_mask = 0; ); |
@@ -657,7 +657,7 @@ static int sync_serial_ioctl(struct file *file, | |||
657 | { | 657 | { |
658 | int return_val = 0; | 658 | int return_val = 0; |
659 | int dma_w_size = regk_dma_set_w_size1; | 659 | int dma_w_size = regk_dma_set_w_size1; |
660 | int dev = iminor(file->f_path.dentry->d_inode); | 660 | int dev = iminor(file_inode(file)); |
661 | sync_port *port; | 661 | sync_port *port; |
662 | reg_sser_rw_tr_cfg tr_cfg; | 662 | reg_sser_rw_tr_cfg tr_cfg; |
663 | reg_sser_rw_rec_cfg rec_cfg; | 663 | reg_sser_rw_rec_cfg rec_cfg; |
@@ -979,7 +979,7 @@ static long sync_serial_ioctl(struct file *file, | |||
979 | static ssize_t sync_serial_write(struct file *file, const char *buf, | 979 | static ssize_t sync_serial_write(struct file *file, const char *buf, |
980 | size_t count, loff_t *ppos) | 980 | size_t count, loff_t *ppos) |
981 | { | 981 | { |
982 | int dev = iminor(file->f_path.dentry->d_inode); | 982 | int dev = iminor(file_inode(file)); |
983 | DECLARE_WAITQUEUE(wait, current); | 983 | DECLARE_WAITQUEUE(wait, current); |
984 | struct sync_port *port; | 984 | struct sync_port *port; |
985 | int trunc_count; | 985 | int trunc_count; |
@@ -1102,7 +1102,7 @@ static ssize_t sync_serial_write(struct file *file, const char *buf, | |||
1102 | static ssize_t sync_serial_read(struct file * file, char * buf, | 1102 | static ssize_t sync_serial_read(struct file * file, char * buf, |
1103 | size_t count, loff_t *ppos) | 1103 | size_t count, loff_t *ppos) |
1104 | { | 1104 | { |
1105 | int dev = iminor(file->f_path.dentry->d_inode); | 1105 | int dev = iminor(file_inode(file)); |
1106 | int avail; | 1106 | int avail; |
1107 | sync_port *port; | 1107 | sync_port *port; |
1108 | unsigned char* start; | 1108 | unsigned char* start; |
diff --git a/arch/cris/include/asm/elf.h b/arch/cris/include/asm/elf.h index 8182f2dc89d0..30ded8fbf592 100644 --- a/arch/cris/include/asm/elf.h +++ b/arch/cris/include/asm/elf.h | |||
@@ -86,7 +86,4 @@ typedef unsigned long elf_fpregset_t; | |||
86 | 86 | ||
87 | #define ELF_PLATFORM (NULL) | 87 | #define ELF_PLATFORM (NULL) |
88 | 88 | ||
89 | #define SET_PERSONALITY(ex) \ | ||
90 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
91 | |||
92 | #endif | 89 | #endif |
diff --git a/arch/frv/include/asm/elf.h b/arch/frv/include/asm/elf.h index 9ccbc80f0b11..2bac6446db41 100644 --- a/arch/frv/include/asm/elf.h +++ b/arch/frv/include/asm/elf.h | |||
@@ -137,7 +137,4 @@ do { \ | |||
137 | 137 | ||
138 | #define ELF_PLATFORM (NULL) | 138 | #define ELF_PLATFORM (NULL) |
139 | 139 | ||
140 | #define SET_PERSONALITY(ex) \ | ||
141 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
142 | |||
143 | #endif | 140 | #endif |
diff --git a/arch/h8300/include/asm/elf.h b/arch/h8300/include/asm/elf.h index 41193c396bff..6db71248a82f 100644 --- a/arch/h8300/include/asm/elf.h +++ b/arch/h8300/include/asm/elf.h | |||
@@ -54,9 +54,6 @@ typedef unsigned long elf_fpregset_t; | |||
54 | 54 | ||
55 | #define ELF_PLATFORM (NULL) | 55 | #define ELF_PLATFORM (NULL) |
56 | 56 | ||
57 | #define SET_PERSONALITY(ex) \ | ||
58 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
59 | |||
60 | #define R_H8_NONE 0 | 57 | #define R_H8_NONE 0 |
61 | #define R_H8_DIR32 1 | 58 | #define R_H8_DIR32 1 |
62 | #define R_H8_DIR32_28 2 | 59 | #define R_H8_DIR32_28 2 |
diff --git a/arch/hexagon/include/asm/elf.h b/arch/hexagon/include/asm/elf.h index 1ba4b3bff5ed..1f14e082588e 100644 --- a/arch/hexagon/include/asm/elf.h +++ b/arch/hexagon/include/asm/elf.h | |||
@@ -216,11 +216,6 @@ do { \ | |||
216 | */ | 216 | */ |
217 | #define ELF_PLATFORM (NULL) | 217 | #define ELF_PLATFORM (NULL) |
218 | 218 | ||
219 | #ifdef __KERNEL__ | ||
220 | #define SET_PERSONALITY(ex) \ | ||
221 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
222 | #endif | ||
223 | |||
224 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 | 219 | #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 |
225 | struct linux_binprm; | 220 | struct linux_binprm; |
226 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, | 221 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, |
diff --git a/arch/ia64/include/asm/elf.h b/arch/ia64/include/asm/elf.h index b5298eb09adb..5a83c5cc3dc8 100644 --- a/arch/ia64/include/asm/elf.h +++ b/arch/ia64/include/asm/elf.h | |||
@@ -201,9 +201,6 @@ extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst); | |||
201 | relevant until we have real hardware to play with... */ | 201 | relevant until we have real hardware to play with... */ |
202 | #define ELF_PLATFORM NULL | 202 | #define ELF_PLATFORM NULL |
203 | 203 | ||
204 | #define SET_PERSONALITY(ex) \ | ||
205 | set_personality((current->personality & ~PER_MASK) | PER_LINUX) | ||
206 | |||
207 | #define elf_read_implies_exec(ex, executable_stack) \ | 204 | #define elf_read_implies_exec(ex, executable_stack) \ |
208 | ((executable_stack!=EXSTACK_DISABLE_X) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0) | 205 | ((executable_stack!=EXSTACK_DISABLE_X) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0) |
209 | 206 | ||
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index ea39eba61ef5..433f5e8a2cd1 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -2221,9 +2221,9 @@ pfm_alloc_file(pfm_context_t *ctx) | |||
2221 | d_add(path.dentry, inode); | 2221 | d_add(path.dentry, inode); |
2222 | 2222 | ||
2223 | file = alloc_file(&path, FMODE_READ, &pfm_file_ops); | 2223 | file = alloc_file(&path, FMODE_READ, &pfm_file_ops); |
2224 | if (!file) { | 2224 | if (IS_ERR(file)) { |
2225 | path_put(&path); | 2225 | path_put(&path); |
2226 | return ERR_PTR(-ENFILE); | 2226 | return file; |
2227 | } | 2227 | } |
2228 | 2228 | ||
2229 | file->f_flags = O_RDONLY; | 2229 | file->f_flags = O_RDONLY; |
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c index 79802e540e53..aa527d7e91f2 100644 --- a/arch/ia64/kernel/salinfo.c +++ b/arch/ia64/kernel/salinfo.c | |||
@@ -301,7 +301,7 @@ salinfo_event_open(struct inode *inode, struct file *file) | |||
301 | static ssize_t | 301 | static ssize_t |
302 | salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) | 302 | salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) |
303 | { | 303 | { |
304 | struct inode *inode = file->f_path.dentry->d_inode; | 304 | struct inode *inode = file_inode(file); |
305 | struct proc_dir_entry *entry = PDE(inode); | 305 | struct proc_dir_entry *entry = PDE(inode); |
306 | struct salinfo_data *data = entry->data; | 306 | struct salinfo_data *data = entry->data; |
307 | char cmd[32]; | 307 | char cmd[32]; |
@@ -463,7 +463,7 @@ retry: | |||
463 | static ssize_t | 463 | static ssize_t |
464 | salinfo_log_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) | 464 | salinfo_log_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) |
465 | { | 465 | { |
466 | struct inode *inode = file->f_path.dentry->d_inode; | 466 | struct inode *inode = file_inode(file); |
467 | struct proc_dir_entry *entry = PDE(inode); | 467 | struct proc_dir_entry *entry = PDE(inode); |
468 | struct salinfo_data *data = entry->data; | 468 | struct salinfo_data *data = entry->data; |
469 | u8 *buf; | 469 | u8 *buf; |
@@ -524,7 +524,7 @@ salinfo_log_clear(struct salinfo_data *data, int cpu) | |||
524 | static ssize_t | 524 | static ssize_t |
525 | salinfo_log_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) | 525 | salinfo_log_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) |
526 | { | 526 | { |
527 | struct inode *inode = file->f_path.dentry->d_inode; | 527 | struct inode *inode = file_inode(file); |
528 | struct proc_dir_entry *entry = PDE(inode); | 528 | struct proc_dir_entry *entry = PDE(inode); |
529 | struct salinfo_data *data = entry->data; | 529 | struct salinfo_data *data = entry->data; |
530 | char cmd[32]; | 530 | char cmd[32]; |
diff --git a/arch/m32r/include/asm/elf.h b/arch/m32r/include/asm/elf.h index 70896161c636..8acc9da9a15e 100644 --- a/arch/m32r/include/asm/elf.h +++ b/arch/m32r/include/asm/elf.h | |||
@@ -128,7 +128,4 @@ typedef elf_fpreg_t elf_fpregset_t; | |||
128 | intent than poking at uname or /proc/cpuinfo. */ | 128 | intent than poking at uname or /proc/cpuinfo. */ |
129 | #define ELF_PLATFORM (NULL) | 129 | #define ELF_PLATFORM (NULL) |
130 | 130 | ||
131 | #define SET_PERSONALITY(ex) \ | ||
132 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
133 | |||
134 | #endif /* _ASM_M32R__ELF_H */ | 131 | #endif /* _ASM_M32R__ELF_H */ |
diff --git a/arch/m68k/include/asm/elf.h b/arch/m68k/include/asm/elf.h index f83c1d0a87cf..b1c26de438be 100644 --- a/arch/m68k/include/asm/elf.h +++ b/arch/m68k/include/asm/elf.h | |||
@@ -113,7 +113,4 @@ typedef struct user_m68kfp_struct elf_fpregset_t; | |||
113 | 113 | ||
114 | #define ELF_PLATFORM (NULL) | 114 | #define ELF_PLATFORM (NULL) |
115 | 115 | ||
116 | #define SET_PERSONALITY(ex) \ | ||
117 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
118 | |||
119 | #endif | 116 | #endif |
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index b8c18dcdd2c4..88f7b50d541c 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c | |||
@@ -399,11 +399,9 @@ static int file_release(struct inode *inode, struct file *filp) | |||
399 | 399 | ||
400 | static unsigned int file_poll(struct file *file, poll_table * wait) | 400 | static unsigned int file_poll(struct file *file, poll_table * wait) |
401 | { | 401 | { |
402 | int minor; | 402 | int minor = iminor(file_inode(file)); |
403 | unsigned int mask = 0; | 403 | unsigned int mask = 0; |
404 | 404 | ||
405 | minor = iminor(file->f_path.dentry->d_inode); | ||
406 | |||
407 | poll_wait(file, &channel_wqs[minor].rt_queue, wait); | 405 | poll_wait(file, &channel_wqs[minor].rt_queue, wait); |
408 | poll_wait(file, &channel_wqs[minor].lx_queue, wait); | 406 | poll_wait(file, &channel_wqs[minor].lx_queue, wait); |
409 | 407 | ||
@@ -424,7 +422,7 @@ static unsigned int file_poll(struct file *file, poll_table * wait) | |||
424 | static ssize_t file_read(struct file *file, char __user * buffer, size_t count, | 422 | static ssize_t file_read(struct file *file, char __user * buffer, size_t count, |
425 | loff_t * ppos) | 423 | loff_t * ppos) |
426 | { | 424 | { |
427 | int minor = iminor(file->f_path.dentry->d_inode); | 425 | int minor = iminor(file_inode(file)); |
428 | 426 | ||
429 | /* data available? */ | 427 | /* data available? */ |
430 | if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) { | 428 | if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) { |
@@ -437,11 +435,8 @@ static ssize_t file_read(struct file *file, char __user * buffer, size_t count, | |||
437 | static ssize_t file_write(struct file *file, const char __user * buffer, | 435 | static ssize_t file_write(struct file *file, const char __user * buffer, |
438 | size_t count, loff_t * ppos) | 436 | size_t count, loff_t * ppos) |
439 | { | 437 | { |
440 | int minor; | 438 | int minor = iminor(file_inode(file)); |
441 | struct rtlx_channel *rt; | 439 | struct rtlx_channel *rt = &rtlx->channel[minor]; |
442 | |||
443 | minor = iminor(file->f_path.dentry->d_inode); | ||
444 | rt = &rtlx->channel[minor]; | ||
445 | 440 | ||
446 | /* any space left... */ | 441 | /* any space left... */ |
447 | if (!rtlx_write_poll(minor)) { | 442 | if (!rtlx_write_poll(minor)) { |
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 147cec19621d..29933652ff4a 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c | |||
@@ -1149,7 +1149,7 @@ static ssize_t vpe_write(struct file *file, const char __user * buffer, | |||
1149 | size_t ret = count; | 1149 | size_t ret = count; |
1150 | struct vpe *v; | 1150 | struct vpe *v; |
1151 | 1151 | ||
1152 | if (iminor(file->f_path.dentry->d_inode) != minor) | 1152 | if (iminor(file_inode(file)) != minor) |
1153 | return -ENODEV; | 1153 | return -ENODEV; |
1154 | 1154 | ||
1155 | v = get_vpe(tclimit); | 1155 | v = get_vpe(tclimit); |
diff --git a/arch/mips/lasat/picvue_proc.c b/arch/mips/lasat/picvue_proc.c index 8e388da1926f..c592bc8b8c99 100644 --- a/arch/mips/lasat/picvue_proc.c +++ b/arch/mips/lasat/picvue_proc.c | |||
@@ -64,7 +64,7 @@ static int pvc_line_proc_open(struct inode *inode, struct file *file) | |||
64 | static ssize_t pvc_line_proc_write(struct file *file, const char __user *buf, | 64 | static ssize_t pvc_line_proc_write(struct file *file, const char __user *buf, |
65 | size_t count, loff_t *pos) | 65 | size_t count, loff_t *pos) |
66 | { | 66 | { |
67 | int lineno = *(int *)PDE(file->f_path.dentry->d_inode)->data; | 67 | int lineno = *(int *)PDE(file_inode(file))->data; |
68 | char kbuf[PVC_LINELEN]; | 68 | char kbuf[PVC_LINELEN]; |
69 | size_t len; | 69 | size_t len; |
70 | 70 | ||
diff --git a/arch/mn10300/include/asm/elf.h b/arch/mn10300/include/asm/elf.h index 4ebd6b3a0a1e..f592d7a9f032 100644 --- a/arch/mn10300/include/asm/elf.h +++ b/arch/mn10300/include/asm/elf.h | |||
@@ -150,9 +150,4 @@ do { \ | |||
150 | */ | 150 | */ |
151 | #define ELF_PLATFORM (NULL) | 151 | #define ELF_PLATFORM (NULL) |
152 | 152 | ||
153 | #ifdef __KERNEL__ | ||
154 | #define SET_PERSONALITY(ex) \ | ||
155 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
156 | #endif | ||
157 | |||
158 | #endif /* _ASM_ELF_H */ | 153 | #endif /* _ASM_ELF_H */ |
diff --git a/arch/openrisc/include/asm/elf.h b/arch/openrisc/include/asm/elf.h index f4aa8a542a22..d334e204bbdd 100644 --- a/arch/openrisc/include/asm/elf.h +++ b/arch/openrisc/include/asm/elf.h | |||
@@ -62,7 +62,4 @@ extern void dump_elf_thread(elf_greg_t *dest, struct pt_regs *pt); | |||
62 | 62 | ||
63 | #define ELF_PLATFORM (NULL) | 63 | #define ELF_PLATFORM (NULL) |
64 | 64 | ||
65 | #define SET_PERSONALITY(ex) \ | ||
66 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
67 | |||
68 | #endif | 65 | #endif |
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h index 6abf0a163233..ac9790fc3836 100644 --- a/arch/powerpc/include/asm/elf.h +++ b/arch/powerpc/include/asm/elf.h | |||
@@ -103,8 +103,6 @@ do { \ | |||
103 | # define elf_read_implies_exec(ex, exec_stk) (is_32bit_task() ? \ | 103 | # define elf_read_implies_exec(ex, exec_stk) (is_32bit_task() ? \ |
104 | (exec_stk == EXSTACK_DEFAULT) : 0) | 104 | (exec_stk == EXSTACK_DEFAULT) : 0) |
105 | #else | 105 | #else |
106 | # define SET_PERSONALITY(ex) \ | ||
107 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
108 | # define elf_read_implies_exec(ex, exec_stk) (exec_stk == EXSTACK_DEFAULT) | 106 | # define elf_read_implies_exec(ex, exec_stk) (exec_stk == EXSTACK_DEFAULT) |
109 | #endif /* __powerpc64__ */ | 107 | #endif /* __powerpc64__ */ |
110 | 108 | ||
diff --git a/arch/powerpc/kernel/proc_powerpc.c b/arch/powerpc/kernel/proc_powerpc.c index c8ae3714e79b..f19d0bdc3241 100644 --- a/arch/powerpc/kernel/proc_powerpc.c +++ b/arch/powerpc/kernel/proc_powerpc.c | |||
@@ -32,7 +32,7 @@ | |||
32 | static loff_t page_map_seek( struct file *file, loff_t off, int whence) | 32 | static loff_t page_map_seek( struct file *file, loff_t off, int whence) |
33 | { | 33 | { |
34 | loff_t new; | 34 | loff_t new; |
35 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 35 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
36 | 36 | ||
37 | switch(whence) { | 37 | switch(whence) { |
38 | case 0: | 38 | case 0: |
@@ -55,13 +55,13 @@ static loff_t page_map_seek( struct file *file, loff_t off, int whence) | |||
55 | static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes, | 55 | static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes, |
56 | loff_t *ppos) | 56 | loff_t *ppos) |
57 | { | 57 | { |
58 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 58 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
59 | return simple_read_from_buffer(buf, nbytes, ppos, dp->data, dp->size); | 59 | return simple_read_from_buffer(buf, nbytes, ppos, dp->data, dp->size); |
60 | } | 60 | } |
61 | 61 | ||
62 | static int page_map_mmap( struct file *file, struct vm_area_struct *vma ) | 62 | static int page_map_mmap( struct file *file, struct vm_area_struct *vma ) |
63 | { | 63 | { |
64 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 64 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
65 | 65 | ||
66 | if ((vma->vm_end - vma->vm_start) > dp->size) | 66 | if ((vma->vm_end - vma->vm_start) > dp->size) |
67 | return -EINVAL; | 67 | return -EINVAL; |
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c index 8329190312c1..c642f0132988 100644 --- a/arch/powerpc/kernel/rtas_flash.c +++ b/arch/powerpc/kernel/rtas_flash.c | |||
@@ -191,7 +191,7 @@ static void free_flash_list(struct flash_block_list *f) | |||
191 | 191 | ||
192 | static int rtas_flash_release(struct inode *inode, struct file *file) | 192 | static int rtas_flash_release(struct inode *inode, struct file *file) |
193 | { | 193 | { |
194 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 194 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
195 | struct rtas_update_flash_t *uf; | 195 | struct rtas_update_flash_t *uf; |
196 | 196 | ||
197 | uf = (struct rtas_update_flash_t *) dp->data; | 197 | uf = (struct rtas_update_flash_t *) dp->data; |
@@ -253,7 +253,7 @@ static void get_flash_status_msg(int status, char *buf) | |||
253 | static ssize_t rtas_flash_read(struct file *file, char __user *buf, | 253 | static ssize_t rtas_flash_read(struct file *file, char __user *buf, |
254 | size_t count, loff_t *ppos) | 254 | size_t count, loff_t *ppos) |
255 | { | 255 | { |
256 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 256 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
257 | struct rtas_update_flash_t *uf; | 257 | struct rtas_update_flash_t *uf; |
258 | char msg[RTAS_MSG_MAXLEN]; | 258 | char msg[RTAS_MSG_MAXLEN]; |
259 | 259 | ||
@@ -282,7 +282,7 @@ void rtas_block_ctor(void *ptr) | |||
282 | static ssize_t rtas_flash_write(struct file *file, const char __user *buffer, | 282 | static ssize_t rtas_flash_write(struct file *file, const char __user *buffer, |
283 | size_t count, loff_t *off) | 283 | size_t count, loff_t *off) |
284 | { | 284 | { |
285 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 285 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
286 | struct rtas_update_flash_t *uf; | 286 | struct rtas_update_flash_t *uf; |
287 | char *p; | 287 | char *p; |
288 | int next_free; | 288 | int next_free; |
@@ -374,7 +374,7 @@ static void manage_flash(struct rtas_manage_flash_t *args_buf) | |||
374 | static ssize_t manage_flash_read(struct file *file, char __user *buf, | 374 | static ssize_t manage_flash_read(struct file *file, char __user *buf, |
375 | size_t count, loff_t *ppos) | 375 | size_t count, loff_t *ppos) |
376 | { | 376 | { |
377 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 377 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
378 | struct rtas_manage_flash_t *args_buf; | 378 | struct rtas_manage_flash_t *args_buf; |
379 | char msg[RTAS_MSG_MAXLEN]; | 379 | char msg[RTAS_MSG_MAXLEN]; |
380 | int msglen; | 380 | int msglen; |
@@ -391,7 +391,7 @@ static ssize_t manage_flash_read(struct file *file, char __user *buf, | |||
391 | static ssize_t manage_flash_write(struct file *file, const char __user *buf, | 391 | static ssize_t manage_flash_write(struct file *file, const char __user *buf, |
392 | size_t count, loff_t *off) | 392 | size_t count, loff_t *off) |
393 | { | 393 | { |
394 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 394 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
395 | struct rtas_manage_flash_t *args_buf; | 395 | struct rtas_manage_flash_t *args_buf; |
396 | const char reject_str[] = "0"; | 396 | const char reject_str[] = "0"; |
397 | const char commit_str[] = "1"; | 397 | const char commit_str[] = "1"; |
@@ -462,7 +462,7 @@ static int get_validate_flash_msg(struct rtas_validate_flash_t *args_buf, | |||
462 | static ssize_t validate_flash_read(struct file *file, char __user *buf, | 462 | static ssize_t validate_flash_read(struct file *file, char __user *buf, |
463 | size_t count, loff_t *ppos) | 463 | size_t count, loff_t *ppos) |
464 | { | 464 | { |
465 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 465 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
466 | struct rtas_validate_flash_t *args_buf; | 466 | struct rtas_validate_flash_t *args_buf; |
467 | char msg[RTAS_MSG_MAXLEN]; | 467 | char msg[RTAS_MSG_MAXLEN]; |
468 | int msglen; | 468 | int msglen; |
@@ -477,7 +477,7 @@ static ssize_t validate_flash_read(struct file *file, char __user *buf, | |||
477 | static ssize_t validate_flash_write(struct file *file, const char __user *buf, | 477 | static ssize_t validate_flash_write(struct file *file, const char __user *buf, |
478 | size_t count, loff_t *off) | 478 | size_t count, loff_t *off) |
479 | { | 479 | { |
480 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 480 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
481 | struct rtas_validate_flash_t *args_buf; | 481 | struct rtas_validate_flash_t *args_buf; |
482 | int rc; | 482 | int rc; |
483 | 483 | ||
@@ -526,7 +526,7 @@ done: | |||
526 | 526 | ||
527 | static int validate_flash_release(struct inode *inode, struct file *file) | 527 | static int validate_flash_release(struct inode *inode, struct file *file) |
528 | { | 528 | { |
529 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 529 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
530 | struct rtas_validate_flash_t *args_buf; | 530 | struct rtas_validate_flash_t *args_buf; |
531 | 531 | ||
532 | args_buf = (struct rtas_validate_flash_t *) dp->data; | 532 | args_buf = (struct rtas_validate_flash_t *) dp->data; |
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c index 657e3f233a64..c9500ea7be2f 100644 --- a/arch/powerpc/platforms/cell/spufs/coredump.c +++ b/arch/powerpc/platforms/cell/spufs/coredump.c | |||
@@ -111,7 +111,7 @@ static int match_context(const void *v, struct file *file, unsigned fd) | |||
111 | struct spu_context *ctx; | 111 | struct spu_context *ctx; |
112 | if (file->f_op != &spufs_context_fops) | 112 | if (file->f_op != &spufs_context_fops) |
113 | return 0; | 113 | return 0; |
114 | ctx = SPUFS_I(file->f_dentry->d_inode)->i_ctx; | 114 | ctx = SPUFS_I(file_inode(file))->i_ctx; |
115 | if (ctx->flags & SPU_CREATE_NOSCHED) | 115 | if (ctx->flags & SPU_CREATE_NOSCHED) |
116 | return 0; | 116 | return 0; |
117 | return fd + 1; | 117 | return fd + 1; |
@@ -137,7 +137,7 @@ static struct spu_context *coredump_next_context(int *fd) | |||
137 | return NULL; | 137 | return NULL; |
138 | *fd = n - 1; | 138 | *fd = n - 1; |
139 | file = fcheck(*fd); | 139 | file = fcheck(*fd); |
140 | return SPUFS_I(file->f_dentry->d_inode)->i_ctx; | 140 | return SPUFS_I(file_inode(file))->i_ctx; |
141 | } | 141 | } |
142 | 142 | ||
143 | int spufs_coredump_extra_notes_size(void) | 143 | int spufs_coredump_extra_notes_size(void) |
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 0cfece4cf6ef..68c57d38745a 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c | |||
@@ -1852,7 +1852,7 @@ out: | |||
1852 | 1852 | ||
1853 | static int spufs_mfc_fsync(struct file *file, loff_t start, loff_t end, int datasync) | 1853 | static int spufs_mfc_fsync(struct file *file, loff_t start, loff_t end, int datasync) |
1854 | { | 1854 | { |
1855 | struct inode *inode = file->f_path.dentry->d_inode; | 1855 | struct inode *inode = file_inode(file); |
1856 | int err = filemap_write_and_wait_range(inode->i_mapping, start, end); | 1856 | int err = filemap_write_and_wait_range(inode->i_mapping, start, end); |
1857 | if (!err) { | 1857 | if (!err) { |
1858 | mutex_lock(&inode->i_mutex); | 1858 | mutex_lock(&inode->i_mutex); |
@@ -2501,7 +2501,7 @@ static int switch_log_sprint(struct spu_context *ctx, char *tbuf, int n) | |||
2501 | static ssize_t spufs_switch_log_read(struct file *file, char __user *buf, | 2501 | static ssize_t spufs_switch_log_read(struct file *file, char __user *buf, |
2502 | size_t len, loff_t *ppos) | 2502 | size_t len, loff_t *ppos) |
2503 | { | 2503 | { |
2504 | struct inode *inode = file->f_path.dentry->d_inode; | 2504 | struct inode *inode = file_inode(file); |
2505 | struct spu_context *ctx = SPUFS_I(inode)->i_ctx; | 2505 | struct spu_context *ctx = SPUFS_I(inode)->i_ctx; |
2506 | int error = 0, cnt = 0; | 2506 | int error = 0, cnt = 0; |
2507 | 2507 | ||
@@ -2571,7 +2571,7 @@ static ssize_t spufs_switch_log_read(struct file *file, char __user *buf, | |||
2571 | 2571 | ||
2572 | static unsigned int spufs_switch_log_poll(struct file *file, poll_table *wait) | 2572 | static unsigned int spufs_switch_log_poll(struct file *file, poll_table *wait) |
2573 | { | 2573 | { |
2574 | struct inode *inode = file->f_path.dentry->d_inode; | 2574 | struct inode *inode = file_inode(file); |
2575 | struct spu_context *ctx = SPUFS_I(inode)->i_ctx; | 2575 | struct spu_context *ctx = SPUFS_I(inode)->i_ctx; |
2576 | unsigned int mask = 0; | 2576 | unsigned int mask = 0; |
2577 | int rc; | 2577 | int rc; |
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index dba1ce235da5..863184b182f4 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -199,37 +199,18 @@ static int spufs_fill_dir(struct dentry *dir, | |||
199 | const struct spufs_tree_descr *files, umode_t mode, | 199 | const struct spufs_tree_descr *files, umode_t mode, |
200 | struct spu_context *ctx) | 200 | struct spu_context *ctx) |
201 | { | 201 | { |
202 | struct dentry *dentry, *tmp; | ||
203 | int ret; | ||
204 | |||
205 | while (files->name && files->name[0]) { | 202 | while (files->name && files->name[0]) { |
206 | ret = -ENOMEM; | 203 | int ret; |
207 | dentry = d_alloc_name(dir, files->name); | 204 | struct dentry *dentry = d_alloc_name(dir, files->name); |
208 | if (!dentry) | 205 | if (!dentry) |
209 | goto out; | 206 | return -ENOMEM; |
210 | ret = spufs_new_file(dir->d_sb, dentry, files->ops, | 207 | ret = spufs_new_file(dir->d_sb, dentry, files->ops, |
211 | files->mode & mode, files->size, ctx); | 208 | files->mode & mode, files->size, ctx); |
212 | if (ret) | 209 | if (ret) |
213 | goto out; | 210 | return ret; |
214 | files++; | 211 | files++; |
215 | } | 212 | } |
216 | return 0; | 213 | return 0; |
217 | out: | ||
218 | /* | ||
219 | * remove all children from dir. dir->inode is not set so don't | ||
220 | * just simply use spufs_prune_dir() and panic afterwards :) | ||
221 | * dput() looks like it will do the right thing: | ||
222 | * - dec parent's ref counter | ||
223 | * - remove child from parent's child list | ||
224 | * - free child's inode if possible | ||
225 | * - free child | ||
226 | */ | ||
227 | list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_u.d_child) { | ||
228 | dput(dentry); | ||
229 | } | ||
230 | |||
231 | shrink_dcache_parent(dir); | ||
232 | return ret; | ||
233 | } | 214 | } |
234 | 215 | ||
235 | static int spufs_dir_close(struct inode *inode, struct file *file) | 216 | static int spufs_dir_close(struct inode *inode, struct file *file) |
@@ -269,10 +250,9 @@ spufs_mkdir(struct inode *dir, struct dentry *dentry, unsigned int flags, | |||
269 | struct inode *inode; | 250 | struct inode *inode; |
270 | struct spu_context *ctx; | 251 | struct spu_context *ctx; |
271 | 252 | ||
272 | ret = -ENOSPC; | ||
273 | inode = spufs_new_inode(dir->i_sb, mode | S_IFDIR); | 253 | inode = spufs_new_inode(dir->i_sb, mode | S_IFDIR); |
274 | if (!inode) | 254 | if (!inode) |
275 | goto out; | 255 | return -ENOSPC; |
276 | 256 | ||
277 | if (dir->i_mode & S_ISGID) { | 257 | if (dir->i_mode & S_ISGID) { |
278 | inode->i_gid = dir->i_gid; | 258 | inode->i_gid = dir->i_gid; |
@@ -280,40 +260,38 @@ spufs_mkdir(struct inode *dir, struct dentry *dentry, unsigned int flags, | |||
280 | } | 260 | } |
281 | ctx = alloc_spu_context(SPUFS_I(dir)->i_gang); /* XXX gang */ | 261 | ctx = alloc_spu_context(SPUFS_I(dir)->i_gang); /* XXX gang */ |
282 | SPUFS_I(inode)->i_ctx = ctx; | 262 | SPUFS_I(inode)->i_ctx = ctx; |
283 | if (!ctx) | 263 | if (!ctx) { |
284 | goto out_iput; | 264 | iput(inode); |
265 | return -ENOSPC; | ||
266 | } | ||
285 | 267 | ||
286 | ctx->flags = flags; | 268 | ctx->flags = flags; |
287 | inode->i_op = &simple_dir_inode_operations; | 269 | inode->i_op = &simple_dir_inode_operations; |
288 | inode->i_fop = &simple_dir_operations; | 270 | inode->i_fop = &simple_dir_operations; |
271 | |||
272 | mutex_lock(&inode->i_mutex); | ||
273 | |||
274 | dget(dentry); | ||
275 | inc_nlink(dir); | ||
276 | inc_nlink(inode); | ||
277 | |||
278 | d_instantiate(dentry, inode); | ||
279 | |||
289 | if (flags & SPU_CREATE_NOSCHED) | 280 | if (flags & SPU_CREATE_NOSCHED) |
290 | ret = spufs_fill_dir(dentry, spufs_dir_nosched_contents, | 281 | ret = spufs_fill_dir(dentry, spufs_dir_nosched_contents, |
291 | mode, ctx); | 282 | mode, ctx); |
292 | else | 283 | else |
293 | ret = spufs_fill_dir(dentry, spufs_dir_contents, mode, ctx); | 284 | ret = spufs_fill_dir(dentry, spufs_dir_contents, mode, ctx); |
294 | 285 | ||
295 | if (ret) | 286 | if (!ret && spufs_get_sb_info(dir->i_sb)->debug) |
296 | goto out_free_ctx; | ||
297 | |||
298 | if (spufs_get_sb_info(dir->i_sb)->debug) | ||
299 | ret = spufs_fill_dir(dentry, spufs_dir_debug_contents, | 287 | ret = spufs_fill_dir(dentry, spufs_dir_debug_contents, |
300 | mode, ctx); | 288 | mode, ctx); |
301 | 289 | ||
302 | if (ret) | 290 | if (ret) |
303 | goto out_free_ctx; | 291 | spufs_rmdir(dir, dentry); |
304 | 292 | ||
305 | d_instantiate(dentry, inode); | 293 | mutex_unlock(&inode->i_mutex); |
306 | dget(dentry); | ||
307 | inc_nlink(dir); | ||
308 | inc_nlink(dentry->d_inode); | ||
309 | goto out; | ||
310 | 294 | ||
311 | out_free_ctx: | ||
312 | spu_forget(ctx); | ||
313 | put_spu_context(ctx); | ||
314 | out_iput: | ||
315 | iput(inode); | ||
316 | out: | ||
317 | return ret; | 295 | return ret; |
318 | } | 296 | } |
319 | 297 | ||
@@ -368,7 +346,7 @@ spufs_assert_affinity(unsigned int flags, struct spu_gang *gang, | |||
368 | return ERR_PTR(-EINVAL); | 346 | return ERR_PTR(-EINVAL); |
369 | 347 | ||
370 | neighbor = get_spu_context( | 348 | neighbor = get_spu_context( |
371 | SPUFS_I(filp->f_dentry->d_inode)->i_ctx); | 349 | SPUFS_I(file_inode(filp))->i_ctx); |
372 | 350 | ||
373 | if (!list_empty(&neighbor->aff_list) && !(neighbor->aff_head) && | 351 | if (!list_empty(&neighbor->aff_list) && !(neighbor->aff_head) && |
374 | !list_is_last(&neighbor->aff_list, &gang->aff_list_head) && | 352 | !list_is_last(&neighbor->aff_list, &gang->aff_list_head) && |
diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/platforms/cell/spufs/syscalls.c index baee994fe810..b045fdda4845 100644 --- a/arch/powerpc/platforms/cell/spufs/syscalls.c +++ b/arch/powerpc/platforms/cell/spufs/syscalls.c | |||
@@ -47,7 +47,7 @@ static long do_spu_run(struct file *filp, | |||
47 | if (filp->f_op != &spufs_context_fops) | 47 | if (filp->f_op != &spufs_context_fops) |
48 | goto out; | 48 | goto out; |
49 | 49 | ||
50 | i = SPUFS_I(filp->f_path.dentry->d_inode); | 50 | i = SPUFS_I(file_inode(filp)); |
51 | ret = spufs_run_spu(i->i_ctx, &npc, &status); | 51 | ret = spufs_run_spu(i->i_ctx, &npc, &status); |
52 | 52 | ||
53 | if (put_user(npc, unpc)) | 53 | if (put_user(npc, unpc)) |
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c index c9311cfdfcac..cf4e7736e4f1 100644 --- a/arch/powerpc/platforms/pseries/hvCall_inst.c +++ b/arch/powerpc/platforms/pseries/hvCall_inst.c | |||
@@ -86,7 +86,7 @@ static int hcall_inst_seq_open(struct inode *inode, struct file *file) | |||
86 | 86 | ||
87 | rc = seq_open(file, &hcall_inst_seq_ops); | 87 | rc = seq_open(file, &hcall_inst_seq_ops); |
88 | seq = file->private_data; | 88 | seq = file->private_data; |
89 | seq->private = file->f_path.dentry->d_inode->i_private; | 89 | seq->private = file_inode(file)->i_private; |
90 | 90 | ||
91 | return rc; | 91 | return rc; |
92 | } | 92 | } |
diff --git a/arch/powerpc/platforms/pseries/scanlog.c b/arch/powerpc/platforms/pseries/scanlog.c index 554457294a2b..47f3cda2a68b 100644 --- a/arch/powerpc/platforms/pseries/scanlog.c +++ b/arch/powerpc/platforms/pseries/scanlog.c | |||
@@ -46,16 +46,12 @@ static struct proc_dir_entry *proc_ppc64_scan_log_dump; /* The proc file */ | |||
46 | static ssize_t scanlog_read(struct file *file, char __user *buf, | 46 | static ssize_t scanlog_read(struct file *file, char __user *buf, |
47 | size_t count, loff_t *ppos) | 47 | size_t count, loff_t *ppos) |
48 | { | 48 | { |
49 | struct inode * inode = file->f_path.dentry->d_inode; | 49 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
50 | struct proc_dir_entry *dp; | 50 | unsigned int *data = (unsigned int *)dp->data; |
51 | unsigned int *data; | ||
52 | int status; | 51 | int status; |
53 | unsigned long len, off; | 52 | unsigned long len, off; |
54 | unsigned int wait_time; | 53 | unsigned int wait_time; |
55 | 54 | ||
56 | dp = PDE(inode); | ||
57 | data = (unsigned int *)dp->data; | ||
58 | |||
59 | if (count > RTAS_DATA_BUF_SIZE) | 55 | if (count > RTAS_DATA_BUF_SIZE) |
60 | count = RTAS_DATA_BUF_SIZE; | 56 | count = RTAS_DATA_BUF_SIZE; |
61 | 57 | ||
diff --git a/arch/s390/hypfs/hypfs_dbfs.c b/arch/s390/hypfs/hypfs_dbfs.c index 13e76dabbe8b..9fd4a40c6752 100644 --- a/arch/s390/hypfs/hypfs_dbfs.c +++ b/arch/s390/hypfs/hypfs_dbfs.c | |||
@@ -54,7 +54,7 @@ static ssize_t dbfs_read(struct file *file, char __user *buf, | |||
54 | if (*ppos != 0) | 54 | if (*ppos != 0) |
55 | return 0; | 55 | return 0; |
56 | 56 | ||
57 | df = file->f_path.dentry->d_inode->i_private; | 57 | df = file_inode(file)->i_private; |
58 | mutex_lock(&df->lock); | 58 | mutex_lock(&df->lock); |
59 | if (!df->data) { | 59 | if (!df->data) { |
60 | data = hypfs_dbfs_data_alloc(df); | 60 | data = hypfs_dbfs_data_alloc(df); |
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index 06ea69bd387a..280ded8b79ba 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c | |||
@@ -119,7 +119,7 @@ static void hypfs_evict_inode(struct inode *inode) | |||
119 | 119 | ||
120 | static int hypfs_open(struct inode *inode, struct file *filp) | 120 | static int hypfs_open(struct inode *inode, struct file *filp) |
121 | { | 121 | { |
122 | char *data = filp->f_path.dentry->d_inode->i_private; | 122 | char *data = file_inode(filp)->i_private; |
123 | struct hypfs_sb_info *fs_info; | 123 | struct hypfs_sb_info *fs_info; |
124 | 124 | ||
125 | if (filp->f_mode & FMODE_WRITE) { | 125 | if (filp->f_mode & FMODE_WRITE) { |
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h index 178ff966a8ba..1bfdf24b85a2 100644 --- a/arch/s390/include/asm/elf.h +++ b/arch/s390/include/asm/elf.h | |||
@@ -180,10 +180,7 @@ extern unsigned long elf_hwcap; | |||
180 | extern char elf_platform[]; | 180 | extern char elf_platform[]; |
181 | #define ELF_PLATFORM (elf_platform) | 181 | #define ELF_PLATFORM (elf_platform) |
182 | 182 | ||
183 | #ifndef CONFIG_64BIT | 183 | #ifdef CONFIG_64BIT |
184 | #define SET_PERSONALITY(ex) \ | ||
185 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
186 | #else /* CONFIG_64BIT */ | ||
187 | #define SET_PERSONALITY(ex) \ | 184 | #define SET_PERSONALITY(ex) \ |
188 | do { \ | 185 | do { \ |
189 | if (personality(current->personality) != PER_LINUX32) \ | 186 | if (personality(current->personality) != PER_LINUX32) \ |
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index 09a94cd9debc..f1279dc2e1bc 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c | |||
@@ -611,7 +611,7 @@ debug_open(struct inode *inode, struct file *file) | |||
611 | debug_info_t *debug_info, *debug_info_snapshot; | 611 | debug_info_t *debug_info, *debug_info_snapshot; |
612 | 612 | ||
613 | mutex_lock(&debug_mutex); | 613 | mutex_lock(&debug_mutex); |
614 | debug_info = file->f_path.dentry->d_inode->i_private; | 614 | debug_info = file_inode(file)->i_private; |
615 | /* find debug view */ | 615 | /* find debug view */ |
616 | for (i = 0; i < DEBUG_MAX_VIEWS; i++) { | 616 | for (i = 0; i < DEBUG_MAX_VIEWS; i++) { |
617 | if (!debug_info->views[i]) | 617 | if (!debug_info->views[i]) |
diff --git a/arch/s390/pci/pci_debug.c b/arch/s390/pci/pci_debug.c index a303c95346cb..a5d07bc2a547 100644 --- a/arch/s390/pci/pci_debug.c +++ b/arch/s390/pci/pci_debug.c | |||
@@ -99,7 +99,7 @@ static ssize_t pci_perf_seq_write(struct file *file, const char __user *ubuf, | |||
99 | static int pci_perf_seq_open(struct inode *inode, struct file *filp) | 99 | static int pci_perf_seq_open(struct inode *inode, struct file *filp) |
100 | { | 100 | { |
101 | return single_open(filp, pci_perf_show, | 101 | return single_open(filp, pci_perf_show, |
102 | filp->f_path.dentry->d_inode->i_private); | 102 | file_inode(filp)->i_private); |
103 | } | 103 | } |
104 | 104 | ||
105 | static const struct file_operations debugfs_pci_perf_fops = { | 105 | static const struct file_operations debugfs_pci_perf_fops = { |
@@ -121,7 +121,7 @@ static int pci_debug_show(struct seq_file *m, void *v) | |||
121 | static int pci_debug_seq_open(struct inode *inode, struct file *filp) | 121 | static int pci_debug_seq_open(struct inode *inode, struct file *filp) |
122 | { | 122 | { |
123 | return single_open(filp, pci_debug_show, | 123 | return single_open(filp, pci_debug_show, |
124 | filp->f_path.dentry->d_inode->i_private); | 124 | file_inode(filp)->i_private); |
125 | } | 125 | } |
126 | 126 | ||
127 | static const struct file_operations debugfs_pci_debug_fops = { | 127 | static const struct file_operations debugfs_pci_debug_fops = { |
diff --git a/arch/score/include/asm/elf.h b/arch/score/include/asm/elf.h index 5d566c7a0af2..6a9421c693ca 100644 --- a/arch/score/include/asm/elf.h +++ b/arch/score/include/asm/elf.h | |||
@@ -52,11 +52,6 @@ typedef elf_fpreg_t elf_fpregset_t; | |||
52 | #define ELF_DATA ELFDATA2LSB | 52 | #define ELF_DATA ELFDATA2LSB |
53 | #define ELF_ARCH EM_SCORE7 | 53 | #define ELF_ARCH EM_SCORE7 |
54 | 54 | ||
55 | #define SET_PERSONALITY(ex) \ | ||
56 | do { \ | ||
57 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))); \ | ||
58 | } while (0) | ||
59 | |||
60 | struct task_struct; | 55 | struct task_struct; |
61 | struct pt_regs; | 56 | struct pt_regs; |
62 | 57 | ||
diff --git a/arch/sh/mm/alignment.c b/arch/sh/mm/alignment.c index 620fa7ff9eec..aea14855e656 100644 --- a/arch/sh/mm/alignment.c +++ b/arch/sh/mm/alignment.c | |||
@@ -140,7 +140,7 @@ static int alignment_proc_open(struct inode *inode, struct file *file) | |||
140 | static ssize_t alignment_proc_write(struct file *file, | 140 | static ssize_t alignment_proc_write(struct file *file, |
141 | const char __user *buffer, size_t count, loff_t *pos) | 141 | const char __user *buffer, size_t count, loff_t *pos) |
142 | { | 142 | { |
143 | int *data = PDE(file->f_path.dentry->d_inode)->data; | 143 | int *data = PDE(file_inode(file))->data; |
144 | char mode; | 144 | char mode; |
145 | 145 | ||
146 | if (count > 0) { | 146 | if (count > 0) { |
diff --git a/arch/sparc/include/asm/elf_32.h b/arch/sparc/include/asm/elf_32.h index ac74a2c98e6d..a24e41fcdde1 100644 --- a/arch/sparc/include/asm/elf_32.h +++ b/arch/sparc/include/asm/elf_32.h | |||
@@ -128,7 +128,4 @@ typedef struct { | |||
128 | 128 | ||
129 | #define ELF_PLATFORM (NULL) | 129 | #define ELF_PLATFORM (NULL) |
130 | 130 | ||
131 | #define SET_PERSONALITY(ex) \ | ||
132 | set_personality(PER_LINUX | (current->personality & (~PER_MASK))) | ||
133 | |||
134 | #endif /* !(__ASMSPARC_ELF_H) */ | 131 | #endif /* !(__ASMSPARC_ELF_H) */ |
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c index a703af19c281..03abf9b70011 100644 --- a/arch/x86/ia32/ia32_aout.c +++ b/arch/x86/ia32/ia32_aout.c | |||
@@ -271,7 +271,7 @@ static int load_aout_binary(struct linux_binprm *bprm) | |||
271 | if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && | 271 | if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && |
272 | N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) || | 272 | N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) || |
273 | N_TRSIZE(ex) || N_DRSIZE(ex) || | 273 | N_TRSIZE(ex) || N_DRSIZE(ex) || |
274 | i_size_read(bprm->file->f_path.dentry->d_inode) < | 274 | i_size_read(file_inode(bprm->file)) < |
275 | ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { | 275 | ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { |
276 | return -ENOEXEC; | 276 | return -ENOEXEC; |
277 | } | 277 | } |
@@ -425,12 +425,10 @@ beyond_if: | |||
425 | 425 | ||
426 | static int load_aout_library(struct file *file) | 426 | static int load_aout_library(struct file *file) |
427 | { | 427 | { |
428 | struct inode *inode; | ||
429 | unsigned long bss, start_addr, len, error; | 428 | unsigned long bss, start_addr, len, error; |
430 | int retval; | 429 | int retval; |
431 | struct exec ex; | 430 | struct exec ex; |
432 | 431 | ||
433 | inode = file->f_path.dentry->d_inode; | ||
434 | 432 | ||
435 | retval = -ENOEXEC; | 433 | retval = -ENOEXEC; |
436 | error = kernel_read(file, 0, (char *) &ex, sizeof(ex)); | 434 | error = kernel_read(file, 0, (char *) &ex, sizeof(ex)); |
@@ -440,7 +438,7 @@ static int load_aout_library(struct file *file) | |||
440 | /* We come in here for the regular a.out style of shared libraries */ | 438 | /* We come in here for the regular a.out style of shared libraries */ |
441 | if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != QMAGIC) || N_TRSIZE(ex) || | 439 | if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != QMAGIC) || N_TRSIZE(ex) || |
442 | N_DRSIZE(ex) || ((ex.a_entry & 0xfff) && N_MAGIC(ex) == ZMAGIC) || | 440 | N_DRSIZE(ex) || ((ex.a_entry & 0xfff) && N_MAGIC(ex) == ZMAGIC) || |
443 | i_size_read(inode) < | 441 | i_size_read(file_inode(file)) < |
444 | ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { | 442 | ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { |
445 | goto out; | 443 | goto out; |
446 | } | 444 | } |
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c index 60c78917190c..1e4dbcfe6d31 100644 --- a/arch/x86/kernel/cpuid.c +++ b/arch/x86/kernel/cpuid.c | |||
@@ -85,7 +85,7 @@ static ssize_t cpuid_read(struct file *file, char __user *buf, | |||
85 | { | 85 | { |
86 | char __user *tmp = buf; | 86 | char __user *tmp = buf; |
87 | struct cpuid_regs cmd; | 87 | struct cpuid_regs cmd; |
88 | int cpu = iminor(file->f_path.dentry->d_inode); | 88 | int cpu = iminor(file_inode(file)); |
89 | u64 pos = *ppos; | 89 | u64 pos = *ppos; |
90 | ssize_t bytes = 0; | 90 | ssize_t bytes = 0; |
91 | int err = 0; | 91 | int err = 0; |
@@ -116,7 +116,7 @@ static int cpuid_open(struct inode *inode, struct file *file) | |||
116 | unsigned int cpu; | 116 | unsigned int cpu; |
117 | struct cpuinfo_x86 *c; | 117 | struct cpuinfo_x86 *c; |
118 | 118 | ||
119 | cpu = iminor(file->f_path.dentry->d_inode); | 119 | cpu = iminor(file_inode(file)); |
120 | if (cpu >= nr_cpu_ids || !cpu_online(cpu)) | 120 | if (cpu >= nr_cpu_ids || !cpu_online(cpu)) |
121 | return -ENXIO; /* No such CPU */ | 121 | return -ENXIO; /* No such CPU */ |
122 | 122 | ||