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

new helper: file_inode(file)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 496ad9aa 57eccb83

+696 -717
+1 -1
arch/alpha/kernel/srm_env.c
··· 111 111 size_t count, loff_t *pos) 112 112 { 113 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 115 char *buf = (char *) __get_free_page(GFP_USER); 116 116 unsigned long ret1, ret2; 117 117
+1 -1
arch/blackfin/kernel/cplbinfo.c
··· 116 116 117 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 120 char cplb_type; 121 121 unsigned int cpu; 122 122 int ret;
+4 -4
arch/cris/arch-v10/drivers/sync_serial.c
··· 654 654 655 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 658 unsigned int mask = 0; 659 659 struct sync_port *port; 660 660 DEBUGPOLL(static unsigned int prev_mask = 0); ··· 685 685 int return_val = 0; 686 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 689 struct sync_port *port; 690 690 691 691 if (dev < 0 || dev >= NUMBER_OF_PORTS || !ports[dev].enabled) { ··· 973 973 static ssize_t sync_serial_write(struct file *file, const char *buf, 974 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 977 DECLARE_WAITQUEUE(wait, current); 978 978 struct sync_port *port; 979 979 unsigned long flags; ··· 1097 1097 static ssize_t sync_serial_read(struct file *file, char *buf, 1098 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 1101 int avail; 1102 1102 struct sync_port *port; 1103 1103 unsigned char *start;
+1 -2
arch/cris/arch-v32/drivers/cryptocop.c
··· 3135 3135 static long 3136 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 3138 long ret; 3140 3139 3141 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 3142 mutex_unlock(&cryptocop_mutex); 3144 3143 3145 3144 return ret;
+4 -4
arch/cris/arch-v32/drivers/sync_serial.c
··· 609 609 610 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 613 unsigned int mask = 0; 614 614 sync_port *port; 615 615 DEBUGPOLL( static unsigned int prev_mask = 0; ); ··· 657 657 { 658 658 int return_val = 0; 659 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 661 sync_port *port; 662 662 reg_sser_rw_tr_cfg tr_cfg; 663 663 reg_sser_rw_rec_cfg rec_cfg; ··· 979 979 static ssize_t sync_serial_write(struct file *file, const char *buf, 980 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 983 DECLARE_WAITQUEUE(wait, current); 984 984 struct sync_port *port; 985 985 int trunc_count; ··· 1102 1102 static ssize_t sync_serial_read(struct file * file, char * buf, 1103 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 1106 int avail; 1107 1107 sync_port *port; 1108 1108 unsigned char* start;
+3 -3
arch/ia64/kernel/salinfo.c
··· 301 301 static ssize_t 302 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 305 struct proc_dir_entry *entry = PDE(inode); 306 306 struct salinfo_data *data = entry->data; 307 307 char cmd[32]; ··· 463 463 static ssize_t 464 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 467 struct proc_dir_entry *entry = PDE(inode); 468 468 struct salinfo_data *data = entry->data; 469 469 u8 *buf; ··· 524 524 static ssize_t 525 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 528 struct proc_dir_entry *entry = PDE(inode); 529 529 struct salinfo_data *data = entry->data; 530 530 char cmd[32];
+4 -9
arch/mips/kernel/rtlx.c
··· 399 399 400 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 403 unsigned int mask = 0; 404 - 405 - minor = iminor(file->f_path.dentry->d_inode); 406 404 407 405 poll_wait(file, &channel_wqs[minor].rt_queue, wait); 408 406 poll_wait(file, &channel_wqs[minor].lx_queue, wait); ··· 422 424 static ssize_t file_read(struct file *file, char __user * buffer, size_t count, 423 425 loff_t * ppos) 424 426 { 425 - int minor = iminor(file->f_path.dentry->d_inode); 427 + int minor = iminor(file_inode(file)); 426 428 427 429 /* data available? */ 428 430 if (!rtlx_read_poll(minor, (file->f_flags & O_NONBLOCK) ? 0 : 1)) { ··· 435 437 static ssize_t file_write(struct file *file, const char __user * buffer, 436 438 size_t count, loff_t * ppos) 437 439 { 438 - int minor; 439 - struct rtlx_channel *rt; 440 - 441 - minor = iminor(file->f_path.dentry->d_inode); 442 - rt = &rtlx->channel[minor]; 440 + int minor = iminor(file_inode(file)); 441 + struct rtlx_channel *rt = &rtlx->channel[minor]; 443 442 444 443 /* any space left... */ 445 444 if (!rtlx_write_poll(minor)) {
+1 -1
arch/mips/kernel/vpe.c
··· 1149 1149 size_t ret = count; 1150 1150 struct vpe *v; 1151 1151 1152 - if (iminor(file->f_path.dentry->d_inode) != minor) 1152 + if (iminor(file_inode(file)) != minor) 1153 1153 return -ENODEV; 1154 1154 1155 1155 v = get_vpe(tclimit);
+1 -1
arch/mips/lasat/picvue_proc.c
··· 64 64 static ssize_t pvc_line_proc_write(struct file *file, const char __user *buf, 65 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 68 char kbuf[PVC_LINELEN]; 69 69 size_t len; 70 70
+3 -3
arch/powerpc/kernel/proc_powerpc.c
··· 32 32 static loff_t page_map_seek( struct file *file, loff_t off, int whence) 33 33 { 34 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 37 switch(whence) { 38 38 case 0: ··· 55 55 static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes, 56 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 59 return simple_read_from_buffer(buf, nbytes, ppos, dp->data, dp->size); 60 60 } 61 61 62 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 66 if ((vma->vm_end - vma->vm_start) > dp->size) 67 67 return -EINVAL;
+8 -8
arch/powerpc/kernel/rtas_flash.c
··· 191 191 192 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 195 struct rtas_update_flash_t *uf; 196 196 197 197 uf = (struct rtas_update_flash_t *) dp->data; ··· 253 253 static ssize_t rtas_flash_read(struct file *file, char __user *buf, 254 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 257 struct rtas_update_flash_t *uf; 258 258 char msg[RTAS_MSG_MAXLEN]; 259 259 ··· 282 282 static ssize_t rtas_flash_write(struct file *file, const char __user *buffer, 283 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 286 struct rtas_update_flash_t *uf; 287 287 char *p; 288 288 int next_free; ··· 374 374 static ssize_t manage_flash_read(struct file *file, char __user *buf, 375 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 378 struct rtas_manage_flash_t *args_buf; 379 379 char msg[RTAS_MSG_MAXLEN]; 380 380 int msglen; ··· 391 391 static ssize_t manage_flash_write(struct file *file, const char __user *buf, 392 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 395 struct rtas_manage_flash_t *args_buf; 396 396 const char reject_str[] = "0"; 397 397 const char commit_str[] = "1"; ··· 462 462 static ssize_t validate_flash_read(struct file *file, char __user *buf, 463 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 466 struct rtas_validate_flash_t *args_buf; 467 467 char msg[RTAS_MSG_MAXLEN]; 468 468 int msglen; ··· 477 477 static ssize_t validate_flash_write(struct file *file, const char __user *buf, 478 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 481 struct rtas_validate_flash_t *args_buf; 482 482 int rc; 483 483 ··· 526 526 527 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 530 struct rtas_validate_flash_t *args_buf; 531 531 532 532 args_buf = (struct rtas_validate_flash_t *) dp->data;
+2 -2
arch/powerpc/platforms/cell/spufs/coredump.c
··· 111 111 struct spu_context *ctx; 112 112 if (file->f_op != &spufs_context_fops) 113 113 return 0; 114 - ctx = SPUFS_I(file->f_dentry->d_inode)->i_ctx; 114 + ctx = SPUFS_I(file_inode(file))->i_ctx; 115 115 if (ctx->flags & SPU_CREATE_NOSCHED) 116 116 return 0; 117 117 return fd + 1; ··· 137 137 return NULL; 138 138 *fd = n - 1; 139 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 143 int spufs_coredump_extra_notes_size(void)
+3 -3
arch/powerpc/platforms/cell/spufs/file.c
··· 1852 1852 1853 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 1856 int err = filemap_write_and_wait_range(inode->i_mapping, start, end); 1857 1857 if (!err) { 1858 1858 mutex_lock(&inode->i_mutex); ··· 2501 2501 static ssize_t spufs_switch_log_read(struct file *file, char __user *buf, 2502 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 2505 struct spu_context *ctx = SPUFS_I(inode)->i_ctx; 2506 2506 int error = 0, cnt = 0; 2507 2507 ··· 2571 2571 2572 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 2575 struct spu_context *ctx = SPUFS_I(inode)->i_ctx; 2576 2576 unsigned int mask = 0; 2577 2577 int rc;
+1 -1
arch/powerpc/platforms/cell/spufs/inode.c
··· 368 368 return ERR_PTR(-EINVAL); 369 369 370 370 neighbor = get_spu_context( 371 - SPUFS_I(filp->f_dentry->d_inode)->i_ctx); 371 + SPUFS_I(file_inode(filp))->i_ctx); 372 372 373 373 if (!list_empty(&neighbor->aff_list) && !(neighbor->aff_head) && 374 374 !list_is_last(&neighbor->aff_list, &gang->aff_list_head) &&
+1 -1
arch/powerpc/platforms/cell/spufs/syscalls.c
··· 47 47 if (filp->f_op != &spufs_context_fops) 48 48 goto out; 49 49 50 - i = SPUFS_I(filp->f_path.dentry->d_inode); 50 + i = SPUFS_I(file_inode(filp)); 51 51 ret = spufs_run_spu(i->i_ctx, &npc, &status); 52 52 53 53 if (put_user(npc, unpc))
+1 -1
arch/powerpc/platforms/pseries/hvCall_inst.c
··· 86 86 87 87 rc = seq_open(file, &hcall_inst_seq_ops); 88 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 91 return rc; 92 92 }
+2 -6
arch/powerpc/platforms/pseries/scanlog.c
··· 46 46 static ssize_t scanlog_read(struct file *file, char __user *buf, 47 47 size_t count, loff_t *ppos) 48 48 { 49 - struct inode * inode = file->f_path.dentry->d_inode; 50 - struct proc_dir_entry *dp; 51 - unsigned int *data; 49 + struct proc_dir_entry *dp = PDE(file_inode(file)); 50 + unsigned int *data = (unsigned int *)dp->data; 52 51 int status; 53 52 unsigned long len, off; 54 53 unsigned int wait_time; 55 - 56 - dp = PDE(inode); 57 - data = (unsigned int *)dp->data; 58 54 59 55 if (count > RTAS_DATA_BUF_SIZE) 60 56 count = RTAS_DATA_BUF_SIZE;
+1 -1
arch/s390/hypfs/hypfs_dbfs.c
··· 54 54 if (*ppos != 0) 55 55 return 0; 56 56 57 - df = file->f_path.dentry->d_inode->i_private; 57 + df = file_inode(file)->i_private; 58 58 mutex_lock(&df->lock); 59 59 if (!df->data) { 60 60 data = hypfs_dbfs_data_alloc(df);
+1 -1
arch/s390/hypfs/inode.c
··· 119 119 120 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 123 struct hypfs_sb_info *fs_info; 124 124 125 125 if (filp->f_mode & FMODE_WRITE) {
+1 -1
arch/s390/kernel/debug.c
··· 611 611 debug_info_t *debug_info, *debug_info_snapshot; 612 612 613 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 615 /* find debug view */ 616 616 for (i = 0; i < DEBUG_MAX_VIEWS; i++) { 617 617 if (!debug_info->views[i])
+2 -2
arch/s390/pci/pci_debug.c
··· 99 99 static int pci_perf_seq_open(struct inode *inode, struct file *filp) 100 100 { 101 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 105 static const struct file_operations debugfs_pci_perf_fops = { ··· 121 121 static int pci_debug_seq_open(struct inode *inode, struct file *filp) 122 122 { 123 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 127 static const struct file_operations debugfs_pci_debug_fops = {
+1 -1
arch/sh/mm/alignment.c
··· 140 140 static ssize_t alignment_proc_write(struct file *file, 141 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 144 char mode; 145 145 146 146 if (count > 0) {
+2 -4
arch/x86/ia32/ia32_aout.c
··· 271 271 if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && 272 272 N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) || 273 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 275 ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { 276 276 return -ENOEXEC; 277 277 } ··· 425 425 426 426 static int load_aout_library(struct file *file) 427 427 { 428 - struct inode *inode; 429 428 unsigned long bss, start_addr, len, error; 430 429 int retval; 431 430 struct exec ex; 432 431 433 - inode = file->f_path.dentry->d_inode; 434 432 435 433 retval = -ENOEXEC; 436 434 error = kernel_read(file, 0, (char *) &ex, sizeof(ex)); ··· 438 440 /* We come in here for the regular a.out style of shared libraries */ 439 441 if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != QMAGIC) || N_TRSIZE(ex) || 440 442 N_DRSIZE(ex) || ((ex.a_entry & 0xfff) && N_MAGIC(ex) == ZMAGIC) || 441 - i_size_read(inode) < 443 + i_size_read(file_inode(file)) < 442 444 ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { 443 445 goto out; 444 446 }
+2 -2
arch/x86/kernel/cpuid.c
··· 85 85 { 86 86 char __user *tmp = buf; 87 87 struct cpuid_regs cmd; 88 - int cpu = iminor(file->f_path.dentry->d_inode); 88 + int cpu = iminor(file_inode(file)); 89 89 u64 pos = *ppos; 90 90 ssize_t bytes = 0; 91 91 int err = 0; ··· 116 116 unsigned int cpu; 117 117 struct cpuinfo_x86 *c; 118 118 119 - cpu = iminor(file->f_path.dentry->d_inode); 119 + cpu = iminor(file_inode(file)); 120 120 if (cpu >= nr_cpu_ids || !cpu_online(cpu)) 121 121 return -ENXIO; /* No such CPU */ 122 122
+1 -1
drivers/block/DAC960.c
··· 6547 6547 const char __user *Buffer, 6548 6548 size_t Count, loff_t *pos) 6549 6549 { 6550 - DAC960_Controller_T *Controller = (DAC960_Controller_T *) PDE(file->f_path.dentry->d_inode)->data; 6550 + DAC960_Controller_T *Controller = (DAC960_Controller_T *) PDE(file_inode(file))->data; 6551 6551 unsigned char CommandBuffer[80]; 6552 6552 int Length; 6553 6553 if (Count > sizeof(CommandBuffer)-1) return -EINVAL;
+1 -1
drivers/block/nbd.c
··· 625 625 return -EBUSY; 626 626 file = fget(arg); 627 627 if (file) { 628 - struct inode *inode = file->f_path.dentry->d_inode; 628 + struct inode *inode = file_inode(file); 629 629 if (S_ISSOCK(inode->i_mode)) { 630 630 nbd->file = file; 631 631 nbd->sock = SOCKET_I(inode);
+4 -4
drivers/char/dsp56k.c
··· 181 181 static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count, 182 182 loff_t *ppos) 183 183 { 184 - struct inode *inode = file->f_path.dentry->d_inode; 184 + struct inode *inode = file_inode(file); 185 185 int dev = iminor(inode) & 0x0f; 186 186 187 187 switch(dev) ··· 244 244 static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t count, 245 245 loff_t *ppos) 246 246 { 247 - struct inode *inode = file->f_path.dentry->d_inode; 247 + struct inode *inode = file_inode(file); 248 248 int dev = iminor(inode) & 0x0f; 249 249 250 250 switch(dev) ··· 306 306 static long dsp56k_ioctl(struct file *file, unsigned int cmd, 307 307 unsigned long arg) 308 308 { 309 - int dev = iminor(file->f_path.dentry->d_inode) & 0x0f; 309 + int dev = iminor(file_inode(file)) & 0x0f; 310 310 void __user *argp = (void __user *)arg; 311 311 312 312 switch(dev) ··· 408 408 #if 0 409 409 static unsigned int dsp56k_poll(struct file *file, poll_table *wait) 410 410 { 411 - int dev = iminor(file->f_path.dentry->d_inode) & 0x0f; 411 + int dev = iminor(file_inode(file)) & 0x0f; 412 412 413 413 switch(dev) 414 414 {
+2 -2
drivers/char/dtlk.c
··· 125 125 static ssize_t dtlk_read(struct file *file, char __user *buf, 126 126 size_t count, loff_t * ppos) 127 127 { 128 - unsigned int minor = iminor(file->f_path.dentry->d_inode); 128 + unsigned int minor = iminor(file_inode(file)); 129 129 char ch; 130 130 int i = 0, retries; 131 131 ··· 177 177 } 178 178 #endif 179 179 180 - if (iminor(file->f_path.dentry->d_inode) != DTLK_MINOR) 180 + if (iminor(file_inode(file)) != DTLK_MINOR) 181 181 return -EINVAL; 182 182 183 183 while (1) {
+4 -4
drivers/char/lp.c
··· 294 294 static ssize_t lp_write(struct file * file, const char __user * buf, 295 295 size_t count, loff_t *ppos) 296 296 { 297 - unsigned int minor = iminor(file->f_path.dentry->d_inode); 297 + unsigned int minor = iminor(file_inode(file)); 298 298 struct parport *port = lp_table[minor].dev->port; 299 299 char *kbuf = lp_table[minor].lp_buffer; 300 300 ssize_t retv = 0; ··· 413 413 size_t count, loff_t *ppos) 414 414 { 415 415 DEFINE_WAIT(wait); 416 - unsigned int minor=iminor(file->f_path.dentry->d_inode); 416 + unsigned int minor=iminor(file_inode(file)); 417 417 struct parport *port = lp_table[minor].dev->port; 418 418 ssize_t retval = 0; 419 419 char *kbuf = lp_table[minor].lp_buffer; ··· 679 679 struct timeval par_timeout; 680 680 int ret; 681 681 682 - minor = iminor(file->f_path.dentry->d_inode); 682 + minor = iminor(file_inode(file)); 683 683 mutex_lock(&lp_mutex); 684 684 switch (cmd) { 685 685 case LPSETTIMEOUT: ··· 707 707 struct timeval par_timeout; 708 708 int ret; 709 709 710 - minor = iminor(file->f_path.dentry->d_inode); 710 + minor = iminor(file_inode(file)); 711 711 mutex_lock(&lp_mutex); 712 712 switch (cmd) { 713 713 case LPSETTIMEOUT:
+2 -2
drivers/char/mem.c
··· 708 708 { 709 709 loff_t ret; 710 710 711 - mutex_lock(&file->f_path.dentry->d_inode->i_mutex); 711 + mutex_lock(&file_inode(file)->i_mutex); 712 712 switch (orig) { 713 713 case SEEK_CUR: 714 714 offset += file->f_pos; ··· 725 725 default: 726 726 ret = -EINVAL; 727 727 } 728 - mutex_unlock(&file->f_path.dentry->d_inode->i_mutex); 728 + mutex_unlock(&file_inode(file)->i_mutex); 729 729 return ret; 730 730 } 731 731
+2 -2
drivers/char/nsc_gpio.c
··· 41 41 ssize_t nsc_gpio_write(struct file *file, const char __user *data, 42 42 size_t len, loff_t *ppos) 43 43 { 44 - unsigned m = iminor(file->f_path.dentry->d_inode); 44 + unsigned m = iminor(file_inode(file)); 45 45 struct nsc_gpio_ops *amp = file->private_data; 46 46 struct device *dev = amp->dev; 47 47 size_t i; ··· 104 104 ssize_t nsc_gpio_read(struct file *file, char __user * buf, 105 105 size_t len, loff_t * ppos) 106 106 { 107 - unsigned m = iminor(file->f_path.dentry->d_inode); 107 + unsigned m = iminor(file_inode(file)); 108 108 int value; 109 109 struct nsc_gpio_ops *amp = file->private_data; 110 110
+1 -1
drivers/char/pcmcia/cm4000_cs.c
··· 1400 1400 { 1401 1401 struct cm4000_dev *dev = filp->private_data; 1402 1402 unsigned int iobase = dev->p_dev->resource[0]->start; 1403 - struct inode *inode = filp->f_path.dentry->d_inode; 1403 + struct inode *inode = file_inode(filp); 1404 1404 struct pcmcia_device *link; 1405 1405 int size; 1406 1406 int rc;
+3 -3
drivers/char/ppdev.c
··· 107 107 static ssize_t pp_read (struct file * file, char __user * buf, size_t count, 108 108 loff_t * ppos) 109 109 { 110 - unsigned int minor = iminor(file->f_path.dentry->d_inode); 110 + unsigned int minor = iminor(file_inode(file)); 111 111 struct pp_struct *pp = file->private_data; 112 112 char * kbuffer; 113 113 ssize_t bytes_read = 0; ··· 189 189 static ssize_t pp_write (struct file * file, const char __user * buf, 190 190 size_t count, loff_t * ppos) 191 191 { 192 - unsigned int minor = iminor(file->f_path.dentry->d_inode); 192 + unsigned int minor = iminor(file_inode(file)); 193 193 struct pp_struct *pp = file->private_data; 194 194 char * kbuffer; 195 195 ssize_t bytes_written = 0; ··· 324 324 325 325 static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 326 326 { 327 - unsigned int minor = iminor(file->f_path.dentry->d_inode); 327 + unsigned int minor = iminor(file_inode(file)); 328 328 struct pp_struct *pp = file->private_data; 329 329 struct parport * port; 330 330 void __user *argp = (void __user *)arg;
+1 -1
drivers/char/ps3flash.c
··· 312 312 313 313 static int ps3flash_fsync(struct file *file, loff_t start, loff_t end, int datasync) 314 314 { 315 - struct inode *inode = file->f_path.dentry->d_inode; 315 + struct inode *inode = file_inode(file); 316 316 int err; 317 317 mutex_lock(&inode->i_mutex); 318 318 err = ps3flash_writeback(ps3flash_dev);
+1 -1
drivers/char/raw.c
··· 80 80 filp->f_flags |= O_DIRECT; 81 81 filp->f_mapping = bdev->bd_inode->i_mapping; 82 82 if (++raw_devices[minor].inuse == 1) 83 - filp->f_path.dentry->d_inode->i_mapping = 83 + file_inode(filp)->i_mapping = 84 84 bdev->bd_inode->i_mapping; 85 85 filp->private_data = bdev; 86 86 mutex_unlock(&raw_mutex);
+1 -1
drivers/char/sonypi.c
··· 938 938 } 939 939 940 940 if (ret > 0) { 941 - struct inode *inode = file->f_path.dentry->d_inode; 941 + struct inode *inode = file_inode(file); 942 942 inode->i_atime = current_fs_time(inode->i_sb); 943 943 } 944 944
+2 -2
drivers/char/tb0219.c
··· 164 164 unsigned int minor; 165 165 char value; 166 166 167 - minor = iminor(file->f_path.dentry->d_inode); 167 + minor = iminor(file_inode(file)); 168 168 switch (minor) { 169 169 case 0: 170 170 value = get_led(); ··· 200 200 int retval = 0; 201 201 char c; 202 202 203 - minor = iminor(file->f_path.dentry->d_inode); 203 + minor = iminor(file_inode(file)); 204 204 switch (minor) { 205 205 case 0: 206 206 type = TYPE_LED;
+1 -1
drivers/gpu/drm/gma500/gtt.c
··· 202 202 WARN_ON(gt->pages); 203 203 204 204 /* This is the shared memory object that backs the GEM resource */ 205 - inode = gt->gem.filp->f_path.dentry->d_inode; 205 + inode = file_inode(gt->gem.filp); 206 206 mapping = inode->i_mapping; 207 207 208 208 gt->pages = kmalloc(pages * sizeof(struct page *), GFP_KERNEL);
+5 -5
drivers/gpu/drm/i915/i915_gem.c
··· 1635 1635 * To do this we must instruct the shmfs to drop all of its 1636 1636 * backing pages, *now*. 1637 1637 */ 1638 - inode = obj->base.filp->f_path.dentry->d_inode; 1638 + inode = file_inode(obj->base.filp); 1639 1639 shmem_truncate_range(inode, 0, (loff_t)-1); 1640 1640 1641 1641 obj->madv = __I915_MADV_PURGED; ··· 1800 1800 * 1801 1801 * Fail silently without starting the shrinker 1802 1802 */ 1803 - mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping; 1803 + mapping = file_inode(obj->base.filp)->i_mapping; 1804 1804 gfp = mapping_gfp_mask(mapping); 1805 1805 gfp |= __GFP_NORETRY | __GFP_NOWARN | __GFP_NO_KSWAPD; 1806 1806 gfp &= ~(__GFP_IO | __GFP_WAIT); ··· 3724 3724 mask |= __GFP_DMA32; 3725 3725 } 3726 3726 3727 - mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping; 3727 + mapping = file_inode(obj->base.filp)->i_mapping; 3728 3728 mapping_set_gfp_mask(mapping, mask); 3729 3729 3730 3730 i915_gem_object_init(obj, &i915_gem_object_ops); ··· 4228 4228 void i915_gem_detach_phys_object(struct drm_device *dev, 4229 4229 struct drm_i915_gem_object *obj) 4230 4230 { 4231 - struct address_space *mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping; 4231 + struct address_space *mapping = file_inode(obj->base.filp)->i_mapping; 4232 4232 char *vaddr; 4233 4233 int i; 4234 4234 int page_count; ··· 4264 4264 int id, 4265 4265 int align) 4266 4266 { 4267 - struct address_space *mapping = obj->base.filp->f_path.dentry->d_inode->i_mapping; 4267 + struct address_space *mapping = file_inode(obj->base.filp)->i_mapping; 4268 4268 drm_i915_private_t *dev_priv = dev->dev_private; 4269 4269 int ret = 0; 4270 4270 int page_count;
+2 -2
drivers/gpu/drm/ttm/ttm_tt.c
··· 296 296 swap_storage = ttm->swap_storage; 297 297 BUG_ON(swap_storage == NULL); 298 298 299 - swap_space = swap_storage->f_path.dentry->d_inode->i_mapping; 299 + swap_space = file_inode(swap_storage)->i_mapping; 300 300 301 301 for (i = 0; i < ttm->num_pages; ++i) { 302 302 from_page = shmem_read_mapping_page(swap_space, i); ··· 345 345 } else 346 346 swap_storage = persistent_swap_storage; 347 347 348 - swap_space = swap_storage->f_path.dentry->d_inode->i_mapping; 348 + swap_space = file_inode(swap_storage)->i_mapping; 349 349 350 350 for (i = 0; i < ttm->num_pages; ++i) { 351 351 from_page = ttm->pages[i];
+1 -1
drivers/gpu/drm/udl/udl_gem.c
··· 137 137 if (obj->pages == NULL) 138 138 return -ENOMEM; 139 139 140 - inode = obj->base.filp->f_path.dentry->d_inode; 140 + inode = file_inode(obj->base.filp); 141 141 mapping = inode->i_mapping; 142 142 gfpmask |= mapping_gfp_mask(mapping); 143 143
+1 -1
drivers/hid/hid-roccat.c
··· 378 378 379 379 static long roccat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 380 380 { 381 - struct inode *inode = file->f_path.dentry->d_inode; 381 + struct inode *inode = file_inode(file); 382 382 struct roccat_device *device; 383 383 unsigned int minor = iminor(inode); 384 384 long retval = 0;
+3 -3
drivers/hid/hidraw.c
··· 108 108 * This function is to be called with the minors_lock mutex held */ 109 109 static ssize_t hidraw_send_report(struct file *file, const char __user *buffer, size_t count, unsigned char report_type) 110 110 { 111 - unsigned int minor = iminor(file->f_path.dentry->d_inode); 111 + unsigned int minor = iminor(file_inode(file)); 112 112 struct hid_device *dev; 113 113 __u8 *buf; 114 114 int ret = 0; ··· 176 176 * mutex held. */ 177 177 static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t count, unsigned char report_type) 178 178 { 179 - unsigned int minor = iminor(file->f_path.dentry->d_inode); 179 + unsigned int minor = iminor(file_inode(file)); 180 180 struct hid_device *dev; 181 181 __u8 *buf; 182 182 int ret = 0, len; ··· 340 340 static long hidraw_ioctl(struct file *file, unsigned int cmd, 341 341 unsigned long arg) 342 342 { 343 - struct inode *inode = file->f_path.dentry->d_inode; 343 + struct inode *inode = file_inode(file); 344 344 unsigned int minor = iminor(inode); 345 345 long ret = 0; 346 346 struct hidraw *dev;
+2 -2
drivers/i2c/i2c-dev.c
··· 148 148 return -ENOMEM; 149 149 150 150 pr_debug("i2c-dev: i2c-%d reading %zu bytes.\n", 151 - iminor(file->f_path.dentry->d_inode), count); 151 + iminor(file_inode(file)), count); 152 152 153 153 ret = i2c_master_recv(client, tmp, count); 154 154 if (ret >= 0) ··· 172 172 return PTR_ERR(tmp); 173 173 174 174 pr_debug("i2c-dev: i2c-%d writing %zu bytes.\n", 175 - iminor(file->f_path.dentry->d_inode), count); 175 + iminor(file_inode(file)), count); 176 176 177 177 ret = i2c_master_send(client, tmp, count); 178 178 kfree(tmp);
+2 -2
drivers/ide/ide-proc.c
··· 333 333 static ssize_t ide_settings_proc_write(struct file *file, const char __user *buffer, 334 334 size_t count, loff_t *pos) 335 335 { 336 - ide_drive_t *drive = (ide_drive_t *) PDE(file->f_path.dentry->d_inode)->data; 336 + ide_drive_t *drive = (ide_drive_t *) PDE(file_inode(file))->data; 337 337 char name[MAX_LEN + 1]; 338 338 int for_real = 0, mul_factor, div_factor; 339 339 unsigned long n; ··· 558 558 static ssize_t ide_driver_proc_write(struct file *file, const char __user *buffer, 559 559 size_t count, loff_t *pos) 560 560 { 561 - ide_drive_t *drive = (ide_drive_t *) PDE(file->f_path.dentry->d_inode)->data; 561 + ide_drive_t *drive = (ide_drive_t *) PDE(file_inode(file))->data; 562 562 char name[32]; 563 563 564 564 if (!capable(CAP_SYS_ADMIN))
+1 -1
drivers/infiniband/core/uverbs_cmd.c
··· 730 730 goto err_tree_mutex_unlock; 731 731 } 732 732 733 - inode = f.file->f_path.dentry->d_inode; 733 + inode = file_inode(f.file); 734 734 xrcd = find_xrcd(file->device, inode); 735 735 if (!xrcd && !(cmd.oflags & O_CREAT)) { 736 736 /* no file descriptor. Need CREATE flag */
+2 -2
drivers/infiniband/hw/ipath/ipath_file_ops.c
··· 1864 1864 goto done_chk_sdma; 1865 1865 } 1866 1866 1867 - i_minor = iminor(fp->f_path.dentry->d_inode) - IPATH_USER_MINOR_BASE; 1867 + i_minor = iminor(file_inode(fp)) - IPATH_USER_MINOR_BASE; 1868 1868 ipath_cdbg(VERBOSE, "open on dev %lx (minor %d)\n", 1869 - (long)fp->f_path.dentry->d_inode->i_rdev, i_minor); 1869 + (long)file_inode(fp)->i_rdev, i_minor); 1870 1870 1871 1871 if (i_minor) 1872 1872 ret = find_free_port(i_minor - 1, fp, uinfo);
+3 -3
drivers/infiniband/hw/ipath/ipath_fs.c
··· 113 113 struct infinipath_counters counters; 114 114 struct ipath_devdata *dd; 115 115 116 - dd = file->f_path.dentry->d_inode->i_private; 116 + dd = file_inode(file)->i_private; 117 117 dd->ipath_f_read_counters(dd, &counters); 118 118 119 119 return simple_read_from_buffer(buf, count, ppos, &counters, ··· 154 154 goto bail; 155 155 } 156 156 157 - dd = file->f_path.dentry->d_inode->i_private; 157 + dd = file_inode(file)->i_private; 158 158 if (ipath_eeprom_read(dd, pos, tmp, count)) { 159 159 ipath_dev_err(dd, "failed to read from flash\n"); 160 160 ret = -ENXIO; ··· 207 207 goto bail_tmp; 208 208 } 209 209 210 - dd = file->f_path.dentry->d_inode->i_private; 210 + dd = file_inode(file)->i_private; 211 211 if (ipath_eeprom_write(dd, pos, tmp, count)) { 212 212 ret = -ENXIO; 213 213 ipath_dev_err(dd, "failed to write to flash\n");
+1 -1
drivers/infiniband/hw/qib/qib_file_ops.c
··· 1524 1524 } 1525 1525 } 1526 1526 1527 - i_minor = iminor(fp->f_dentry->d_inode) - QIB_USER_MINOR_BASE; 1527 + i_minor = iminor(file_inode(fp)) - QIB_USER_MINOR_BASE; 1528 1528 if (i_minor) 1529 1529 ret = find_free_ctxt(i_minor - 1, fp, uinfo); 1530 1530 else
+2 -2
drivers/infiniband/hw/qib/qib_fs.c
··· 45 45 46 46 static struct super_block *qib_super; 47 47 48 - #define private2dd(file) ((file)->f_dentry->d_inode->i_private) 48 + #define private2dd(file) (file_inode(file)->i_private) 49 49 50 50 static int qibfs_mknod(struct inode *dir, struct dentry *dentry, 51 51 umode_t mode, const struct file_operations *fops, ··· 171 171 }; 172 172 173 173 /* 174 - * Could use file->f_dentry->d_inode->i_ino to figure out which file, 174 + * Could use file_inode(file)->i_ino to figure out which file, 175 175 * instead of separate routine for each, but for now, this works... 176 176 */ 177 177
+1 -3
drivers/iommu/tegra-smmu.c
··· 964 964 { 965 965 struct smmu_debugfs_info *info; 966 966 struct smmu_device *smmu; 967 - struct dentry *dent; 968 967 int i; 969 968 enum { 970 969 _OFF = 0, ··· 991 992 if (i == ARRAY_SIZE(command)) 992 993 return -EINVAL; 993 994 994 - dent = file->f_dentry; 995 - info = dent->d_inode->i_private; 995 + info = file_inode(file)->i_private; 996 996 smmu = info->smmu; 997 997 998 998 offs = SMMU_CACHE_CONFIG(info->cache);
+3 -3
drivers/isdn/hardware/eicon/divasproc.c
··· 145 145 static ssize_t grp_opt_proc_write(struct file *file, const char __user *buffer, 146 146 size_t count, loff_t *pos) 147 147 { 148 - diva_os_xdi_adapter_t *a = PDE(file->f_path.dentry->d_inode)->data; 148 + diva_os_xdi_adapter_t *a = PDE(file_inode(file))->data; 149 149 PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1]; 150 150 151 151 if ((count == 1) || (count == 2)) { ··· 172 172 static ssize_t d_l1_down_proc_write(struct file *file, const char __user *buffer, 173 173 size_t count, loff_t *pos) 174 174 { 175 - diva_os_xdi_adapter_t *a = PDE(file->f_path.dentry->d_inode)->data; 175 + diva_os_xdi_adapter_t *a = PDE(file_inode(file))->data; 176 176 PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1]; 177 177 178 178 if ((count == 1) || (count == 2)) { ··· 251 251 static ssize_t info_proc_write(struct file *file, const char __user *buffer, 252 252 size_t count, loff_t *pos) 253 253 { 254 - diva_os_xdi_adapter_t *a = PDE(file->f_path.dentry->d_inode)->data; 254 + diva_os_xdi_adapter_t *a = PDE(file_inode(file))->data; 255 255 PISDN_ADAPTER IoAdapter = IoAdapters[a->controller - 1]; 256 256 char c[4]; 257 257
+2 -2
drivers/isdn/hysdn/hysdn_proclog.c
··· 173 173 { 174 174 struct log_data *inf; 175 175 int len; 176 - struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 176 + struct proc_dir_entry *pde = PDE(file_inode(file)); 177 177 struct procdata *pd = NULL; 178 178 hysdn_card *card; 179 179 ··· 319 319 hysdn_log_poll(struct file *file, poll_table *wait) 320 320 { 321 321 unsigned int mask = 0; 322 - struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 322 + struct proc_dir_entry *pde = PDE(file_inode(file)); 323 323 hysdn_card *card; 324 324 struct procdata *pd = NULL; 325 325
+4 -4
drivers/isdn/i4l/isdn_common.c
··· 1058 1058 static ssize_t 1059 1059 isdn_read(struct file *file, char __user *buf, size_t count, loff_t *off) 1060 1060 { 1061 - uint minor = iminor(file->f_path.dentry->d_inode); 1061 + uint minor = iminor(file_inode(file)); 1062 1062 int len = 0; 1063 1063 int drvidx; 1064 1064 int chidx; ··· 1165 1165 static ssize_t 1166 1166 isdn_write(struct file *file, const char __user *buf, size_t count, loff_t *off) 1167 1167 { 1168 - uint minor = iminor(file->f_path.dentry->d_inode); 1168 + uint minor = iminor(file_inode(file)); 1169 1169 int drvidx; 1170 1170 int chidx; 1171 1171 int retval; ··· 1228 1228 isdn_poll(struct file *file, poll_table *wait) 1229 1229 { 1230 1230 unsigned int mask = 0; 1231 - unsigned int minor = iminor(file->f_path.dentry->d_inode); 1231 + unsigned int minor = iminor(file_inode(file)); 1232 1232 int drvidx = isdn_minor2drv(minor - ISDN_MINOR_CTRL); 1233 1233 1234 1234 mutex_lock(&isdn_mutex); ··· 1269 1269 static int 1270 1270 isdn_ioctl(struct file *file, uint cmd, ulong arg) 1271 1271 { 1272 - uint minor = iminor(file->f_path.dentry->d_inode); 1272 + uint minor = iminor(file_inode(file)); 1273 1273 isdn_ctrl c; 1274 1274 int drvidx; 1275 1275 int ret;
+1 -1
drivers/isdn/i4l/isdn_ppp.c
··· 668 668 669 669 if (is->debug & 0x2) 670 670 printk(KERN_DEBUG "isdn_ppp_poll: minor: %d\n", 671 - iminor(file->f_path.dentry->d_inode)); 671 + iminor(file_inode(file))); 672 672 673 673 /* just registers wait_queue hook. This doesn't really wait. */ 674 674 poll_wait(file, &is->wq, wait);
+2 -2
drivers/md/bitmap.c
··· 337 337 struct page *page) 338 338 { 339 339 int ret = 0; 340 - struct inode *inode = file->f_path.dentry->d_inode; 340 + struct inode *inode = file_inode(file); 341 341 struct buffer_head *bh; 342 342 sector_t block; 343 343 ··· 755 755 free_buffers(sb_page); 756 756 757 757 if (file) { 758 - struct inode *inode = file->f_path.dentry->d_inode; 758 + struct inode *inode = file_inode(file); 759 759 invalidate_mapping_pages(inode->i_mapping, 0, -1); 760 760 fput(file); 761 761 }
+1 -1
drivers/media/pci/zoran/zoran_procfs.c
··· 137 137 static ssize_t zoran_write(struct file *file, const char __user *buffer, 138 138 size_t count, loff_t *ppos) 139 139 { 140 - struct zoran *zr = PDE(file->f_path.dentry->d_inode)->data; 140 + struct zoran *zr = PDE(file_inode(file))->data; 141 141 char *string, *sp; 142 142 char *line, *ldelim, *varname, *svar, *tdelim; 143 143
+7 -7
drivers/media/rc/lirc_dev.c
··· 531 531 532 532 unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait) 533 533 { 534 - struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)]; 534 + struct irctl *ir = irctls[iminor(file_inode(file))]; 535 535 unsigned int ret; 536 536 537 537 if (!ir) { ··· 565 565 { 566 566 __u32 mode; 567 567 int result = 0; 568 - struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)]; 568 + struct irctl *ir = irctls[iminor(file_inode(file))]; 569 569 570 570 if (!ir) { 571 571 printk(KERN_ERR "lirc_dev: %s: no irctl found!\n", __func__); ··· 650 650 size_t length, 651 651 loff_t *ppos) 652 652 { 653 - struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)]; 653 + struct irctl *ir = irctls[iminor(file_inode(file))]; 654 654 unsigned char *buf; 655 655 int ret = 0, written = 0; 656 656 DECLARE_WAITQUEUE(wait, current); ··· 754 754 { 755 755 void *data = NULL; 756 756 757 - if (file && file->f_dentry && file->f_dentry->d_inode && 758 - file->f_dentry->d_inode->i_rdev) { 757 + if (file && file->f_dentry && file_inode(file) && 758 + file_inode(file)->i_rdev) { 759 759 struct irctl *ir; 760 - ir = irctls[iminor(file->f_dentry->d_inode)]; 760 + ir = irctls[iminor(file_inode(file))]; 761 761 data = ir->d.data; 762 762 } 763 763 ··· 769 769 ssize_t lirc_dev_fop_write(struct file *file, const char __user *buffer, 770 770 size_t length, loff_t *ppos) 771 771 { 772 - struct irctl *ir = irctls[iminor(file->f_dentry->d_inode)]; 772 + struct irctl *ir = irctls[iminor(file_inode(file))]; 773 773 774 774 if (!ir) { 775 775 printk(KERN_ERR "%s: called with invalid irctl\n", __func__);
+1 -1
drivers/media/v4l2-core/v4l2-dev.c
··· 222 222 223 223 struct video_device *video_devdata(struct file *file) 224 224 { 225 - return video_device[iminor(file->f_path.dentry->d_inode)]; 225 + return video_device[iminor(file_inode(file))]; 226 226 } 227 227 EXPORT_SYMBOL(video_devdata); 228 228
+1 -1
drivers/mtd/ubi/cdev.c
··· 194 194 { 195 195 struct ubi_volume_desc *desc = file->private_data; 196 196 struct ubi_device *ubi = desc->vol->ubi; 197 - struct inode *inode = file->f_path.dentry->d_inode; 197 + struct inode *inode = file_inode(file); 198 198 int err; 199 199 mutex_lock(&inode->i_mutex); 200 200 err = ubi_sync(ubi->ubi_num);
+1 -1
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
··· 2336 2336 loff_t *ppos) 2337 2337 { 2338 2338 loff_t pos = *ppos; 2339 - loff_t avail = file->f_path.dentry->d_inode->i_size; 2339 + loff_t avail = file_inode(file)->i_size; 2340 2340 unsigned int mem = (uintptr_t)file->private_data & 3; 2341 2341 struct adapter *adap = file->private_data - mem; 2342 2342
+2 -2
drivers/net/wan/cosa.c
··· 939 939 int ret = 0; 940 940 941 941 mutex_lock(&cosa_chardev_mutex); 942 - if ((n=iminor(file->f_path.dentry->d_inode)>>CARD_MINOR_BITS) 942 + if ((n=iminor(file_inode(file))>>CARD_MINOR_BITS) 943 943 >= nr_cards) { 944 944 ret = -ENODEV; 945 945 goto out; 946 946 } 947 947 cosa = cosa_cards+n; 948 948 949 - if ((n=iminor(file->f_path.dentry->d_inode) 949 + if ((n=iminor(file_inode(file)) 950 950 & ((1<<CARD_MINOR_BITS)-1)) >= cosa->nchannels) { 951 951 ret = -ENODEV; 952 952 goto out;
+1 -1
drivers/net/wireless/ray_cs.c
··· 2769 2769 nr = nr * 10 + c; 2770 2770 p++; 2771 2771 } while (--len); 2772 - *(int *)PDE(file->f_path.dentry->d_inode)->data = nr; 2772 + *(int *)PDE(file_inode(file))->data = nr; 2773 2773 return count; 2774 2774 } 2775 2775
+1 -1
drivers/parisc/led.c
··· 179 179 static ssize_t led_proc_write(struct file *file, const char *buf, 180 180 size_t count, loff_t *pos) 181 181 { 182 - void *data = PDE(file->f_path.dentry->d_inode)->data; 182 + void *data = PDE(file_inode(file))->data; 183 183 char *cur, lbuf[32]; 184 184 int d; 185 185
+5 -5
drivers/pci/proc.c
··· 21 21 proc_bus_pci_lseek(struct file *file, loff_t off, int whence) 22 22 { 23 23 loff_t new = -1; 24 - struct inode *inode = file->f_path.dentry->d_inode; 24 + struct inode *inode = file_inode(file); 25 25 26 26 mutex_lock(&inode->i_mutex); 27 27 switch (whence) { ··· 46 46 static ssize_t 47 47 proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) 48 48 { 49 - const struct inode *ino = file->f_path.dentry->d_inode; 49 + const struct inode *ino = file_inode(file); 50 50 const struct proc_dir_entry *dp = PDE(ino); 51 51 struct pci_dev *dev = dp->data; 52 52 unsigned int pos = *ppos; ··· 132 132 static ssize_t 133 133 proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, loff_t *ppos) 134 134 { 135 - struct inode *ino = file->f_path.dentry->d_inode; 135 + struct inode *ino = file_inode(file); 136 136 const struct proc_dir_entry *dp = PDE(ino); 137 137 struct pci_dev *dev = dp->data; 138 138 int pos = *ppos; ··· 212 212 static long proc_bus_pci_ioctl(struct file *file, unsigned int cmd, 213 213 unsigned long arg) 214 214 { 215 - const struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); 215 + const struct proc_dir_entry *dp = PDE(file_inode(file)); 216 216 struct pci_dev *dev = dp->data; 217 217 #ifdef HAVE_PCI_MMAP 218 218 struct pci_filp_private *fpriv = file->private_data; ··· 253 253 #ifdef HAVE_PCI_MMAP 254 254 static int proc_bus_pci_mmap(struct file *file, struct vm_area_struct *vma) 255 255 { 256 - struct inode *inode = file->f_path.dentry->d_inode; 256 + struct inode *inode = file_inode(file); 257 257 const struct proc_dir_entry *dp = PDE(inode); 258 258 struct pci_dev *dev = dp->data; 259 259 struct pci_filp_private *fpriv = file->private_data;
+1 -1
drivers/platform/x86/sony-laptop.c
··· 3566 3566 } 3567 3567 3568 3568 if (ret > 0) { 3569 - struct inode *inode = file->f_path.dentry->d_inode; 3569 + struct inode *inode = file_inode(file); 3570 3570 inode->i_atime = current_fs_time(inode->i_sb); 3571 3571 } 3572 3572
+1 -1
drivers/platform/x86/thinkpad_acpi.c
··· 852 852 const char __user *userbuf, 853 853 size_t count, loff_t *pos) 854 854 { 855 - struct ibm_struct *ibm = PDE(file->f_path.dentry->d_inode)->data; 855 + struct ibm_struct *ibm = PDE(file_inode(file))->data; 856 856 char *kernbuf; 857 857 int ret; 858 858
+4 -4
drivers/platform/x86/toshiba_acpi.c
··· 583 583 static ssize_t lcd_proc_write(struct file *file, const char __user *buf, 584 584 size_t count, loff_t *pos) 585 585 { 586 - struct toshiba_acpi_dev *dev = PDE(file->f_path.dentry->d_inode)->data; 586 + struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data; 587 587 char cmd[42]; 588 588 size_t len; 589 589 int value; ··· 650 650 static ssize_t video_proc_write(struct file *file, const char __user *buf, 651 651 size_t count, loff_t *pos) 652 652 { 653 - struct toshiba_acpi_dev *dev = PDE(file->f_path.dentry->d_inode)->data; 653 + struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data; 654 654 char *cmd, *buffer; 655 655 int ret; 656 656 int value; ··· 750 750 static ssize_t fan_proc_write(struct file *file, const char __user *buf, 751 751 size_t count, loff_t *pos) 752 752 { 753 - struct toshiba_acpi_dev *dev = PDE(file->f_path.dentry->d_inode)->data; 753 + struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data; 754 754 char cmd[42]; 755 755 size_t len; 756 756 int value; ··· 822 822 static ssize_t keys_proc_write(struct file *file, const char __user *buf, 823 823 size_t count, loff_t *pos) 824 824 { 825 - struct toshiba_acpi_dev *dev = PDE(file->f_path.dentry->d_inode)->data; 825 + struct toshiba_acpi_dev *dev = PDE(file_inode(file))->data; 826 826 char cmd[42]; 827 827 size_t len; 828 828 int value;
+2 -2
drivers/pnp/isapnp/proc.c
··· 30 30 static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence) 31 31 { 32 32 loff_t new = -1; 33 - struct inode *inode = file->f_path.dentry->d_inode; 33 + struct inode *inode = file_inode(file); 34 34 35 35 mutex_lock(&inode->i_mutex); 36 36 switch (whence) { ··· 55 55 static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf, 56 56 size_t nbytes, loff_t * ppos) 57 57 { 58 - struct inode *ino = file->f_path.dentry->d_inode; 58 + struct inode *ino = file_inode(file); 59 59 struct proc_dir_entry *dp = PDE(ino); 60 60 struct pnp_dev *dev = dp->data; 61 61 int pos = *ppos;
+1 -1
drivers/pnp/pnpbios/proc.c
··· 244 244 static ssize_t pnpbios_proc_write(struct file *file, const char __user *buf, 245 245 size_t count, loff_t *pos) 246 246 { 247 - void *data = PDE(file->f_path.dentry->d_inode)->data; 247 + void *data = PDE(file_inode(file))->data; 248 248 struct pnp_bios_node *node; 249 249 int boot = (long)data >> 8; 250 250 u8 nodenum = (long)data;
+2 -2
drivers/s390/char/fs3270.c
··· 433 433 struct idal_buffer *ib; 434 434 int minor, rc = 0; 435 435 436 - if (imajor(filp->f_path.dentry->d_inode) != IBM_FS3270_MAJOR) 436 + if (imajor(file_inode(filp)) != IBM_FS3270_MAJOR) 437 437 return -ENODEV; 438 - minor = iminor(filp->f_path.dentry->d_inode); 438 + minor = iminor(file_inode(filp)); 439 439 /* Check for minor 0 multiplexer. */ 440 440 if (minor == 0) { 441 441 struct tty_struct *tty = get_current_tty();
+4 -4
drivers/s390/char/tape_char.c
··· 273 273 int minor, rc; 274 274 275 275 DBF_EVENT(6, "TCHAR:open: %i:%i\n", 276 - imajor(filp->f_path.dentry->d_inode), 277 - iminor(filp->f_path.dentry->d_inode)); 276 + imajor(file_inode(filp)), 277 + iminor(file_inode(filp))); 278 278 279 - if (imajor(filp->f_path.dentry->d_inode) != tapechar_major) 279 + if (imajor(file_inode(filp)) != tapechar_major) 280 280 return -ENODEV; 281 281 282 - minor = iminor(filp->f_path.dentry->d_inode); 282 + minor = iminor(file_inode(filp)); 283 283 device = tape_find_device(minor / TAPE_MINORS_PER_DEV); 284 284 if (IS_ERR(device)) { 285 285 DBF_EVENT(3, "TCHAR:open: tape_find_device() failed\n");
+1 -1
drivers/s390/char/vmur.c
··· 703 703 * We treat the minor number as the devno of the ur device 704 704 * to find in the driver tree. 705 705 */ 706 - devno = MINOR(file->f_dentry->d_inode->i_rdev); 706 + devno = MINOR(file_inode(file)->i_rdev); 707 707 708 708 urd = urdev_get_from_devno(devno); 709 709 if (!urd) {
+2 -2
drivers/s390/cio/qdio_debug.c
··· 128 128 static int qstat_seq_open(struct inode *inode, struct file *filp) 129 129 { 130 130 return single_open(filp, qstat_show, 131 - filp->f_path.dentry->d_inode->i_private); 131 + file_inode(filp)->i_private); 132 132 } 133 133 134 134 static const struct file_operations debugfs_fops = { ··· 221 221 static int qperf_seq_open(struct inode *inode, struct file *filp) 222 222 { 223 223 return single_open(filp, qperf_show, 224 - filp->f_path.dentry->d_inode->i_private); 224 + file_inode(filp)->i_private); 225 225 } 226 226 227 227 static struct file_operations debugfs_perf_fops = {
+1 -1
drivers/sbus/char/display7seg.c
··· 107 107 int error = 0; 108 108 u8 ireg = 0; 109 109 110 - if (D7S_MINOR != iminor(file->f_path.dentry->d_inode)) 110 + if (D7S_MINOR != iminor(file_inode(file))) 111 111 return -ENODEV; 112 112 113 113 mutex_lock(&d7s_mutex);
+1 -1
drivers/scsi/3w-9xxx.c
··· 640 640 /* This function handles ioctl for the character device */ 641 641 static long twa_chrdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 642 642 { 643 - struct inode *inode = file->f_path.dentry->d_inode; 643 + struct inode *inode = file_inode(file); 644 644 long timeout; 645 645 unsigned long *cpu_addr, data_buffer_length_adjusted = 0, flags = 0; 646 646 dma_addr_t dma_handle;
+1 -1
drivers/scsi/3w-sas.c
··· 757 757 dma_addr_t dma_handle; 758 758 int request_id = 0; 759 759 TW_Ioctl_Driver_Command driver_command; 760 - struct inode *inode = file->f_dentry->d_inode; 760 + struct inode *inode = file_inode(file); 761 761 TW_Ioctl_Buf_Apache *tw_ioctl; 762 762 TW_Command_Full *full_command_packet; 763 763 TW_Device_Extension *tw_dev = twl_device_extension_list[iminor(inode)];
+1 -1
drivers/scsi/3w-xxxx.c
··· 889 889 unsigned long flags; 890 890 unsigned int data_buffer_length = 0; 891 891 unsigned long data_buffer_length_adjusted = 0; 892 - struct inode *inode = file->f_dentry->d_inode; 892 + struct inode *inode = file_inode(file); 893 893 unsigned long *cpu_addr; 894 894 long timeout; 895 895 TW_New_Ioctl *tw_ioctl;
+1 -1
drivers/scsi/csiostor/csio_init.c
··· 71 71 csio_mem_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) 72 72 { 73 73 loff_t pos = *ppos; 74 - loff_t avail = file->f_path.dentry->d_inode->i_size; 74 + loff_t avail = file_inode(file)->i_size; 75 75 unsigned int mem = (uintptr_t)file->private_data & 3; 76 76 struct csio_hw *hw = file->private_data - mem; 77 77
+2 -2
drivers/scsi/dpt_i2o.c
··· 2161 2161 struct inode *inode; 2162 2162 long ret; 2163 2163 2164 - inode = file->f_dentry->d_inode; 2164 + inode = file_inode(file); 2165 2165 2166 2166 mutex_lock(&adpt_mutex); 2167 2167 ret = adpt_ioctl(inode, file, cmd, arg); ··· 2177 2177 struct inode *inode; 2178 2178 long ret; 2179 2179 2180 - inode = file->f_dentry->d_inode; 2180 + inode = file_inode(file); 2181 2181 2182 2182 mutex_lock(&adpt_mutex); 2183 2183
+1 -1
drivers/scsi/st.c
··· 977 977 struct st_modedef *STm; 978 978 struct st_partstat *STps; 979 979 char *name = tape_name(STp); 980 - struct inode *inode = filp->f_path.dentry->d_inode; 980 + struct inode *inode = file_inode(filp); 981 981 int mode = TAPE_MODE(inode); 982 982 983 983 STp->ready = ST_READY;
+1 -1
drivers/staging/bcm/Misc.c
··· 185 185 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Unable to Open %s\n", path); 186 186 return -ENOENT; 187 187 } 188 - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Opened file is = %s and length =0x%lx to be downloaded at =0x%x", path, (unsigned long)flp->f_dentry->d_inode->i_size, loc); 188 + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "Opened file is = %s and length =0x%lx to be downloaded at =0x%x", path, (unsigned long)file_inode(flp)->i_size, loc); 189 189 do_gettimeofday(&tv); 190 190 191 191 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, MP_INIT, DBG_LVL_ALL, "download start %lx", ((tv.tv_sec * 1000) + (tv.tv_usec / 1000)));
+1 -1
drivers/staging/ccg/f_mass_storage.c
··· 998 998 static void invalidate_sub(struct fsg_lun *curlun) 999 999 { 1000 1000 struct file *filp = curlun->filp; 1001 - struct inode *inode = filp->f_path.dentry->d_inode; 1001 + struct inode *inode = file_inode(filp); 1002 1002 unsigned long rc; 1003 1003 1004 1004 rc = invalidate_mapping_pages(inode->i_mapping, 0, -1);
+1 -1
drivers/staging/ccg/rndis.c
··· 1065 1065 static ssize_t rndis_proc_write(struct file *file, const char __user *buffer, 1066 1066 size_t count, loff_t *ppos) 1067 1067 { 1068 - rndis_params *p = PDE(file->f_path.dentry->d_inode)->data; 1068 + rndis_params *p = PDE(file_inode(file))->data; 1069 1069 u32 speed = 0; 1070 1070 int i, fl_speed = 0; 1071 1071
+1 -1
drivers/staging/ccg/storage_common.c
··· 656 656 if (!(filp->f_mode & FMODE_WRITE)) 657 657 ro = 1; 658 658 659 - inode = filp->f_path.dentry->d_inode; 659 + inode = file_inode(filp); 660 660 if ((!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) { 661 661 LINFO(curlun, "invalid file type: %s\n", filename); 662 662 goto out;
+2 -2
drivers/staging/dgrp/dgrp_specproc.c
··· 354 354 struct dgrp_proc_entry *entry; 355 355 int ret = 0; 356 356 357 - de = (struct proc_dir_entry *) PDE(file->f_dentry->d_inode); 357 + de = (struct proc_dir_entry *) PDE(file_inode(file)); 358 358 if (!de || !de->data) { 359 359 ret = -ENXIO; 360 360 goto done; ··· 384 384 struct proc_dir_entry *de; 385 385 struct dgrp_proc_entry *entry; 386 386 387 - de = (struct proc_dir_entry *) PDE(file->f_dentry->d_inode); 387 + de = (struct proc_dir_entry *) PDE(file_inode(file)); 388 388 if (!de || !de->data) 389 389 goto done; 390 390
+1 -1
drivers/staging/omapdrm/omap_gem_helpers.c
··· 40 40 int i, npages; 41 41 42 42 /* This is the shared memory object that backs the GEM resource */ 43 - inode = obj->filp->f_path.dentry->d_inode; 43 + inode = file_inode(obj->filp); 44 44 mapping = inode->i_mapping; 45 45 46 46 npages = obj->size >> PAGE_SHIFT;
+1 -1
drivers/staging/usbip/usbip_common.c
··· 411 411 return NULL; 412 412 } 413 413 414 - inode = file->f_dentry->d_inode; 414 + inode = file_inode(file); 415 415 416 416 if (!inode || !S_ISSOCK(inode->i_mode)) { 417 417 fput(file);
+4 -4
drivers/staging/vme/devices/vme_user.c
··· 318 318 static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count, 319 319 loff_t *ppos) 320 320 { 321 - unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev); 321 + unsigned int minor = MINOR(file_inode(file)->i_rdev); 322 322 ssize_t retval; 323 323 size_t image_size; 324 324 size_t okcount; ··· 364 364 static ssize_t vme_user_write(struct file *file, const char __user *buf, 365 365 size_t count, loff_t *ppos) 366 366 { 367 - unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev); 367 + unsigned int minor = MINOR(file_inode(file)->i_rdev); 368 368 ssize_t retval; 369 369 size_t image_size; 370 370 size_t okcount; ··· 410 410 static loff_t vme_user_llseek(struct file *file, loff_t off, int whence) 411 411 { 412 412 loff_t absolute = -1; 413 - unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev); 413 + unsigned int minor = MINOR(file_inode(file)->i_rdev); 414 414 size_t image_size; 415 415 416 416 if (minor == CONTROL_MINOR) ··· 583 583 int ret; 584 584 585 585 mutex_lock(&vme_user_mutex); 586 - ret = vme_user_ioctl(file->f_path.dentry->d_inode, file, cmd, arg); 586 + ret = vme_user_ioctl(file_inode(file), file, cmd, arg); 587 587 mutex_unlock(&vme_user_mutex); 588 588 589 589 return ret;
+1 -1
drivers/target/target_core_file.c
··· 265 265 * the expected virt_size for struct file w/o a backing struct 266 266 * block_device. 267 267 */ 268 - if (S_ISBLK(fd->f_dentry->d_inode->i_mode)) { 268 + if (S_ISBLK(file_inode(fd)->i_mode)) { 269 269 if (ret < 0 || ret != cmd->data_length) { 270 270 pr_err("%s() returned %d, expecting %u for " 271 271 "S_ISBLK\n", __func__, ret,
+4 -4
drivers/tty/vt/vc_screen.c
··· 101 101 poll = kzalloc(sizeof(*poll), GFP_KERNEL); 102 102 if (!poll) 103 103 return NULL; 104 - poll->cons_num = iminor(file->f_path.dentry->d_inode) & 127; 104 + poll->cons_num = iminor(file_inode(file)) & 127; 105 105 init_waitqueue_head(&poll->waitq); 106 106 poll->notifier.notifier_call = vcs_notifier; 107 107 if (register_vt_notifier(&poll->notifier) != 0) { ··· 182 182 int size; 183 183 184 184 console_lock(); 185 - size = vcs_size(file->f_path.dentry->d_inode); 185 + size = vcs_size(file_inode(file)); 186 186 console_unlock(); 187 187 if (size < 0) 188 188 return size; ··· 208 208 static ssize_t 209 209 vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) 210 210 { 211 - struct inode *inode = file->f_path.dentry->d_inode; 211 + struct inode *inode = file_inode(file); 212 212 unsigned int currcons = iminor(inode); 213 213 struct vc_data *vc; 214 214 struct vcs_poll_data *poll; ··· 386 386 static ssize_t 387 387 vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) 388 388 { 389 - struct inode *inode = file->f_path.dentry->d_inode; 389 + struct inode *inode = file_inode(file); 390 390 unsigned int currcons = iminor(inode); 391 391 struct vc_data *vc; 392 392 long pos;
+2 -2
drivers/usb/core/devices.c
··· 658 658 { 659 659 loff_t ret; 660 660 661 - mutex_lock(&file->f_dentry->d_inode->i_mutex); 661 + mutex_lock(&file_inode(file)->i_mutex); 662 662 663 663 switch (orig) { 664 664 case 0: ··· 674 674 ret = -EINVAL; 675 675 } 676 676 677 - mutex_unlock(&file->f_dentry->d_inode->i_mutex); 677 + mutex_unlock(&file_inode(file)->i_mutex); 678 678 return ret; 679 679 } 680 680
+3 -3
drivers/usb/core/devio.c
··· 160 160 { 161 161 loff_t ret; 162 162 163 - mutex_lock(&file->f_dentry->d_inode->i_mutex); 163 + mutex_lock(&file_inode(file)->i_mutex); 164 164 165 165 switch (orig) { 166 166 case 0: ··· 176 176 ret = -EINVAL; 177 177 } 178 178 179 - mutex_unlock(&file->f_dentry->d_inode->i_mutex); 179 + mutex_unlock(&file_inode(file)->i_mutex); 180 180 return ret; 181 181 } 182 182 ··· 1970 1970 void __user *p) 1971 1971 { 1972 1972 struct dev_state *ps = file->private_data; 1973 - struct inode *inode = file->f_path.dentry->d_inode; 1973 + struct inode *inode = file_inode(file); 1974 1974 struct usb_device *dev = ps->dev; 1975 1975 int ret = -ENOTTY; 1976 1976
+4 -4
drivers/usb/gadget/atmel_usba_udc.c
··· 93 93 if (!access_ok(VERIFY_WRITE, buf, nbytes)) 94 94 return -EFAULT; 95 95 96 - mutex_lock(&file->f_dentry->d_inode->i_mutex); 96 + mutex_lock(&file_inode(file)->i_mutex); 97 97 list_for_each_entry_safe(req, tmp_req, queue, queue) { 98 98 len = snprintf(tmpbuf, sizeof(tmpbuf), 99 99 "%8p %08x %c%c%c %5d %c%c%c\n", ··· 120 120 nbytes -= len; 121 121 buf += len; 122 122 } 123 - mutex_unlock(&file->f_dentry->d_inode->i_mutex); 123 + mutex_unlock(&file_inode(file)->i_mutex); 124 124 125 125 return actual; 126 126 } ··· 168 168 static ssize_t regs_dbg_read(struct file *file, char __user *buf, 169 169 size_t nbytes, loff_t *ppos) 170 170 { 171 - struct inode *inode = file->f_dentry->d_inode; 171 + struct inode *inode = file_inode(file); 172 172 int ret; 173 173 174 174 mutex_lock(&inode->i_mutex); 175 175 ret = simple_read_from_buffer(buf, nbytes, ppos, 176 176 file->private_data, 177 - file->f_dentry->d_inode->i_size); 177 + file_inode(file)->i_size); 178 178 mutex_unlock(&inode->i_mutex); 179 179 180 180 return ret;
+1 -1
drivers/usb/gadget/f_mass_storage.c
··· 992 992 static void invalidate_sub(struct fsg_lun *curlun) 993 993 { 994 994 struct file *filp = curlun->filp; 995 - struct inode *inode = filp->f_path.dentry->d_inode; 995 + struct inode *inode = file_inode(filp); 996 996 unsigned long rc; 997 997 998 998 rc = invalidate_mapping_pages(inode->i_mapping, 0, -1);
+1 -1
drivers/usb/gadget/printer.c
··· 688 688 printer_fsync(struct file *fd, loff_t start, loff_t end, int datasync) 689 689 { 690 690 struct printer_dev *dev = fd->private_data; 691 - struct inode *inode = fd->f_path.dentry->d_inode; 691 + struct inode *inode = file_inode(fd); 692 692 unsigned long flags; 693 693 int tx_list_empty; 694 694
+1 -1
drivers/usb/gadget/rndis.c
··· 1065 1065 static ssize_t rndis_proc_write(struct file *file, const char __user *buffer, 1066 1066 size_t count, loff_t *ppos) 1067 1067 { 1068 - rndis_params *p = PDE(file->f_path.dentry->d_inode)->data; 1068 + rndis_params *p = PDE(file_inode(file))->data; 1069 1069 u32 speed = 0; 1070 1070 int i, fl_speed = 0; 1071 1071
+1 -1
drivers/usb/gadget/storage_common.c
··· 501 501 if (!(filp->f_mode & FMODE_WRITE)) 502 502 ro = 1; 503 503 504 - inode = filp->f_path.dentry->d_inode; 504 + inode = file_inode(filp); 505 505 if ((!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) { 506 506 LINFO(curlun, "invalid file type: %s\n", filename); 507 507 goto out;
+1 -1
drivers/video/fb_defio.c
··· 69 69 int fb_deferred_io_fsync(struct file *file, loff_t start, loff_t end, int datasync) 70 70 { 71 71 struct fb_info *info = file->private_data; 72 - struct inode *inode = file->f_path.dentry->d_inode; 72 + struct inode *inode = file_inode(file); 73 73 int err = filemap_write_and_wait_range(inode->i_mapping, start, end); 74 74 if (err) 75 75 return err;
+1 -1
drivers/video/fbmem.c
··· 727 727 */ 728 728 static struct fb_info *file_fb_info(struct file *file) 729 729 { 730 - struct inode *inode = file->f_path.dentry->d_inode; 730 + struct inode *inode = file_inode(file); 731 731 int fbidx = iminor(inode); 732 732 struct fb_info *info = registered_fb[fbidx]; 733 733
+1 -1
drivers/video/msm/mdp.c
··· 261 261 if (f.file == NULL) 262 262 return -1; 263 263 264 - if (MAJOR(f.file->f_dentry->d_inode->i_rdev) == FB_MAJOR) { 264 + if (MAJOR(file_inode(f.file)->i_rdev) == FB_MAJOR) { 265 265 *start = info->fix.smem_start; 266 266 *len = info->fix.smem_len; 267 267 } else
+2 -2
drivers/watchdog/cpwd.c
··· 411 411 .identity = DRIVER_NAME, 412 412 }; 413 413 void __user *argp = (void __user *)arg; 414 - struct inode *inode = file->f_path.dentry->d_inode; 414 + struct inode *inode = file_inode(file); 415 415 int index = iminor(inode) - WD0_MINOR; 416 416 struct cpwd *p = cpwd_device; 417 417 int setopt = 0; ··· 499 499 static ssize_t cpwd_write(struct file *file, const char __user *buf, 500 500 size_t count, loff_t *ppos) 501 501 { 502 - struct inode *inode = file->f_path.dentry->d_inode; 502 + struct inode *inode = file_inode(file); 503 503 struct cpwd *p = cpwd_device; 504 504 int index = iminor(inode); 505 505
+2 -2
drivers/zorro/proc.c
··· 22 22 proc_bus_zorro_lseek(struct file *file, loff_t off, int whence) 23 23 { 24 24 loff_t new = -1; 25 - struct inode *inode = file->f_path.dentry->d_inode; 25 + struct inode *inode = file_inode(file); 26 26 27 27 mutex_lock(&inode->i_mutex); 28 28 switch (whence) { ··· 47 47 static ssize_t 48 48 proc_bus_zorro_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) 49 49 { 50 - struct inode *ino = file->f_path.dentry->d_inode; 50 + struct inode *ino = file_inode(file); 51 51 struct proc_dir_entry *dp = PDE(ino); 52 52 struct zorro_dev *z = dp->data; 53 53 struct ConfigDev cd;
+5 -5
fs/9p/vfs_file.c
··· 133 133 static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl) 134 134 { 135 135 int res = 0; 136 - struct inode *inode = filp->f_path.dentry->d_inode; 136 + struct inode *inode = file_inode(filp); 137 137 138 138 p9_debug(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl); 139 139 ··· 302 302 303 303 static int v9fs_file_lock_dotl(struct file *filp, int cmd, struct file_lock *fl) 304 304 { 305 - struct inode *inode = filp->f_path.dentry->d_inode; 305 + struct inode *inode = file_inode(filp); 306 306 int ret = -ENOLCK; 307 307 308 308 p9_debug(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n", ··· 338 338 static int v9fs_file_flock_dotl(struct file *filp, int cmd, 339 339 struct file_lock *fl) 340 340 { 341 - struct inode *inode = filp->f_path.dentry->d_inode; 341 + struct inode *inode = file_inode(filp); 342 342 int ret = -ENOLCK; 343 343 344 344 p9_debug(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n", ··· 529 529 if (!count) 530 530 goto out; 531 531 532 - retval = v9fs_file_write_internal(filp->f_path.dentry->d_inode, 532 + retval = v9fs_file_write_internal(file_inode(filp), 533 533 filp->private_data, 534 534 data, count, &origin, 1); 535 535 /* update offset on successful write */ ··· 604 604 struct v9fs_inode *v9inode; 605 605 struct page *page = vmf->page; 606 606 struct file *filp = vma->vm_file; 607 - struct inode *inode = filp->f_path.dentry->d_inode; 607 + struct inode *inode = file_inode(filp); 608 608 609 609 610 610 p9_debug(P9_DEBUG_VFS, "page %p fid %lx\n",
+1 -1
fs/adfs/dir.c
··· 19 19 static int 20 20 adfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 21 21 { 22 - struct inode *inode = filp->f_path.dentry->d_inode; 22 + struct inode *inode = file_inode(filp); 23 23 struct super_block *sb = inode->i_sb; 24 24 struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir; 25 25 struct object_info obj;
+1 -1
fs/affs/dir.c
··· 42 42 static int 43 43 affs_readdir(struct file *filp, void *dirent, filldir_t filldir) 44 44 { 45 - struct inode *inode = filp->f_path.dentry->d_inode; 45 + struct inode *inode = file_inode(filp); 46 46 struct super_block *sb = inode->i_sb; 47 47 struct buffer_head *dir_bh; 48 48 struct buffer_head *fh_bh;
+2 -2
fs/afs/dir.c
··· 393 393 int ret; 394 394 395 395 _enter("{%Ld,{%lu}}", 396 - file->f_pos, file->f_path.dentry->d_inode->i_ino); 396 + file->f_pos, file_inode(file)->i_ino); 397 397 398 398 ASSERT(file->private_data != NULL); 399 399 400 400 fpos = file->f_pos; 401 - ret = afs_dir_iterate(file->f_path.dentry->d_inode, &fpos, 401 + ret = afs_dir_iterate(file_inode(file), &fpos, 402 402 cookie, filldir, file->private_data); 403 403 file->f_pos = fpos; 404 404
+2 -2
fs/afs/flock.c
··· 514 514 */ 515 515 int afs_lock(struct file *file, int cmd, struct file_lock *fl) 516 516 { 517 - struct afs_vnode *vnode = AFS_FS_I(file->f_dentry->d_inode); 517 + struct afs_vnode *vnode = AFS_FS_I(file_inode(file)); 518 518 519 519 _enter("{%x:%u},%d,{t=%x,fl=%x,r=%Ld:%Ld}", 520 520 vnode->fid.vid, vnode->fid.vnode, cmd, ··· 537 537 */ 538 538 int afs_flock(struct file *file, int cmd, struct file_lock *fl) 539 539 { 540 - struct afs_vnode *vnode = AFS_FS_I(file->f_dentry->d_inode); 540 + struct afs_vnode *vnode = AFS_FS_I(file_inode(file)); 541 541 542 542 _enter("{%x:%u},%d,{t=%x,fl=%x}", 543 543 vnode->fid.vid, vnode->fid.vnode, cmd,
+3 -4
fs/afs/write.c
··· 120 120 struct page **pagep, void **fsdata) 121 121 { 122 122 struct afs_writeback *candidate, *wb; 123 - struct afs_vnode *vnode = AFS_FS_I(file->f_dentry->d_inode); 123 + struct afs_vnode *vnode = AFS_FS_I(file_inode(file)); 124 124 struct page *page; 125 125 struct key *key = file->private_data; 126 126 unsigned from = pos & (PAGE_CACHE_SIZE - 1); ··· 245 245 loff_t pos, unsigned len, unsigned copied, 246 246 struct page *page, void *fsdata) 247 247 { 248 - struct afs_vnode *vnode = AFS_FS_I(file->f_dentry->d_inode); 248 + struct afs_vnode *vnode = AFS_FS_I(file_inode(file)); 249 249 loff_t i_size, maybe_i_size; 250 250 251 251 _enter("{%x:%u},{%lx}", ··· 627 627 ssize_t afs_file_write(struct kiocb *iocb, const struct iovec *iov, 628 628 unsigned long nr_segs, loff_t pos) 629 629 { 630 - struct dentry *dentry = iocb->ki_filp->f_path.dentry; 631 - struct afs_vnode *vnode = AFS_FS_I(dentry->d_inode); 630 + struct afs_vnode *vnode = AFS_FS_I(file_inode(iocb->ki_filp)); 632 631 ssize_t result; 633 632 size_t count = iov_length(iov, nr_segs); 634 633
+1 -1
fs/autofs4/autofs_i.h
··· 273 273 { 274 274 if (!pipe->f_op || !pipe->f_op->write) 275 275 return -EINVAL; 276 - if (!S_ISFIFO(pipe->f_dentry->d_inode->i_mode)) 276 + if (!S_ISFIFO(file_inode(pipe)->i_mode)) 277 277 return -EINVAL; 278 278 /* We want a packet pipe */ 279 279 pipe->f_flags |= O_DIRECT;
+1 -1
fs/autofs4/dev-ioctl.c
··· 159 159 struct inode *inode; 160 160 161 161 if (f) { 162 - inode = f->f_path.dentry->d_inode; 162 + inode = file_inode(f); 163 163 sbi = autofs4_sbi(inode->i_sb); 164 164 } 165 165 return sbi;
+2 -2
fs/autofs4/root.c
··· 874 874 static long autofs4_root_ioctl(struct file *filp, 875 875 unsigned int cmd, unsigned long arg) 876 876 { 877 - struct inode *inode = filp->f_dentry->d_inode; 877 + struct inode *inode = file_inode(filp); 878 878 return autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); 879 879 } 880 880 ··· 882 882 static long autofs4_root_compat_ioctl(struct file *filp, 883 883 unsigned int cmd, unsigned long arg) 884 884 { 885 - struct inode *inode = filp->f_path.dentry->d_inode; 885 + struct inode *inode = file_inode(filp); 886 886 int ret; 887 887 888 888 if (cmd == AUTOFS_IOC_READY || cmd == AUTOFS_IOC_FAIL)
+1 -1
fs/befs/linuxvfs.c
··· 213 213 static int 214 214 befs_readdir(struct file *filp, void *dirent, filldir_t filldir) 215 215 { 216 - struct inode *inode = filp->f_path.dentry->d_inode; 216 + struct inode *inode = file_inode(filp); 217 217 struct super_block *sb = inode->i_sb; 218 218 befs_data_stream *ds = &BEFS_I(inode)->i_data.ds; 219 219 befs_off_t value;
+1 -1
fs/bfs/dir.c
··· 28 28 29 29 static int bfs_readdir(struct file *f, void *dirent, filldir_t filldir) 30 30 { 31 - struct inode *dir = f->f_path.dentry->d_inode; 31 + struct inode *dir = file_inode(f); 32 32 struct buffer_head *bh; 33 33 struct bfs_dirent *de; 34 34 struct bfs_sb_info *info = BFS_SB(dir->i_sb);
+2 -2
fs/binfmt_aout.c
··· 214 214 if ((N_MAGIC(ex) != ZMAGIC && N_MAGIC(ex) != OMAGIC && 215 215 N_MAGIC(ex) != QMAGIC && N_MAGIC(ex) != NMAGIC) || 216 216 N_TRSIZE(ex) || N_DRSIZE(ex) || 217 - i_size_read(bprm->file->f_path.dentry->d_inode) < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { 217 + i_size_read(file_inode(bprm->file)) < ex.a_text+ex.a_data+N_SYMSIZE(ex)+N_TXTOFF(ex)) { 218 218 return -ENOEXEC; 219 219 } 220 220 ··· 367 367 int retval; 368 368 struct exec ex; 369 369 370 - inode = file->f_path.dentry->d_inode; 370 + inode = file_inode(file); 371 371 372 372 retval = -ENOEXEC; 373 373 error = kernel_read(file, 0, (char *) &ex, sizeof(ex));
+1 -1
fs/binfmt_elf.c
··· 1140 1140 1141 1141 /* By default, dump shared memory if mapped from an anonymous file. */ 1142 1142 if (vma->vm_flags & VM_SHARED) { 1143 - if (vma->vm_file->f_path.dentry->d_inode->i_nlink == 0 ? 1143 + if (file_inode(vma->vm_file)->i_nlink == 0 ? 1144 1144 FILTER(ANON_SHARED) : FILTER(MAPPED_SHARED)) 1145 1145 goto whole; 1146 1146 return 0;
+2 -2
fs/binfmt_elf_fdpic.c
··· 909 909 910 910 dynamic_error: 911 911 printk("ELF FDPIC %s with invalid DYNAMIC section (inode=%lu)\n", 912 - what, file->f_path.dentry->d_inode->i_ino); 912 + what, file_inode(file)->i_ino); 913 913 return -ELIBBAD; 914 914 } 915 915 ··· 1219 1219 1220 1220 /* By default, dump shared memory if mapped from an anonymous file. */ 1221 1221 if (vma->vm_flags & VM_SHARED) { 1222 - if (vma->vm_file->f_path.dentry->d_inode->i_nlink == 0) { 1222 + if (file_inode(vma->vm_file)->i_nlink == 0) { 1223 1223 dump_ok = test_bit(MMF_DUMP_ANON_SHARED, &mm_flags); 1224 1224 kdcore("%08lx: %08lx: %s (share)", vma->vm_start, 1225 1225 vma->vm_flags, dump_ok ? "yes" : "no");
+1 -1
fs/binfmt_flat.c
··· 438 438 int ret; 439 439 440 440 hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */ 441 - inode = bprm->file->f_path.dentry->d_inode; 441 + inode = file_inode(bprm->file); 442 442 443 443 text_len = ntohl(hdr->data_start); 444 444 data_len = ntohl(hdr->data_end) - ntohl(hdr->data_start);
+2 -2
fs/binfmt_misc.c
··· 531 531 static ssize_t 532 532 bm_entry_read(struct file * file, char __user * buf, size_t nbytes, loff_t *ppos) 533 533 { 534 - Node *e = file->f_path.dentry->d_inode->i_private; 534 + Node *e = file_inode(file)->i_private; 535 535 ssize_t res; 536 536 char *page; 537 537 ··· 550 550 size_t count, loff_t *ppos) 551 551 { 552 552 struct dentry *root; 553 - Node *e = file->f_path.dentry->d_inode->i_private; 553 + Node *e = file_inode(file)->i_private; 554 554 int res = parse_command(buffer, count); 555 555 556 556 switch (res) {
+1 -1
fs/block_dev.c
··· 318 318 319 319 /* 320 320 * private llseek: 321 - * for a block special file file->f_path.dentry->d_inode->i_size is zero 321 + * for a block special file file_inode(file)->i_size is zero 322 322 * so we compute the size by hand (just as in block_read/write above) 323 323 */ 324 324 static loff_t block_llseek(struct file *file, loff_t offset, int whence)
+4 -4
fs/btrfs/file.c
··· 1211 1211 struct extent_state *cached_state = NULL; 1212 1212 int i; 1213 1213 unsigned long index = pos >> PAGE_CACHE_SHIFT; 1214 - struct inode *inode = fdentry(file)->d_inode; 1214 + struct inode *inode = file_inode(file); 1215 1215 gfp_t mask = btrfs_alloc_write_mask(inode->i_mapping); 1216 1216 int err = 0; 1217 1217 int faili = 0; ··· 1298 1298 struct iov_iter *i, 1299 1299 loff_t pos) 1300 1300 { 1301 - struct inode *inode = fdentry(file)->d_inode; 1301 + struct inode *inode = file_inode(file); 1302 1302 struct btrfs_root *root = BTRFS_I(inode)->root; 1303 1303 struct page **pages = NULL; 1304 1304 unsigned long first_index; ··· 1486 1486 unsigned long nr_segs, loff_t pos) 1487 1487 { 1488 1488 struct file *file = iocb->ki_filp; 1489 - struct inode *inode = fdentry(file)->d_inode; 1489 + struct inode *inode = file_inode(file); 1490 1490 struct btrfs_root *root = BTRFS_I(inode)->root; 1491 1491 loff_t *ppos = &iocb->ki_pos; 1492 1492 u64 start_pos; ··· 2087 2087 static long btrfs_fallocate(struct file *file, int mode, 2088 2088 loff_t offset, loff_t len) 2089 2089 { 2090 - struct inode *inode = file->f_path.dentry->d_inode; 2090 + struct inode *inode = file_inode(file); 2091 2091 struct extent_state *cached_state = NULL; 2092 2092 u64 cur_offset; 2093 2093 u64 last_byte;
+2 -2
fs/btrfs/inode.c
··· 4342 4342 static int btrfs_real_readdir(struct file *filp, void *dirent, 4343 4343 filldir_t filldir) 4344 4344 { 4345 - struct inode *inode = filp->f_dentry->d_inode; 4345 + struct inode *inode = file_inode(filp); 4346 4346 struct btrfs_root *root = BTRFS_I(inode)->root; 4347 4347 struct btrfs_item *item; 4348 4348 struct btrfs_dir_item *di; ··· 6737 6737 int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 6738 6738 { 6739 6739 struct page *page = vmf->page; 6740 - struct inode *inode = fdentry(vma->vm_file)->d_inode; 6740 + struct inode *inode = file_inode(vma->vm_file); 6741 6741 struct btrfs_root *root = BTRFS_I(inode)->root; 6742 6742 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; 6743 6743 struct btrfs_ordered_extent *ordered;
+26 -26
fs/btrfs/ioctl.c
··· 152 152 153 153 static int btrfs_ioctl_getflags(struct file *file, void __user *arg) 154 154 { 155 - struct btrfs_inode *ip = BTRFS_I(file->f_path.dentry->d_inode); 155 + struct btrfs_inode *ip = BTRFS_I(file_inode(file)); 156 156 unsigned int flags = btrfs_flags_to_ioctl(ip->flags); 157 157 158 158 if (copy_to_user(arg, &flags, sizeof(flags))) ··· 177 177 178 178 static int btrfs_ioctl_setflags(struct file *file, void __user *arg) 179 179 { 180 - struct inode *inode = file->f_path.dentry->d_inode; 180 + struct inode *inode = file_inode(file); 181 181 struct btrfs_inode *ip = BTRFS_I(inode); 182 182 struct btrfs_root *root = ip->root; 183 183 struct btrfs_trans_handle *trans; ··· 310 310 311 311 static int btrfs_ioctl_getversion(struct file *file, int __user *arg) 312 312 { 313 - struct inode *inode = file->f_path.dentry->d_inode; 313 + struct inode *inode = file_inode(file); 314 314 315 315 return put_user(inode->i_generation, arg); 316 316 } ··· 1317 1317 u64 new_size; 1318 1318 u64 old_size; 1319 1319 u64 devid = 1; 1320 - struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 1320 + struct btrfs_root *root = BTRFS_I(file_inode(file))->root; 1321 1321 struct btrfs_ioctl_vol_args *vol_args; 1322 1322 struct btrfs_trans_handle *trans; 1323 1323 struct btrfs_device *device = NULL; ··· 1483 1483 goto out_drop_write; 1484 1484 } 1485 1485 1486 - src_inode = src.file->f_path.dentry->d_inode; 1487 - if (src_inode->i_sb != file->f_path.dentry->d_inode->i_sb) { 1486 + src_inode = file_inode(src.file); 1487 + if (src_inode->i_sb != file_inode(file)->i_sb) { 1488 1488 printk(KERN_INFO "btrfs: Snapshot src from " 1489 1489 "another FS\n"); 1490 1490 ret = -EINVAL; ··· 1576 1576 static noinline int btrfs_ioctl_subvol_getflags(struct file *file, 1577 1577 void __user *arg) 1578 1578 { 1579 - struct inode *inode = fdentry(file)->d_inode; 1579 + struct inode *inode = file_inode(file); 1580 1580 struct btrfs_root *root = BTRFS_I(inode)->root; 1581 1581 int ret = 0; 1582 1582 u64 flags = 0; ··· 1598 1598 static noinline int btrfs_ioctl_subvol_setflags(struct file *file, 1599 1599 void __user *arg) 1600 1600 { 1601 - struct inode *inode = fdentry(file)->d_inode; 1601 + struct inode *inode = file_inode(file); 1602 1602 struct btrfs_root *root = BTRFS_I(inode)->root; 1603 1603 struct btrfs_trans_handle *trans; 1604 1604 u64 root_flags; ··· 1892 1892 if (IS_ERR(args)) 1893 1893 return PTR_ERR(args); 1894 1894 1895 - inode = fdentry(file)->d_inode; 1895 + inode = file_inode(file); 1896 1896 ret = search_ioctl(inode, args); 1897 1897 if (ret == 0 && copy_to_user(argp, args, sizeof(*args))) 1898 1898 ret = -EFAULT; ··· 2002 2002 if (IS_ERR(args)) 2003 2003 return PTR_ERR(args); 2004 2004 2005 - inode = fdentry(file)->d_inode; 2005 + inode = file_inode(file); 2006 2006 2007 2007 if (args->treeid == 0) 2008 2008 args->treeid = BTRFS_I(inode)->root->root_key.objectid; ··· 2178 2178 2179 2179 static int btrfs_ioctl_defrag(struct file *file, void __user *argp) 2180 2180 { 2181 - struct inode *inode = fdentry(file)->d_inode; 2181 + struct inode *inode = file_inode(file); 2182 2182 struct btrfs_root *root = BTRFS_I(inode)->root; 2183 2183 struct btrfs_ioctl_defrag_range_args *range; 2184 2184 int ret; ··· 2237 2237 /* the rest are all set to zero by kzalloc */ 2238 2238 range->len = (u64)-1; 2239 2239 } 2240 - ret = btrfs_defrag_file(fdentry(file)->d_inode, file, 2240 + ret = btrfs_defrag_file(file_inode(file), file, 2241 2241 range, 0, 0); 2242 2242 if (ret > 0) 2243 2243 ret = 0; ··· 2285 2285 2286 2286 static long btrfs_ioctl_rm_dev(struct file *file, void __user *arg) 2287 2287 { 2288 - struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 2288 + struct btrfs_root *root = BTRFS_I(file_inode(file))->root; 2289 2289 struct btrfs_ioctl_vol_args *vol_args; 2290 2290 int ret; 2291 2291 ··· 2408 2408 static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, 2409 2409 u64 off, u64 olen, u64 destoff) 2410 2410 { 2411 - struct inode *inode = fdentry(file)->d_inode; 2411 + struct inode *inode = file_inode(file); 2412 2412 struct btrfs_root *root = BTRFS_I(inode)->root; 2413 2413 struct fd src_file; 2414 2414 struct inode *src; ··· 2454 2454 if (src_file.file->f_path.mnt != file->f_path.mnt) 2455 2455 goto out_fput; 2456 2456 2457 - src = src_file.file->f_dentry->d_inode; 2457 + src = file_inode(src_file.file); 2458 2458 2459 2459 ret = -EINVAL; 2460 2460 if (src == inode) ··· 2816 2816 */ 2817 2817 static long btrfs_ioctl_trans_start(struct file *file) 2818 2818 { 2819 - struct inode *inode = fdentry(file)->d_inode; 2819 + struct inode *inode = file_inode(file); 2820 2820 struct btrfs_root *root = BTRFS_I(inode)->root; 2821 2821 struct btrfs_trans_handle *trans; 2822 2822 int ret; ··· 2856 2856 2857 2857 static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp) 2858 2858 { 2859 - struct inode *inode = fdentry(file)->d_inode; 2859 + struct inode *inode = file_inode(file); 2860 2860 struct btrfs_root *root = BTRFS_I(inode)->root; 2861 2861 struct btrfs_root *new_root; 2862 2862 struct btrfs_dir_item *di; ··· 3080 3080 */ 3081 3081 long btrfs_ioctl_trans_end(struct file *file) 3082 3082 { 3083 - struct inode *inode = fdentry(file)->d_inode; 3083 + struct inode *inode = file_inode(file); 3084 3084 struct btrfs_root *root = BTRFS_I(inode)->root; 3085 3085 struct btrfs_trans_handle *trans; 3086 3086 ··· 3142 3142 3143 3143 static long btrfs_ioctl_scrub(struct file *file, void __user *arg) 3144 3144 { 3145 - struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3145 + struct btrfs_root *root = BTRFS_I(file_inode(file))->root; 3146 3146 struct btrfs_ioctl_scrub_args *sa; 3147 3147 int ret; 3148 3148 ··· 3433 3433 3434 3434 static long btrfs_ioctl_balance(struct file *file, void __user *arg) 3435 3435 { 3436 - struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3436 + struct btrfs_root *root = BTRFS_I(file_inode(file))->root; 3437 3437 struct btrfs_fs_info *fs_info = root->fs_info; 3438 3438 struct btrfs_ioctl_balance_args *bargs; 3439 3439 struct btrfs_balance_control *bctl; ··· 3573 3573 3574 3574 static long btrfs_ioctl_quota_ctl(struct file *file, void __user *arg) 3575 3575 { 3576 - struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3576 + struct btrfs_root *root = BTRFS_I(file_inode(file))->root; 3577 3577 struct btrfs_ioctl_quota_ctl_args *sa; 3578 3578 struct btrfs_trans_handle *trans = NULL; 3579 3579 int ret; ··· 3632 3632 3633 3633 static long btrfs_ioctl_qgroup_assign(struct file *file, void __user *arg) 3634 3634 { 3635 - struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3635 + struct btrfs_root *root = BTRFS_I(file_inode(file))->root; 3636 3636 struct btrfs_ioctl_qgroup_assign_args *sa; 3637 3637 struct btrfs_trans_handle *trans; 3638 3638 int ret; ··· 3679 3679 3680 3680 static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg) 3681 3681 { 3682 - struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3682 + struct btrfs_root *root = BTRFS_I(file_inode(file))->root; 3683 3683 struct btrfs_ioctl_qgroup_create_args *sa; 3684 3684 struct btrfs_trans_handle *trans; 3685 3685 int ret; ··· 3725 3725 3726 3726 static long btrfs_ioctl_qgroup_limit(struct file *file, void __user *arg) 3727 3727 { 3728 - struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3728 + struct btrfs_root *root = BTRFS_I(file_inode(file))->root; 3729 3729 struct btrfs_ioctl_qgroup_limit_args *sa; 3730 3730 struct btrfs_trans_handle *trans; 3731 3731 int ret; ··· 3775 3775 void __user *arg) 3776 3776 { 3777 3777 struct btrfs_ioctl_received_subvol_args *sa = NULL; 3778 - struct inode *inode = fdentry(file)->d_inode; 3778 + struct inode *inode = file_inode(file); 3779 3779 struct btrfs_root *root = BTRFS_I(inode)->root; 3780 3780 struct btrfs_root_item *root_item = &root->root_item; 3781 3781 struct btrfs_trans_handle *trans; ··· 3855 3855 long btrfs_ioctl(struct file *file, unsigned int 3856 3856 cmd, unsigned long arg) 3857 3857 { 3858 - struct btrfs_root *root = BTRFS_I(fdentry(file)->d_inode)->root; 3858 + struct btrfs_root *root = BTRFS_I(file_inode(file))->root; 3859 3859 void __user *argp = (void __user *)arg; 3860 3860 3861 3861 switch (cmd) {
+1 -1
fs/btrfs/send.c
··· 4542 4542 if (!capable(CAP_SYS_ADMIN)) 4543 4543 return -EPERM; 4544 4544 4545 - send_root = BTRFS_I(fdentry(mnt_file)->d_inode)->root; 4545 + send_root = BTRFS_I(file_inode(mnt_file))->root; 4546 4546 fs_info = send_root->fs_info; 4547 4547 4548 4548 arg = memdup_user(arg_, sizeof(*arg));
+2 -2
fs/buffer.c
··· 2332 2332 get_block_t get_block) 2333 2333 { 2334 2334 struct page *page = vmf->page; 2335 - struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 2335 + struct inode *inode = file_inode(vma->vm_file); 2336 2336 unsigned long end; 2337 2337 loff_t size; 2338 2338 int ret; ··· 2371 2371 get_block_t get_block) 2372 2372 { 2373 2373 int ret; 2374 - struct super_block *sb = vma->vm_file->f_path.dentry->d_inode->i_sb; 2374 + struct super_block *sb = file_inode(vma->vm_file)->i_sb; 2375 2375 2376 2376 sb_start_pagefault(sb); 2377 2377
+6 -6
fs/ceph/addr.c
··· 195 195 */ 196 196 static int readpage_nounlock(struct file *filp, struct page *page) 197 197 { 198 - struct inode *inode = filp->f_dentry->d_inode; 198 + struct inode *inode = file_inode(filp); 199 199 struct ceph_inode_info *ci = ceph_inode(inode); 200 200 struct ceph_osd_client *osdc = 201 201 &ceph_inode_to_client(inode)->client->osdc; ··· 370 370 static int ceph_readpages(struct file *file, struct address_space *mapping, 371 371 struct list_head *page_list, unsigned nr_pages) 372 372 { 373 - struct inode *inode = file->f_dentry->d_inode; 373 + struct inode *inode = file_inode(file); 374 374 struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 375 375 int rc = 0; 376 376 int max = 0; ··· 977 977 loff_t pos, unsigned len, 978 978 struct page *page) 979 979 { 980 - struct inode *inode = file->f_dentry->d_inode; 980 + struct inode *inode = file_inode(file); 981 981 struct ceph_inode_info *ci = ceph_inode(inode); 982 982 struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; 983 983 loff_t page_off = pos & PAGE_CACHE_MASK; ··· 1086 1086 loff_t pos, unsigned len, unsigned flags, 1087 1087 struct page **pagep, void **fsdata) 1088 1088 { 1089 - struct inode *inode = file->f_dentry->d_inode; 1089 + struct inode *inode = file_inode(file); 1090 1090 struct ceph_inode_info *ci = ceph_inode(inode); 1091 1091 struct ceph_file_info *fi = file->private_data; 1092 1092 struct page *page; ··· 1144 1144 loff_t pos, unsigned len, unsigned copied, 1145 1145 struct page *page, void *fsdata) 1146 1146 { 1147 - struct inode *inode = file->f_dentry->d_inode; 1147 + struct inode *inode = file_inode(file); 1148 1148 struct ceph_inode_info *ci = ceph_inode(inode); 1149 1149 struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 1150 1150 struct ceph_mds_client *mdsc = fsc->mdsc; ··· 1228 1228 */ 1229 1229 static int ceph_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 1230 1230 { 1231 - struct inode *inode = vma->vm_file->f_dentry->d_inode; 1231 + struct inode *inode = file_inode(vma->vm_file); 1232 1232 struct page *page = vmf->page; 1233 1233 struct ceph_mds_client *mdsc = ceph_inode_to_client(inode)->mdsc; 1234 1234 loff_t off = page_offset(page);
+3 -3
fs/ceph/dir.c
··· 238 238 static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir) 239 239 { 240 240 struct ceph_file_info *fi = filp->private_data; 241 - struct inode *inode = filp->f_dentry->d_inode; 241 + struct inode *inode = file_inode(filp); 242 242 struct ceph_inode_info *ci = ceph_inode(inode); 243 243 struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 244 244 struct ceph_mds_client *mdsc = fsc->mdsc; ··· 1138 1138 loff_t *ppos) 1139 1139 { 1140 1140 struct ceph_file_info *cf = file->private_data; 1141 - struct inode *inode = file->f_dentry->d_inode; 1141 + struct inode *inode = file_inode(file); 1142 1142 struct ceph_inode_info *ci = ceph_inode(inode); 1143 1143 int left; 1144 1144 const int bufsize = 1024; ··· 1188 1188 static int ceph_dir_fsync(struct file *file, loff_t start, loff_t end, 1189 1189 int datasync) 1190 1190 { 1191 - struct inode *inode = file->f_path.dentry->d_inode; 1191 + struct inode *inode = file_inode(file); 1192 1192 struct ceph_inode_info *ci = ceph_inode(inode); 1193 1193 struct list_head *head = &ci->i_unsafe_dirops; 1194 1194 struct ceph_mds_request *req;
+5 -5
fs/ceph/file.c
··· 393 393 static ssize_t ceph_sync_read(struct file *file, char __user *data, 394 394 unsigned len, loff_t *poff, int *checkeof) 395 395 { 396 - struct inode *inode = file->f_dentry->d_inode; 396 + struct inode *inode = file_inode(file); 397 397 struct page **pages; 398 398 u64 off = *poff; 399 399 int num_pages, ret; ··· 466 466 static ssize_t ceph_sync_write(struct file *file, const char __user *data, 467 467 size_t left, loff_t *offset) 468 468 { 469 - struct inode *inode = file->f_dentry->d_inode; 469 + struct inode *inode = file_inode(file); 470 470 struct ceph_inode_info *ci = ceph_inode(inode); 471 471 struct ceph_fs_client *fsc = ceph_inode_to_client(inode); 472 472 struct ceph_osd_request *req; ··· 483 483 int ret; 484 484 struct timespec mtime = CURRENT_TIME; 485 485 486 - if (ceph_snap(file->f_dentry->d_inode) != CEPH_NOSNAP) 486 + if (ceph_snap(file_inode(file)) != CEPH_NOSNAP) 487 487 return -EROFS; 488 488 489 489 dout("sync_write on file %p %lld~%u %s\n", file, *offset, ··· 637 637 struct ceph_file_info *fi = filp->private_data; 638 638 loff_t *ppos = &iocb->ki_pos; 639 639 size_t len = iov->iov_len; 640 - struct inode *inode = filp->f_dentry->d_inode; 640 + struct inode *inode = file_inode(filp); 641 641 struct ceph_inode_info *ci = ceph_inode(inode); 642 642 void __user *base = iov->iov_base; 643 643 ssize_t ret; ··· 707 707 { 708 708 struct file *file = iocb->ki_filp; 709 709 struct ceph_file_info *fi = file->private_data; 710 - struct inode *inode = file->f_dentry->d_inode; 710 + struct inode *inode = file_inode(file); 711 711 struct ceph_inode_info *ci = ceph_inode(inode); 712 712 struct ceph_osd_client *osdc = 713 713 &ceph_sb_to_client(inode->i_sb)->client->osdc;
+8 -8
fs/ceph/ioctl.c
··· 16 16 */ 17 17 static long ceph_ioctl_get_layout(struct file *file, void __user *arg) 18 18 { 19 - struct ceph_inode_info *ci = ceph_inode(file->f_dentry->d_inode); 19 + struct ceph_inode_info *ci = ceph_inode(file_inode(file)); 20 20 struct ceph_ioctl_layout l; 21 21 int err; 22 22 23 - err = ceph_do_getattr(file->f_dentry->d_inode, CEPH_STAT_CAP_LAYOUT); 23 + err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT); 24 24 if (!err) { 25 25 l.stripe_unit = ceph_file_layout_su(ci->i_layout); 26 26 l.stripe_count = ceph_file_layout_stripe_count(ci->i_layout); ··· 63 63 64 64 static long ceph_ioctl_set_layout(struct file *file, void __user *arg) 65 65 { 66 - struct inode *inode = file->f_dentry->d_inode; 66 + struct inode *inode = file_inode(file); 67 67 struct inode *parent_inode; 68 68 struct ceph_mds_client *mdsc = ceph_sb_to_client(inode->i_sb)->mdsc; 69 69 struct ceph_mds_request *req; 70 70 struct ceph_ioctl_layout l; 71 - struct ceph_inode_info *ci = ceph_inode(file->f_dentry->d_inode); 71 + struct ceph_inode_info *ci = ceph_inode(file_inode(file)); 72 72 struct ceph_ioctl_layout nl; 73 73 int err; 74 74 ··· 76 76 return -EFAULT; 77 77 78 78 /* validate changed params against current layout */ 79 - err = ceph_do_getattr(file->f_dentry->d_inode, CEPH_STAT_CAP_LAYOUT); 79 + err = ceph_do_getattr(file_inode(file), CEPH_STAT_CAP_LAYOUT); 80 80 if (err) 81 81 return err; 82 82 ··· 136 136 */ 137 137 static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg) 138 138 { 139 - struct inode *inode = file->f_dentry->d_inode; 139 + struct inode *inode = file_inode(file); 140 140 struct ceph_mds_request *req; 141 141 struct ceph_ioctl_layout l; 142 142 int err; ··· 179 179 static long ceph_ioctl_get_dataloc(struct file *file, void __user *arg) 180 180 { 181 181 struct ceph_ioctl_dataloc dl; 182 - struct inode *inode = file->f_dentry->d_inode; 182 + struct inode *inode = file_inode(file); 183 183 struct ceph_inode_info *ci = ceph_inode(inode); 184 184 struct ceph_osd_client *osdc = 185 185 &ceph_sb_to_client(inode->i_sb)->client->osdc; ··· 234 234 static long ceph_ioctl_lazyio(struct file *file) 235 235 { 236 236 struct ceph_file_info *fi = file->private_data; 237 - struct inode *inode = file->f_dentry->d_inode; 237 + struct inode *inode = file_inode(file); 238 238 struct ceph_inode_info *ci = ceph_inode(inode); 239 239 240 240 if ((fi->fmode & CEPH_FILE_MODE_LAZY) == 0) {
+1 -1
fs/ceph/locks.c
··· 13 13 static int ceph_lock_message(u8 lock_type, u16 operation, struct file *file, 14 14 int cmd, u8 wait, struct file_lock *fl) 15 15 { 16 - struct inode *inode = file->f_dentry->d_inode; 16 + struct inode *inode = file_inode(file); 17 17 struct ceph_mds_client *mdsc = 18 18 ceph_sb_to_client(inode->i_sb)->mdsc; 19 19 struct ceph_mds_request *req;
+3 -3
fs/cifs/cifsfs.c
··· 677 677 static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov, 678 678 unsigned long nr_segs, loff_t pos) 679 679 { 680 - struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; 680 + struct inode *inode = file_inode(iocb->ki_filp); 681 681 ssize_t written; 682 682 int rc; 683 683 ··· 701 701 */ 702 702 if (whence != SEEK_SET && whence != SEEK_CUR) { 703 703 int rc; 704 - struct inode *inode = file->f_path.dentry->d_inode; 704 + struct inode *inode = file_inode(file); 705 705 706 706 /* 707 707 * We need to be sure that all dirty pages are written and the ··· 733 733 { 734 734 /* note that this is called by vfs setlease with lock_flocks held 735 735 to protect *lease from going away */ 736 - struct inode *inode = file->f_path.dentry->d_inode; 736 + struct inode *inode = file_inode(file); 737 737 struct cifsFileInfo *cfile = file->private_data; 738 738 739 739 if (!(S_ISREG(inode->i_mode)))
+13 -13
fs/cifs/file.c
··· 947 947 cifs_posix_lock_test(struct file *file, struct file_lock *flock) 948 948 { 949 949 int rc = 0; 950 - struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode); 950 + struct cifsInodeInfo *cinode = CIFS_I(file_inode(file)); 951 951 unsigned char saved_type = flock->fl_type; 952 952 953 953 if ((flock->fl_flags & FL_POSIX) == 0) ··· 974 974 static int 975 975 cifs_posix_lock_set(struct file *file, struct file_lock *flock) 976 976 { 977 - struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode); 977 + struct cifsInodeInfo *cinode = CIFS_I(file_inode(file)); 978 978 int rc = 1; 979 979 980 980 if ((flock->fl_flags & FL_POSIX) == 0) ··· 1548 1548 1549 1549 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 1550 1550 netfid = cfile->fid.netfid; 1551 - cinode = CIFS_I(file->f_path.dentry->d_inode); 1551 + cinode = CIFS_I(file_inode(file)); 1552 1552 1553 1553 if (cap_unix(tcon->ses) && 1554 1554 (CIFS_UNIX_FCNTL_CAP & le64_to_cpu(tcon->fsUnixInfo.Capability)) && ··· 2171 2171 struct cifs_tcon *tcon; 2172 2172 struct TCP_Server_Info *server; 2173 2173 struct cifsFileInfo *smbfile = file->private_data; 2174 - struct inode *inode = file->f_path.dentry->d_inode; 2174 + struct inode *inode = file_inode(file); 2175 2175 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 2176 2176 2177 2177 rc = filemap_write_and_wait_range(inode->i_mapping, start, end); ··· 2246 2246 */ 2247 2247 int cifs_flush(struct file *file, fl_owner_t id) 2248 2248 { 2249 - struct inode *inode = file->f_path.dentry->d_inode; 2249 + struct inode *inode = file_inode(file); 2250 2250 int rc = 0; 2251 2251 2252 2252 if (file->f_mode & FMODE_WRITE) ··· 2480 2480 ssize_t written; 2481 2481 struct inode *inode; 2482 2482 2483 - inode = iocb->ki_filp->f_path.dentry->d_inode; 2483 + inode = file_inode(iocb->ki_filp); 2484 2484 2485 2485 /* 2486 2486 * BB - optimize the way when signing is disabled. We can drop this ··· 2543 2543 cifs_strict_writev(struct kiocb *iocb, const struct iovec *iov, 2544 2544 unsigned long nr_segs, loff_t pos) 2545 2545 { 2546 - struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; 2546 + struct inode *inode = file_inode(iocb->ki_filp); 2547 2547 struct cifsInodeInfo *cinode = CIFS_I(inode); 2548 2548 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 2549 2549 struct cifsFileInfo *cfile = (struct cifsFileInfo *) ··· 2915 2915 cifs_strict_readv(struct kiocb *iocb, const struct iovec *iov, 2916 2916 unsigned long nr_segs, loff_t pos) 2917 2917 { 2918 - struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; 2918 + struct inode *inode = file_inode(iocb->ki_filp); 2919 2919 struct cifsInodeInfo *cinode = CIFS_I(inode); 2920 2920 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 2921 2921 struct cifsFileInfo *cfile = (struct cifsFileInfo *) ··· 3063 3063 int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma) 3064 3064 { 3065 3065 int rc, xid; 3066 - struct inode *inode = file->f_path.dentry->d_inode; 3066 + struct inode *inode = file_inode(file); 3067 3067 3068 3068 xid = get_xid(); 3069 3069 ··· 3356 3356 int rc; 3357 3357 3358 3358 /* Is the page cached? */ 3359 - rc = cifs_readpage_from_fscache(file->f_path.dentry->d_inode, page); 3359 + rc = cifs_readpage_from_fscache(file_inode(file), page); 3360 3360 if (rc == 0) 3361 3361 goto read_complete; 3362 3362 ··· 3371 3371 else 3372 3372 cFYI(1, "Bytes read %d", rc); 3373 3373 3374 - file->f_path.dentry->d_inode->i_atime = 3375 - current_fs_time(file->f_path.dentry->d_inode->i_sb); 3374 + file_inode(file)->i_atime = 3375 + current_fs_time(file_inode(file)->i_sb); 3376 3376 3377 3377 if (PAGE_CACHE_SIZE > rc) 3378 3378 memset(read_data + rc, 0, PAGE_CACHE_SIZE - rc); ··· 3381 3381 SetPageUptodate(page); 3382 3382 3383 3383 /* send this page to the cache */ 3384 - cifs_readpage_to_fscache(file->f_path.dentry->d_inode, page); 3384 + cifs_readpage_to_fscache(file_inode(file), page); 3385 3385 3386 3386 rc = 0; 3387 3387
+4 -4
fs/cifs/inode.c
··· 289 289 unsigned int xid; 290 290 FILE_UNIX_BASIC_INFO find_data; 291 291 struct cifs_fattr fattr; 292 - struct inode *inode = filp->f_path.dentry->d_inode; 292 + struct inode *inode = file_inode(filp); 293 293 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 294 294 struct cifsFileInfo *cfile = filp->private_data; 295 295 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); ··· 558 558 unsigned int xid; 559 559 FILE_ALL_INFO find_data; 560 560 struct cifs_fattr fattr; 561 - struct inode *inode = filp->f_path.dentry->d_inode; 561 + struct inode *inode = file_inode(filp); 562 562 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 563 563 struct cifsFileInfo *cfile = filp->private_data; 564 564 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); ··· 1678 1678 int cifs_revalidate_file_attr(struct file *filp) 1679 1679 { 1680 1680 int rc = 0; 1681 - struct inode *inode = filp->f_path.dentry->d_inode; 1681 + struct inode *inode = file_inode(filp); 1682 1682 struct cifsFileInfo *cfile = (struct cifsFileInfo *) filp->private_data; 1683 1683 1684 1684 if (!cifs_inode_needs_reval(inode)) ··· 1735 1735 int cifs_revalidate_file(struct file *filp) 1736 1736 { 1737 1737 int rc; 1738 - struct inode *inode = filp->f_path.dentry->d_inode; 1738 + struct inode *inode = file_inode(filp); 1739 1739 1740 1740 rc = cifs_revalidate_file_attr(filp); 1741 1741 if (rc)
+1 -1
fs/cifs/ioctl.c
··· 30 30 31 31 long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) 32 32 { 33 - struct inode *inode = filep->f_dentry->d_inode; 33 + struct inode *inode = file_inode(filep); 34 34 int rc = -ENOTTY; /* strange error - but the precedent */ 35 35 unsigned int xid; 36 36 struct cifs_sb_info *cifs_sb;
+2 -2
fs/cifs/readdir.c
··· 505 505 whether we can use the cached search results from the previous search */ 506 506 static int is_dir_changed(struct file *file) 507 507 { 508 - struct inode *inode = file->f_path.dentry->d_inode; 508 + struct inode *inode = file_inode(file); 509 509 struct cifsInodeInfo *cifsInfo = CIFS_I(inode); 510 510 511 511 if (cifsInfo->time == 0) ··· 778 778 switch ((int) file->f_pos) { 779 779 case 0: 780 780 if (filldir(direntry, ".", 1, file->f_pos, 781 - file->f_path.dentry->d_inode->i_ino, DT_DIR) < 0) { 781 + file_inode(file)->i_ino, DT_DIR) < 0) { 782 782 cERROR(1, "Filldir for current dir failed"); 783 783 rc = -ENOMEM; 784 784 break;
+1 -1
fs/coda/dir.c
··· 397 397 * We can't use vfs_readdir because we have to keep the file 398 398 * position in sync between the coda_file and the host_file. 399 399 * and as such we need grab the inode mutex. */ 400 - struct inode *host_inode = host_file->f_path.dentry->d_inode; 400 + struct inode *host_inode = file_inode(host_file); 401 401 402 402 mutex_lock(&host_inode->i_mutex); 403 403 host_file->f_pos = coda_file->f_pos;
+6 -6
fs/coda/file.c
··· 66 66 static ssize_t 67 67 coda_file_write(struct file *coda_file, const char __user *buf, size_t count, loff_t *ppos) 68 68 { 69 - struct inode *host_inode, *coda_inode = coda_file->f_path.dentry->d_inode; 69 + struct inode *host_inode, *coda_inode = file_inode(coda_file); 70 70 struct coda_file_info *cfi; 71 71 struct file *host_file; 72 72 ssize_t ret; ··· 78 78 if (!host_file->f_op || !host_file->f_op->write) 79 79 return -EINVAL; 80 80 81 - host_inode = host_file->f_path.dentry->d_inode; 81 + host_inode = file_inode(host_file); 82 82 mutex_lock(&coda_inode->i_mutex); 83 83 84 84 ret = host_file->f_op->write(host_file, buf, count, ppos); ··· 106 106 if (!host_file->f_op || !host_file->f_op->mmap) 107 107 return -ENODEV; 108 108 109 - coda_inode = coda_file->f_path.dentry->d_inode; 110 - host_inode = host_file->f_path.dentry->d_inode; 109 + coda_inode = file_inode(coda_file); 110 + host_inode = file_inode(host_file); 111 111 112 112 cii = ITOC(coda_inode); 113 113 spin_lock(&cii->c_lock); ··· 178 178 err = venus_close(coda_inode->i_sb, coda_i2f(coda_inode), 179 179 coda_flags, coda_file->f_cred->fsuid); 180 180 181 - host_inode = cfi->cfi_container->f_path.dentry->d_inode; 181 + host_inode = file_inode(cfi->cfi_container); 182 182 cii = ITOC(coda_inode); 183 183 184 184 /* did we mmap this file? */ ··· 202 202 int coda_fsync(struct file *coda_file, loff_t start, loff_t end, int datasync) 203 203 { 204 204 struct file *host_file; 205 - struct inode *coda_inode = coda_file->f_path.dentry->d_inode; 205 + struct inode *coda_inode = file_inode(coda_file); 206 206 struct coda_file_info *cfi; 207 207 int err; 208 208
+1 -1
fs/coda/inode.c
··· 129 129 f = fdget(data->fd); 130 130 if (!f.file) 131 131 goto Ebadf; 132 - inode = f.file->f_path.dentry->d_inode; 132 + inode = file_inode(f.file); 133 133 if (!S_ISCHR(inode->i_mode) || imajor(inode) != CODA_PSDEV_MAJOR) { 134 134 fdput(f); 135 135 goto Ebadf;
+1 -1
fs/coda/pioctl.c
··· 52 52 struct path path; 53 53 int error; 54 54 struct PioctlData data; 55 - struct inode *inode = filp->f_dentry->d_inode; 55 + struct inode *inode = file_inode(filp); 56 56 struct inode *target_inode = NULL; 57 57 struct coda_inode_info *cnp; 58 58
+1 -1
fs/compat_ioctl.c
··· 1582 1582 case FIBMAP: 1583 1583 case FIGETBSZ: 1584 1584 case FIONREAD: 1585 - if (S_ISREG(f.file->f_path.dentry->d_inode->i_mode)) 1585 + if (S_ISREG(file_inode(f.file)->i_mode)) 1586 1586 break; 1587 1587 /*FALL THROUGH*/ 1588 1588
+1 -1
fs/configfs/dir.c
··· 1625 1625 if (offset >= 0) 1626 1626 break; 1627 1627 default: 1628 - mutex_unlock(&file->f_path.dentry->d_inode->i_mutex); 1628 + mutex_unlock(&file_inode(file)->i_mutex); 1629 1629 return -EINVAL; 1630 1630 } 1631 1631 if (offset != file->f_pos) {
+2 -2
fs/coredump.c
··· 411 411 { 412 412 struct pipe_inode_info *pipe; 413 413 414 - pipe = file->f_path.dentry->d_inode->i_pipe; 414 + pipe = file_inode(file)->i_pipe; 415 415 416 416 pipe_lock(pipe); 417 417 pipe->readers++; ··· 600 600 if (IS_ERR(cprm.file)) 601 601 goto fail_unlock; 602 602 603 - inode = cprm.file->f_path.dentry->d_inode; 603 + inode = file_inode(cprm.file); 604 604 if (inode->i_nlink > 1) 605 605 goto close_fail; 606 606 if (d_unhashed(cprm.file->f_path.dentry))
+1 -1
fs/cramfs/inode.c
··· 351 351 */ 352 352 static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 353 353 { 354 - struct inode *inode = filp->f_path.dentry->d_inode; 354 + struct inode *inode = file_inode(filp); 355 355 struct super_block *sb = inode->i_sb; 356 356 char *buf; 357 357 unsigned int offset;
+2 -2
fs/ecryptfs/file.c
··· 118 118 119 119 lower_file = ecryptfs_file_to_lower(file); 120 120 lower_file->f_pos = file->f_pos; 121 - inode = file->f_path.dentry->d_inode; 121 + inode = file_inode(file); 122 122 memset(&buf, 0, sizeof(buf)); 123 123 buf.dirent = dirent; 124 124 buf.dentry = file->f_path.dentry; ··· 133 133 goto out; 134 134 if (rc >= 0) 135 135 fsstack_copy_attr_atime(inode, 136 - lower_file->f_path.dentry->d_inode); 136 + file_inode(lower_file)); 137 137 out: 138 138 return rc; 139 139 }
+1 -1
fs/efs/dir.c
··· 20 20 }; 21 21 22 22 static int efs_readdir(struct file *filp, void *dirent, filldir_t filldir) { 23 - struct inode *inode = filp->f_path.dentry->d_inode; 23 + struct inode *inode = file_inode(filp); 24 24 struct buffer_head *bh; 25 25 26 26 struct efs_dir *dirblock;
+4 -4
fs/exec.c
··· 123 123 goto out; 124 124 125 125 error = -EINVAL; 126 - if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) 126 + if (!S_ISREG(file_inode(file)->i_mode)) 127 127 goto exit; 128 128 129 129 error = -EACCES; ··· 764 764 goto out; 765 765 766 766 err = -EACCES; 767 - if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) 767 + if (!S_ISREG(file_inode(file)->i_mode)) 768 768 goto exit; 769 769 770 770 if (file->f_path.mnt->mnt_flags & MNT_NOEXEC) ··· 1098 1098 1099 1099 void would_dump(struct linux_binprm *bprm, struct file *file) 1100 1100 { 1101 - if (inode_permission(file->f_path.dentry->d_inode, MAY_READ) < 0) 1101 + if (inode_permission(file_inode(file), MAY_READ) < 0) 1102 1102 bprm->interp_flags |= BINPRM_FLAGS_ENFORCE_NONDUMP; 1103 1103 } 1104 1104 EXPORT_SYMBOL(would_dump); ··· 1270 1270 int prepare_binprm(struct linux_binprm *bprm) 1271 1271 { 1272 1272 umode_t mode; 1273 - struct inode * inode = bprm->file->f_path.dentry->d_inode; 1273 + struct inode * inode = file_inode(bprm->file); 1274 1274 int retval; 1275 1275 1276 1276 mode = inode->i_mode;
+1 -1
fs/exofs/dir.c
··· 242 242 exofs_readdir(struct file *filp, void *dirent, filldir_t filldir) 243 243 { 244 244 loff_t pos = filp->f_pos; 245 - struct inode *inode = filp->f_path.dentry->d_inode; 245 + struct inode *inode = file_inode(filp); 246 246 unsigned int offset = pos & ~PAGE_CACHE_MASK; 247 247 unsigned long n = pos >> PAGE_CACHE_SHIFT; 248 248 unsigned long npages = dir_pages(inode);
+1 -1
fs/ext2/dir.c
··· 290 290 ext2_readdir (struct file * filp, void * dirent, filldir_t filldir) 291 291 { 292 292 loff_t pos = filp->f_pos; 293 - struct inode *inode = filp->f_path.dentry->d_inode; 293 + struct inode *inode = file_inode(filp); 294 294 struct super_block *sb = inode->i_sb; 295 295 unsigned int offset = pos & ~PAGE_CACHE_MASK; 296 296 unsigned long n = pos >> PAGE_CACHE_SHIFT;
+1 -1
fs/ext2/ioctl.c
··· 19 19 20 20 long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 21 21 { 22 - struct inode *inode = filp->f_dentry->d_inode; 22 + struct inode *inode = file_inode(filp); 23 23 struct ext2_inode_info *ei = EXT2_I(inode); 24 24 unsigned int flags; 25 25 unsigned short rsv_window_size;
+4 -4
fs/ext3/dir.c
··· 99 99 int i, stored; 100 100 struct ext3_dir_entry_2 *de; 101 101 int err; 102 - struct inode *inode = filp->f_path.dentry->d_inode; 102 + struct inode *inode = file_inode(filp); 103 103 struct super_block *sb = inode->i_sb; 104 104 int ret = 0; 105 105 int dir_has_error = 0; ··· 114 114 * We don't set the inode dirty flag since it's not 115 115 * critical that it get flushed back to the disk. 116 116 */ 117 - EXT3_I(filp->f_path.dentry->d_inode)->i_flags &= ~EXT3_INDEX_FL; 117 + EXT3_I(file_inode(filp))->i_flags &= ~EXT3_INDEX_FL; 118 118 } 119 119 stored = 0; 120 120 offset = filp->f_pos & (sb->s_blocksize - 1); ··· 457 457 { 458 458 struct dir_private_info *info = filp->private_data; 459 459 loff_t curr_pos; 460 - struct inode *inode = filp->f_path.dentry->d_inode; 460 + struct inode *inode = file_inode(filp); 461 461 struct super_block * sb; 462 462 int error; 463 463 ··· 487 487 void * dirent, filldir_t filldir) 488 488 { 489 489 struct dir_private_info *info = filp->private_data; 490 - struct inode *inode = filp->f_path.dentry->d_inode; 490 + struct inode *inode = file_inode(filp); 491 491 struct fname *fname; 492 492 int ret; 493 493
+1 -1
fs/ext3/ioctl.c
··· 14 14 15 15 long ext3_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 16 16 { 17 - struct inode *inode = filp->f_dentry->d_inode; 17 + struct inode *inode = file_inode(filp); 18 18 struct ext3_inode_info *ei = EXT3_I(inode); 19 19 unsigned int flags; 20 20 unsigned short rsv_window_size;
+2 -2
fs/ext3/namei.c
··· 624 624 625 625 dxtrace(printk("In htree_fill_tree, start hash: %x:%x\n", start_hash, 626 626 start_minor_hash)); 627 - dir = dir_file->f_path.dentry->d_inode; 627 + dir = file_inode(dir_file); 628 628 if (!(EXT3_I(dir)->i_flags & EXT3_INDEX_FL)) { 629 629 hinfo.hash_version = EXT3_SB(dir->i_sb)->s_def_hash_version; 630 630 if (hinfo.hash_version <= DX_HASH_TEA) ··· 638 638 } 639 639 hinfo.hash = start_hash; 640 640 hinfo.minor_hash = 0; 641 - frame = dx_probe(NULL, dir_file->f_path.dentry->d_inode, &hinfo, frames, &err); 641 + frame = dx_probe(NULL, file_inode(dir_file), &hinfo, frames, &err); 642 642 if (!frame) 643 643 return err; 644 644
+4 -4
fs/ext4/dir.c
··· 110 110 int i, stored; 111 111 struct ext4_dir_entry_2 *de; 112 112 int err; 113 - struct inode *inode = filp->f_path.dentry->d_inode; 113 + struct inode *inode = file_inode(filp); 114 114 struct super_block *sb = inode->i_sb; 115 115 int ret = 0; 116 116 int dir_has_error = 0; ··· 133 133 * We don't set the inode dirty flag since it's not 134 134 * critical that it get flushed back to the disk. 135 135 */ 136 - ext4_clear_inode_flag(filp->f_path.dentry->d_inode, 136 + ext4_clear_inode_flag(file_inode(filp), 137 137 EXT4_INODE_INDEX); 138 138 } 139 139 stored = 0; ··· 494 494 { 495 495 struct dir_private_info *info = filp->private_data; 496 496 loff_t curr_pos; 497 - struct inode *inode = filp->f_path.dentry->d_inode; 497 + struct inode *inode = file_inode(filp); 498 498 struct super_block *sb; 499 499 int error; 500 500 ··· 526 526 void *dirent, filldir_t filldir) 527 527 { 528 528 struct dir_private_info *info = filp->private_data; 529 - struct inode *inode = filp->f_path.dentry->d_inode; 529 + struct inode *inode = file_inode(filp); 530 530 struct fname *fname; 531 531 int ret; 532 532
+2 -2
fs/ext4/extents.c
··· 4386 4386 */ 4387 4387 long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len) 4388 4388 { 4389 - struct inode *inode = file->f_path.dentry->d_inode; 4389 + struct inode *inode = file_inode(file); 4390 4390 handle_t *handle; 4391 4391 loff_t new_size; 4392 4392 unsigned int max_blocks; ··· 4643 4643 */ 4644 4644 int ext4_ext_punch_hole(struct file *file, loff_t offset, loff_t length) 4645 4645 { 4646 - struct inode *inode = file->f_path.dentry->d_inode; 4646 + struct inode *inode = file_inode(file); 4647 4647 struct super_block *sb = inode->i_sb; 4648 4648 ext4_lblk_t first_block, stop_block; 4649 4649 struct address_space *mapping = inode->i_mapping;
+1 -1
fs/ext4/file.c
··· 167 167 ext4_file_write(struct kiocb *iocb, const struct iovec *iov, 168 168 unsigned long nr_segs, loff_t pos) 169 169 { 170 - struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; 170 + struct inode *inode = file_inode(iocb->ki_filp); 171 171 ssize_t ret; 172 172 173 173 /*
+1 -1
fs/ext4/inline.c
··· 1298 1298 int i, stored; 1299 1299 struct ext4_dir_entry_2 *de; 1300 1300 struct super_block *sb; 1301 - struct inode *inode = filp->f_path.dentry->d_inode; 1301 + struct inode *inode = file_inode(filp); 1302 1302 int ret, inline_size = 0; 1303 1303 struct ext4_iloc iloc; 1304 1304 void *dir_buf = NULL;
+3 -3
fs/ext4/inode.c
··· 2959 2959 ssize_t size, void *private, int ret, 2960 2960 bool is_async) 2961 2961 { 2962 - struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; 2962 + struct inode *inode = file_inode(iocb->ki_filp); 2963 2963 ext4_io_end_t *io_end = iocb->private; 2964 2964 2965 2965 /* if not async direct IO or dio with 0 bytes write, just return */ ··· 3553 3553 3554 3554 int ext4_punch_hole(struct file *file, loff_t offset, loff_t length) 3555 3555 { 3556 - struct inode *inode = file->f_path.dentry->d_inode; 3556 + struct inode *inode = file_inode(file); 3557 3557 if (!S_ISREG(inode->i_mode)) 3558 3558 return -EOPNOTSUPP; 3559 3559 ··· 4926 4926 unsigned long len; 4927 4927 int ret; 4928 4928 struct file *file = vma->vm_file; 4929 - struct inode *inode = file->f_path.dentry->d_inode; 4929 + struct inode *inode = file_inode(file); 4930 4930 struct address_space *mapping = inode->i_mapping; 4931 4931 handle_t *handle; 4932 4932 get_block_t *get_block;
+1 -1
fs/ext4/ioctl.c
··· 22 22 23 23 long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 24 24 { 25 - struct inode *inode = filp->f_dentry->d_inode; 25 + struct inode *inode = file_inode(filp); 26 26 struct super_block *sb = inode->i_sb; 27 27 struct ext4_inode_info *ei = EXT4_I(inode); 28 28 unsigned int flags;
+3 -3
fs/ext4/move_extent.c
··· 900 900 pgoff_t orig_page_offset, int data_offset_in_page, 901 901 int block_len_in_page, int uninit, int *err) 902 902 { 903 - struct inode *orig_inode = o_filp->f_dentry->d_inode; 903 + struct inode *orig_inode = file_inode(o_filp); 904 904 struct page *pagep[2] = {NULL, NULL}; 905 905 handle_t *handle; 906 906 ext4_lblk_t orig_blk_offset; ··· 1279 1279 __u64 orig_start, __u64 donor_start, __u64 len, 1280 1280 __u64 *moved_len) 1281 1281 { 1282 - struct inode *orig_inode = o_filp->f_dentry->d_inode; 1283 - struct inode *donor_inode = d_filp->f_dentry->d_inode; 1282 + struct inode *orig_inode = file_inode(o_filp); 1283 + struct inode *donor_inode = file_inode(d_filp); 1284 1284 struct ext4_ext_path *orig_path = NULL, *holecheck_path = NULL; 1285 1285 struct ext4_extent *ext_prev, *ext_cur, *ext_dummy; 1286 1286 ext4_lblk_t block_start = orig_start;
+1 -1
fs/ext4/namei.c
··· 937 937 938 938 dxtrace(printk(KERN_DEBUG "In htree_fill_tree, start hash: %x:%x\n", 939 939 start_hash, start_minor_hash)); 940 - dir = dir_file->f_path.dentry->d_inode; 940 + dir = file_inode(dir_file); 941 941 if (!(ext4_test_inode_flag(dir, EXT4_INODE_INDEX))) { 942 942 hinfo.hash_version = EXT4_SB(dir->i_sb)->s_def_hash_version; 943 943 if (hinfo.hash_version <= DX_HASH_TEA)
+1 -1
fs/ext4/super.c
··· 553 553 va_list args; 554 554 struct va_format vaf; 555 555 struct ext4_super_block *es; 556 - struct inode *inode = file->f_dentry->d_inode; 556 + struct inode *inode = file_inode(file); 557 557 char pathname[80], *path; 558 558 559 559 es = EXT4_SB(inode->i_sb)->s_es;
+1 -1
fs/f2fs/dir.c
··· 603 603 static int f2fs_readdir(struct file *file, void *dirent, filldir_t filldir) 604 604 { 605 605 unsigned long pos = file->f_pos; 606 - struct inode *inode = file->f_dentry->d_inode; 606 + struct inode *inode = file_inode(file); 607 607 unsigned long npages = dir_blocks(inode); 608 608 unsigned char *types = NULL; 609 609 unsigned int bit_pos = 0, start_bit_pos = 0;
+3 -3
fs/fat/dir.c
··· 698 698 699 699 static int fat_readdir(struct file *filp, void *dirent, filldir_t filldir) 700 700 { 701 - struct inode *inode = filp->f_path.dentry->d_inode; 701 + struct inode *inode = file_inode(filp); 702 702 return __fat_readdir(inode, filp, dirent, filldir, 0, 0); 703 703 } 704 704 ··· 779 779 static long fat_dir_ioctl(struct file *filp, unsigned int cmd, 780 780 unsigned long arg) 781 781 { 782 - struct inode *inode = filp->f_path.dentry->d_inode; 782 + struct inode *inode = file_inode(filp); 783 783 struct __fat_dirent __user *d1 = (struct __fat_dirent __user *)arg; 784 784 int short_only, both; 785 785 ··· 819 819 static long fat_compat_dir_ioctl(struct file *filp, unsigned cmd, 820 820 unsigned long arg) 821 821 { 822 - struct inode *inode = filp->f_path.dentry->d_inode; 822 + struct inode *inode = file_inode(filp); 823 823 struct compat_dirent __user *d1 = compat_ptr(arg); 824 824 int short_only, both; 825 825
+2 -2
fs/fat/file.c
··· 32 32 33 33 static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr) 34 34 { 35 - struct inode *inode = file->f_path.dentry->d_inode; 35 + struct inode *inode = file_inode(file); 36 36 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); 37 37 int is_dir = S_ISDIR(inode->i_mode); 38 38 u32 attr, oldattr; ··· 116 116 117 117 long fat_generic_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 118 118 { 119 - struct inode *inode = filp->f_path.dentry->d_inode; 119 + struct inode *inode = file_inode(filp); 120 120 u32 __user *user_attr = (u32 __user *)arg; 121 121 122 122 switch (cmd) {
+1 -1
fs/fcntl.c
··· 30 30 31 31 static int setfl(int fd, struct file * filp, unsigned long arg) 32 32 { 33 - struct inode * inode = filp->f_path.dentry->d_inode; 33 + struct inode * inode = file_inode(filp); 34 34 int error = 0; 35 35 36 36 /*
+1 -1
fs/file_table.c
··· 447 447 448 448 lg_global_lock(&files_lglock); 449 449 do_file_list_for_each_entry(sb, f) { 450 - if (!S_ISREG(f->f_path.dentry->d_inode->i_mode)) 450 + if (!S_ISREG(file_inode(f)->i_mode)) 451 451 continue; 452 452 if (!file_count(f)) 453 453 continue;
+1 -1
fs/freevxfs/vxfs_lookup.c
··· 237 237 static int 238 238 vxfs_readdir(struct file *fp, void *retp, filldir_t filler) 239 239 { 240 - struct inode *ip = fp->f_path.dentry->d_inode; 240 + struct inode *ip = file_inode(fp); 241 241 struct super_block *sbp = ip->i_sb; 242 242 u_long bsize = sbp->s_blocksize; 243 243 u_long page, npages, block, pblocks, nblocks, offset;
+1 -1
fs/fuse/control.c
··· 23 23 { 24 24 struct fuse_conn *fc; 25 25 mutex_lock(&fuse_mutex); 26 - fc = file->f_path.dentry->d_inode->i_private; 26 + fc = file_inode(file)->i_private; 27 27 if (fc) 28 28 fc = fuse_conn_get(fc); 29 29 mutex_unlock(&fuse_mutex);
+1 -1
fs/fuse/dir.c
··· 1160 1160 int err; 1161 1161 size_t nbytes; 1162 1162 struct page *page; 1163 - struct inode *inode = file->f_path.dentry->d_inode; 1163 + struct inode *inode = file_inode(file); 1164 1164 struct fuse_conn *fc = get_fuse_conn(inode); 1165 1165 struct fuse_req *req; 1166 1166
+8 -9
fs/gfs2/file.c
··· 157 157 158 158 static int gfs2_get_flags(struct file *filp, u32 __user *ptr) 159 159 { 160 - struct inode *inode = filp->f_path.dentry->d_inode; 160 + struct inode *inode = file_inode(filp); 161 161 struct gfs2_inode *ip = GFS2_I(inode); 162 162 struct gfs2_holder gh; 163 163 int error; ··· 217 217 */ 218 218 static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask) 219 219 { 220 - struct inode *inode = filp->f_path.dentry->d_inode; 220 + struct inode *inode = file_inode(filp); 221 221 struct gfs2_inode *ip = GFS2_I(inode); 222 222 struct gfs2_sbd *sdp = GFS2_SB(inode); 223 223 struct buffer_head *bh; ··· 293 293 294 294 static int gfs2_set_flags(struct file *filp, u32 __user *ptr) 295 295 { 296 - struct inode *inode = filp->f_path.dentry->d_inode; 296 + struct inode *inode = file_inode(filp); 297 297 u32 fsflags, gfsflags; 298 298 299 299 if (get_user(fsflags, ptr)) ··· 336 336 337 337 static void gfs2_size_hint(struct file *filep, loff_t offset, size_t size) 338 338 { 339 - struct inode *inode = filep->f_dentry->d_inode; 339 + struct inode *inode = file_inode(filep); 340 340 struct gfs2_sbd *sdp = GFS2_SB(inode); 341 341 struct gfs2_inode *ip = GFS2_I(inode); 342 342 size_t blks = (size + sdp->sd_sb.sb_bsize - 1) >> sdp->sd_sb.sb_bsize_shift; ··· 386 386 static int gfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 387 387 { 388 388 struct page *page = vmf->page; 389 - struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 389 + struct inode *inode = file_inode(vma->vm_file); 390 390 struct gfs2_inode *ip = GFS2_I(inode); 391 391 struct gfs2_sbd *sdp = GFS2_SB(inode); 392 392 unsigned long last_index; ··· 673 673 { 674 674 struct file *file = iocb->ki_filp; 675 675 size_t writesize = iov_length(iov, nr_segs); 676 - struct dentry *dentry = file->f_dentry; 677 - struct gfs2_inode *ip = GFS2_I(dentry->d_inode); 676 + struct gfs2_inode *ip = GFS2_I(file_inode(file)); 678 677 int ret; 679 678 680 679 ret = gfs2_rs_alloc(ip); ··· 771 772 static long gfs2_fallocate(struct file *file, int mode, loff_t offset, 772 773 loff_t len) 773 774 { 774 - struct inode *inode = file->f_path.dentry->d_inode; 775 + struct inode *inode = file_inode(file); 775 776 struct gfs2_sbd *sdp = GFS2_SB(inode); 776 777 struct gfs2_inode *ip = GFS2_I(inode); 777 778 unsigned int data_blocks = 0, ind_blocks = 0, rblocks; ··· 937 938 { 938 939 struct gfs2_file *fp = file->private_data; 939 940 struct gfs2_holder *fl_gh = &fp->f_fl_gh; 940 - struct gfs2_inode *ip = GFS2_I(file->f_path.dentry->d_inode); 941 + struct gfs2_inode *ip = GFS2_I(file_inode(file)); 941 942 struct gfs2_glock *gl; 942 943 unsigned int state; 943 944 int flags;
+1 -1
fs/gfs2/rgrp.c
··· 1257 1257 1258 1258 int gfs2_fitrim(struct file *filp, void __user *argp) 1259 1259 { 1260 - struct inode *inode = filp->f_dentry->d_inode; 1260 + struct inode *inode = file_inode(filp); 1261 1261 struct gfs2_sbd *sdp = GFS2_SB(inode); 1262 1262 struct request_queue *q = bdev_get_queue(sdp->sd_vfs->s_bdev); 1263 1263 struct buffer_head *bh;
+1 -1
fs/hfs/dir.c
··· 51 51 */ 52 52 static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 53 53 { 54 - struct inode *inode = filp->f_path.dentry->d_inode; 54 + struct inode *inode = file_inode(filp); 55 55 struct super_block *sb = inode->i_sb; 56 56 int len, err; 57 57 char strbuf[HFS_MAX_NAMELEN];
+1 -1
fs/hfs/inode.c
··· 128 128 { 129 129 struct file *file = iocb->ki_filp; 130 130 struct address_space *mapping = file->f_mapping; 131 - struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host; 131 + struct inode *inode = file_inode(file)->i_mapping->host; 132 132 ssize_t ret; 133 133 134 134 ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs,
+1 -1
fs/hfsplus/dir.c
··· 122 122 123 123 static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) 124 124 { 125 - struct inode *inode = filp->f_path.dentry->d_inode; 125 + struct inode *inode = file_inode(filp); 126 126 struct super_block *sb = inode->i_sb; 127 127 int len, err; 128 128 char strbuf[HFSPLUS_MAX_STRLEN + 1];
+1 -1
fs/hfsplus/inode.c
··· 124 124 { 125 125 struct file *file = iocb->ki_filp; 126 126 struct address_space *mapping = file->f_mapping; 127 - struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host; 127 + struct inode *inode = file_inode(file)->i_mapping->host; 128 128 ssize_t ret; 129 129 130 130 ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs,
+2 -2
fs/hfsplus/ioctl.c
··· 59 59 60 60 static int hfsplus_ioctl_getflags(struct file *file, int __user *user_flags) 61 61 { 62 - struct inode *inode = file->f_path.dentry->d_inode; 62 + struct inode *inode = file_inode(file); 63 63 struct hfsplus_inode_info *hip = HFSPLUS_I(inode); 64 64 unsigned int flags = 0; 65 65 ··· 75 75 76 76 static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags) 77 77 { 78 - struct inode *inode = file->f_path.dentry->d_inode; 78 + struct inode *inode = file_inode(file); 79 79 struct hfsplus_inode_info *hip = HFSPLUS_I(inode); 80 80 unsigned int flags; 81 81 int err = 0;
+1 -1
fs/hostfs/hostfs_kern.c
··· 30 30 return list_entry(inode, struct hostfs_inode_info, vfs_inode); 31 31 } 32 32 33 - #define FILE_HOSTFS_I(file) HOSTFS_I((file)->f_path.dentry->d_inode) 33 + #define FILE_HOSTFS_I(file) HOSTFS_I(file_inode(file)) 34 34 35 35 static int hostfs_d_delete(const struct dentry *dentry) 36 36 {
+2 -2
fs/hpfs/dir.c
··· 25 25 loff_t new_off = off + (whence == 1 ? filp->f_pos : 0); 26 26 loff_t pos; 27 27 struct quad_buffer_head qbh; 28 - struct inode *i = filp->f_path.dentry->d_inode; 28 + struct inode *i = file_inode(filp); 29 29 struct hpfs_inode_info *hpfs_inode = hpfs_i(i); 30 30 struct super_block *s = i->i_sb; 31 31 ··· 57 57 58 58 static int hpfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 59 59 { 60 - struct inode *inode = filp->f_path.dentry->d_inode; 60 + struct inode *inode = file_inode(filp); 61 61 struct hpfs_inode_info *hpfs_inode = hpfs_i(inode); 62 62 struct quad_buffer_head qbh; 63 63 struct hpfs_dirent *de;
+1 -1
fs/hpfs/file.c
··· 152 152 retval = do_sync_write(file, buf, count, ppos); 153 153 if (retval > 0) { 154 154 hpfs_lock(file->f_path.dentry->d_sb); 155 - hpfs_i(file->f_path.dentry->d_inode)->i_dirty = 1; 155 + hpfs_i(file_inode(file))->i_dirty = 1; 156 156 hpfs_unlock(file->f_path.dentry->d_sb); 157 157 } 158 158 return retval;
+4 -4
fs/hppfs/hppfs.c
··· 180 180 ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); 181 181 ssize_t n; 182 182 183 - read = file->f_path.dentry->d_inode->i_fop->read; 183 + read = file_inode(file)->i_fop->read; 184 184 185 185 if (!is_user) 186 186 set_fs(KERNEL_DS); ··· 288 288 struct file *proc_file = data->proc_file; 289 289 ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *); 290 290 291 - write = proc_file->f_path.dentry->d_inode->i_fop->write; 291 + write = file_inode(proc_file)->i_fop->write; 292 292 return (*write)(proc_file, buf, len, ppos); 293 293 } 294 294 ··· 513 513 loff_t (*llseek)(struct file *, loff_t, int); 514 514 loff_t ret; 515 515 516 - llseek = proc_file->f_path.dentry->d_inode->i_fop->llseek; 516 + llseek = file_inode(proc_file)->i_fop->llseek; 517 517 if (llseek != NULL) { 518 518 ret = (*llseek)(proc_file, off, where); 519 519 if (ret < 0) ··· 561 561 }); 562 562 int err; 563 563 564 - readdir = proc_file->f_path.dentry->d_inode->i_fop->readdir; 564 + readdir = file_inode(proc_file)->i_fop->readdir; 565 565 566 566 proc_file->f_pos = file->f_pos; 567 567 err = (*readdir)(proc_file, &dirent, hppfs_filldir);
+1 -1
fs/hugetlbfs/inode.c
··· 97 97 98 98 static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma) 99 99 { 100 - struct inode *inode = file->f_path.dentry->d_inode; 100 + struct inode *inode = file_inode(file); 101 101 loff_t len, vma_len; 102 102 int ret; 103 103 struct hstate *h = hstate_file(file);
+1 -1
fs/inode.c
··· 1655 1655 1656 1656 int file_update_time(struct file *file) 1657 1657 { 1658 - struct inode *inode = file->f_path.dentry->d_inode; 1658 + struct inode *inode = file_inode(file); 1659 1659 struct timespec now; 1660 1660 int sync_it = 0; 1661 1661 int ret;
+6 -6
fs/ioctl.c
··· 175 175 struct fiemap fiemap; 176 176 struct fiemap __user *ufiemap = (struct fiemap __user *) arg; 177 177 struct fiemap_extent_info fieinfo = { 0, }; 178 - struct inode *inode = filp->f_path.dentry->d_inode; 178 + struct inode *inode = file_inode(filp); 179 179 struct super_block *sb = inode->i_sb; 180 180 u64 len; 181 181 int error; ··· 424 424 */ 425 425 int ioctl_preallocate(struct file *filp, void __user *argp) 426 426 { 427 - struct inode *inode = filp->f_path.dentry->d_inode; 427 + struct inode *inode = file_inode(filp); 428 428 struct space_resv sr; 429 429 430 430 if (copy_from_user(&sr, argp, sizeof(sr))) ··· 449 449 static int file_ioctl(struct file *filp, unsigned int cmd, 450 450 unsigned long arg) 451 451 { 452 - struct inode *inode = filp->f_path.dentry->d_inode; 452 + struct inode *inode = file_inode(filp); 453 453 int __user *p = (int __user *)arg; 454 454 455 455 switch (cmd) { ··· 512 512 513 513 static int ioctl_fsfreeze(struct file *filp) 514 514 { 515 - struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; 515 + struct super_block *sb = file_inode(filp)->i_sb; 516 516 517 517 if (!capable(CAP_SYS_ADMIN)) 518 518 return -EPERM; ··· 527 527 528 528 static int ioctl_fsthaw(struct file *filp) 529 529 { 530 - struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; 530 + struct super_block *sb = file_inode(filp)->i_sb; 531 531 532 532 if (!capable(CAP_SYS_ADMIN)) 533 533 return -EPERM; ··· 548 548 { 549 549 int error = 0; 550 550 int __user *argp = (int __user *)arg; 551 - struct inode *inode = filp->f_path.dentry->d_inode; 551 + struct inode *inode = file_inode(filp); 552 552 553 553 switch (cmd) { 554 554 case FIOCLEX:
+1 -1
fs/isofs/compress.c
··· 296 296 */ 297 297 static int zisofs_readpage(struct file *file, struct page *page) 298 298 { 299 - struct inode *inode = file->f_path.dentry->d_inode; 299 + struct inode *inode = file_inode(file); 300 300 struct address_space *mapping = inode->i_mapping; 301 301 int err; 302 302 int i, pcount, full_page;
+1 -1
fs/isofs/dir.c
··· 253 253 int result; 254 254 char *tmpname; 255 255 struct iso_directory_record *tmpde; 256 - struct inode *inode = filp->f_path.dentry->d_inode; 256 + struct inode *inode = file_inode(filp); 257 257 258 258 tmpname = (char *)__get_free_page(GFP_KERNEL); 259 259 if (tmpname == NULL)
+2 -2
fs/jffs2/dir.c
··· 117 117 static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir) 118 118 { 119 119 struct jffs2_inode_info *f; 120 - struct inode *inode = filp->f_path.dentry->d_inode; 120 + struct inode *inode = file_inode(filp); 121 121 struct jffs2_full_dirent *fd; 122 122 unsigned long offset, curofs; 123 123 124 124 jffs2_dbg(1, "jffs2_readdir() for dir_i #%lu\n", 125 - filp->f_path.dentry->d_inode->i_ino); 125 + file_inode(filp)->i_ino); 126 126 127 127 f = JFFS2_INODE_INFO(inode); 128 128
+1 -1
fs/jfs/ioctl.c
··· 58 58 59 59 long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 60 60 { 61 - struct inode *inode = filp->f_dentry->d_inode; 61 + struct inode *inode = file_inode(filp); 62 62 struct jfs_inode_info *jfs_inode = JFS_IP(inode); 63 63 unsigned int flags; 64 64
+1 -1
fs/jfs/jfs_dtree.c
··· 3004 3004 */ 3005 3005 int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 3006 3006 { 3007 - struct inode *ip = filp->f_path.dentry->d_inode; 3007 + struct inode *ip = file_inode(filp); 3008 3008 struct nls_table *codepage = JFS_SBI(ip->i_sb)->nls_tab; 3009 3009 int rc = 0; 3010 3010 loff_t dtpos; /* legacy OS/2 style position */
+1 -1
fs/lockd/clntlock.c
··· 178 178 continue; 179 179 if (!rpc_cmp_addr(nlm_addr(block->b_host), addr)) 180 180 continue; 181 - if (nfs_compare_fh(NFS_FH(fl_blocked->fl_file->f_path.dentry->d_inode) ,fh) != 0) 181 + if (nfs_compare_fh(NFS_FH(file_inode(fl_blocked->fl_file)) ,fh) != 0) 182 182 continue; 183 183 /* Alright, we found a lock. Set the return status 184 184 * and wake up the caller
+1 -1
fs/lockd/clntproc.c
··· 127 127 struct nlm_lock *lock = &argp->lock; 128 128 129 129 nlmclnt_next_cookie(&argp->cookie); 130 - memcpy(&lock->fh, NFS_FH(fl->fl_file->f_path.dentry->d_inode), sizeof(struct nfs_fh)); 130 + memcpy(&lock->fh, NFS_FH(file_inode(fl->fl_file)), sizeof(struct nfs_fh)); 131 131 lock->caller = utsname()->nodename; 132 132 lock->oh.data = req->a_owner; 133 133 lock->oh.len = snprintf(req->a_owner, sizeof(req->a_owner), "%u@%s",
+8 -8
fs/lockd/svclock.c
··· 406 406 __be32 ret; 407 407 408 408 dprintk("lockd: nlmsvc_lock(%s/%ld, ty=%d, pi=%d, %Ld-%Ld, bl=%d)\n", 409 - file->f_file->f_path.dentry->d_inode->i_sb->s_id, 410 - file->f_file->f_path.dentry->d_inode->i_ino, 409 + file_inode(file->f_file)->i_sb->s_id, 410 + file_inode(file->f_file)->i_ino, 411 411 lock->fl.fl_type, lock->fl.fl_pid, 412 412 (long long)lock->fl.fl_start, 413 413 (long long)lock->fl.fl_end, ··· 513 513 __be32 ret; 514 514 515 515 dprintk("lockd: nlmsvc_testlock(%s/%ld, ty=%d, %Ld-%Ld)\n", 516 - file->f_file->f_path.dentry->d_inode->i_sb->s_id, 517 - file->f_file->f_path.dentry->d_inode->i_ino, 516 + file_inode(file->f_file)->i_sb->s_id, 517 + file_inode(file->f_file)->i_ino, 518 518 lock->fl.fl_type, 519 519 (long long)lock->fl.fl_start, 520 520 (long long)lock->fl.fl_end); ··· 606 606 int error; 607 607 608 608 dprintk("lockd: nlmsvc_unlock(%s/%ld, pi=%d, %Ld-%Ld)\n", 609 - file->f_file->f_path.dentry->d_inode->i_sb->s_id, 610 - file->f_file->f_path.dentry->d_inode->i_ino, 609 + file_inode(file->f_file)->i_sb->s_id, 610 + file_inode(file->f_file)->i_ino, 611 611 lock->fl.fl_pid, 612 612 (long long)lock->fl.fl_start, 613 613 (long long)lock->fl.fl_end); ··· 635 635 int status = 0; 636 636 637 637 dprintk("lockd: nlmsvc_cancel(%s/%ld, pi=%d, %Ld-%Ld)\n", 638 - file->f_file->f_path.dentry->d_inode->i_sb->s_id, 639 - file->f_file->f_path.dentry->d_inode->i_ino, 638 + file_inode(file->f_file)->i_sb->s_id, 639 + file_inode(file->f_file)->i_ino, 640 640 lock->fl.fl_pid, 641 641 (long long)lock->fl.fl_start, 642 642 (long long)lock->fl.fl_end);
+1 -1
fs/lockd/svcsubs.c
··· 45 45 46 46 static inline void nlm_debug_print_file(char *msg, struct nlm_file *file) 47 47 { 48 - struct inode *inode = file->f_file->f_path.dentry->d_inode; 48 + struct inode *inode = file_inode(file->f_file); 49 49 50 50 dprintk("lockd: %s %s/%ld\n", 51 51 msg, inode->i_sb->s_id, inode->i_ino);
+12 -12
fs/locks.c
··· 334 334 start = filp->f_pos; 335 335 break; 336 336 case SEEK_END: 337 - start = i_size_read(filp->f_path.dentry->d_inode); 337 + start = i_size_read(file_inode(filp)); 338 338 break; 339 339 default: 340 340 return -EINVAL; ··· 384 384 start = filp->f_pos; 385 385 break; 386 386 case SEEK_END: 387 - start = i_size_read(filp->f_path.dentry->d_inode); 387 + start = i_size_read(file_inode(filp)); 388 388 break; 389 389 default: 390 390 return -EINVAL; ··· 627 627 struct file_lock *cfl; 628 628 629 629 lock_flocks(); 630 - for (cfl = filp->f_path.dentry->d_inode->i_flock; cfl; cfl = cfl->fl_next) { 630 + for (cfl = file_inode(filp)->i_flock; cfl; cfl = cfl->fl_next) { 631 631 if (!IS_POSIX(cfl)) 632 632 continue; 633 633 if (posix_locks_conflict(fl, cfl)) ··· 708 708 { 709 709 struct file_lock *new_fl = NULL; 710 710 struct file_lock **before; 711 - struct inode * inode = filp->f_path.dentry->d_inode; 711 + struct inode * inode = file_inode(filp); 712 712 int error = 0; 713 713 int found = 0; 714 714 ··· 1002 1002 int posix_lock_file(struct file *filp, struct file_lock *fl, 1003 1003 struct file_lock *conflock) 1004 1004 { 1005 - return __posix_lock_file(filp->f_path.dentry->d_inode, fl, conflock); 1005 + return __posix_lock_file(file_inode(filp), fl, conflock); 1006 1006 } 1007 1007 EXPORT_SYMBOL(posix_lock_file); 1008 1008 ··· 1326 1326 int type = F_UNLCK; 1327 1327 1328 1328 lock_flocks(); 1329 - time_out_leases(filp->f_path.dentry->d_inode); 1330 - for (fl = filp->f_path.dentry->d_inode->i_flock; fl && IS_LEASE(fl); 1329 + time_out_leases(file_inode(filp)); 1330 + for (fl = file_inode(filp)->i_flock; fl && IS_LEASE(fl); 1331 1331 fl = fl->fl_next) { 1332 1332 if (fl->fl_file == filp) { 1333 1333 type = target_leasetype(fl); ··· 1843 1843 if (copy_from_user(&flock, l, sizeof(flock))) 1844 1844 goto out; 1845 1845 1846 - inode = filp->f_path.dentry->d_inode; 1846 + inode = file_inode(filp); 1847 1847 1848 1848 /* Don't allow mandatory locks on files that may be memory mapped 1849 1849 * and shared. ··· 1961 1961 if (copy_from_user(&flock, l, sizeof(flock))) 1962 1962 goto out; 1963 1963 1964 - inode = filp->f_path.dentry->d_inode; 1964 + inode = file_inode(filp); 1965 1965 1966 1966 /* Don't allow mandatory locks on files that may be memory mapped 1967 1967 * and shared. ··· 2030 2030 * posix_lock_file(). Another process could be setting a lock on this 2031 2031 * file at the same time, but we wouldn't remove that lock anyway. 2032 2032 */ 2033 - if (!filp->f_path.dentry->d_inode->i_flock) 2033 + if (!file_inode(filp)->i_flock) 2034 2034 return; 2035 2035 2036 2036 lock.fl_type = F_UNLCK; ··· 2056 2056 */ 2057 2057 void locks_remove_flock(struct file *filp) 2058 2058 { 2059 - struct inode * inode = filp->f_path.dentry->d_inode; 2059 + struct inode * inode = file_inode(filp); 2060 2060 struct file_lock *fl; 2061 2061 struct file_lock **before; 2062 2062 ··· 2152 2152 fl_pid = fl->fl_pid; 2153 2153 2154 2154 if (fl->fl_file != NULL) 2155 - inode = fl->fl_file->f_path.dentry->d_inode; 2155 + inode = file_inode(fl->fl_file); 2156 2156 2157 2157 seq_printf(f, "%lld:%s ", id, pfx); 2158 2158 if (IS_POSIX(fl)) {
+2 -2
fs/logfs/dir.c
··· 284 284 #define IMPLICIT_NODES 2 285 285 static int __logfs_readdir(struct file *file, void *buf, filldir_t filldir) 286 286 { 287 - struct inode *dir = file->f_dentry->d_inode; 287 + struct inode *dir = file_inode(file); 288 288 loff_t pos = file->f_pos - IMPLICIT_NODES; 289 289 struct page *page; 290 290 struct logfs_disk_dentry *dd; ··· 320 320 321 321 static int logfs_readdir(struct file *file, void *buf, filldir_t filldir) 322 322 { 323 - struct inode *inode = file->f_dentry->d_inode; 323 + struct inode *inode = file_inode(file); 324 324 ino_t pino = parent_ino(file->f_dentry); 325 325 int err; 326 326
+1 -1
fs/logfs/file.c
··· 183 183 184 184 long logfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 185 185 { 186 - struct inode *inode = file->f_path.dentry->d_inode; 186 + struct inode *inode = file_inode(file); 187 187 struct logfs_inode *li = logfs_inode(inode); 188 188 unsigned int oldflags, flags; 189 189 int err;
+1 -1
fs/minix/dir.c
··· 85 85 static int minix_readdir(struct file * filp, void * dirent, filldir_t filldir) 86 86 { 87 87 unsigned long pos = filp->f_pos; 88 - struct inode *inode = filp->f_path.dentry->d_inode; 88 + struct inode *inode = file_inode(filp); 89 89 struct super_block *sb = inode->i_sb; 90 90 unsigned offset = pos & ~PAGE_CACHE_MASK; 91 91 unsigned long n = pos >> PAGE_CACHE_SHIFT;
+1 -1
fs/namei.c
··· 2778 2778 goto out; 2779 2779 2780 2780 if ((*opened & FILE_CREATED) || 2781 - !S_ISREG(file->f_path.dentry->d_inode->i_mode)) 2781 + !S_ISREG(file_inode(file)->i_mode)) 2782 2782 will_truncate = false; 2783 2783 2784 2784 audit_inode(name, file->f_path.dentry, 0);
+1 -1
fs/namespace.c
··· 384 384 */ 385 385 int __mnt_want_write_file(struct file *file) 386 386 { 387 - struct inode *inode = file->f_dentry->d_inode; 387 + struct inode *inode = file_inode(file); 388 388 389 389 if (!(file->f_mode & FMODE_WRITE) || special_file(inode->i_mode)) 390 390 return __mnt_want_write(file->f_path.mnt);
+2 -2
fs/ncpfs/inode.c
··· 525 525 if (!ncp_filp) 526 526 goto out; 527 527 error = -ENOTSOCK; 528 - sock_inode = ncp_filp->f_path.dentry->d_inode; 528 + sock_inode = file_inode(ncp_filp); 529 529 if (!S_ISSOCK(sock_inode->i_mode)) 530 530 goto out_fput; 531 531 sock = SOCKET_I(sock_inode); ··· 564 564 if (!server->info_filp) 565 565 goto out_bdi; 566 566 error = -ENOTSOCK; 567 - sock_inode = server->info_filp->f_path.dentry->d_inode; 567 + sock_inode = file_inode(server->info_filp); 568 568 if (!S_ISSOCK(sock_inode->i_mode)) 569 569 goto out_fput2; 570 570 info_sock = SOCKET_I(sock_inode);
+1 -1
fs/ncpfs/ioctl.c
··· 808 808 809 809 long ncp_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 810 810 { 811 - struct inode *inode = filp->f_dentry->d_inode; 811 + struct inode *inode = file_inode(filp); 812 812 struct ncp_server *server = NCP_SERVER(inode); 813 813 uid_t uid = current_uid(); 814 814 int need_drop_write = 0;
+1 -1
fs/ncpfs/mmap.c
··· 105 105 /* This is used for a general mmap of a ncp file */ 106 106 int ncp_mmap(struct file *file, struct vm_area_struct *vma) 107 107 { 108 - struct inode *inode = file->f_path.dentry->d_inode; 108 + struct inode *inode = file_inode(file); 109 109 110 110 DPRINTK("ncp_mmap: called\n"); 111 111
+4 -4
fs/nfs/dir.c
··· 281 281 282 282 for (i = 0; i < array->size; i++) { 283 283 if (array->array[i].cookie == *desc->dir_cookie) { 284 - struct nfs_inode *nfsi = NFS_I(desc->file->f_path.dentry->d_inode); 284 + struct nfs_inode *nfsi = NFS_I(file_inode(desc->file)); 285 285 struct nfs_open_dir_context *ctx = desc->file->private_data; 286 286 287 287 new_pos = desc->current_index + i; ··· 629 629 static 630 630 int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page* page) 631 631 { 632 - struct inode *inode = desc->file->f_path.dentry->d_inode; 632 + struct inode *inode = file_inode(desc->file); 633 633 int ret; 634 634 635 635 ret = nfs_readdir_xdr_to_array(desc, page, inode); ··· 660 660 static 661 661 struct page *get_cache_page(nfs_readdir_descriptor_t *desc) 662 662 { 663 - return read_cache_page(desc->file->f_path.dentry->d_inode->i_mapping, 663 + return read_cache_page(file_inode(desc->file)->i_mapping, 664 664 desc->page_index, (filler_t *)nfs_readdir_filler, desc); 665 665 } 666 666 ··· 764 764 { 765 765 struct page *page = NULL; 766 766 int status; 767 - struct inode *inode = desc->file->f_path.dentry->d_inode; 767 + struct inode *inode = file_inode(desc->file); 768 768 struct nfs_open_dir_context *ctx = desc->file->private_data; 769 769 770 770 dfprintk(DIRCACHE, "NFS: uncached_readdir() searching for cookie %Lu\n",
+1 -1
fs/nfs/file.c
··· 292 292 nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) 293 293 { 294 294 int ret; 295 - struct inode *inode = file->f_path.dentry->d_inode; 295 + struct inode *inode = file_inode(file); 296 296 297 297 do { 298 298 ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
+1 -1
fs/nfs/idmap.c
··· 764 764 static ssize_t 765 765 idmap_pipe_downcall(struct file *filp, const char __user *src, size_t mlen) 766 766 { 767 - struct rpc_inode *rpci = RPC_I(filp->f_path.dentry->d_inode); 767 + struct rpc_inode *rpci = RPC_I(file_inode(filp)); 768 768 struct idmap *idmap = (struct idmap *)rpci->private; 769 769 struct key_construction *cons; 770 770 struct idmap_msg im;
+2 -2
fs/nfs/inode.c
··· 714 714 */ 715 715 void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx) 716 716 { 717 - struct inode *inode = filp->f_path.dentry->d_inode; 717 + struct inode *inode = file_inode(filp); 718 718 struct nfs_inode *nfsi = NFS_I(inode); 719 719 720 720 filp->private_data = get_nfs_open_context(ctx); ··· 747 747 748 748 static void nfs_file_clear_open_context(struct file *filp) 749 749 { 750 - struct inode *inode = filp->f_path.dentry->d_inode; 750 + struct inode *inode = file_inode(filp); 751 751 struct nfs_open_context *ctx = nfs_file_open_context(filp); 752 752 753 753 if (ctx) {
+1 -1
fs/nfs/nfs3proc.c
··· 872 872 static int 873 873 nfs3_proc_lock(struct file *filp, int cmd, struct file_lock *fl) 874 874 { 875 - struct inode *inode = filp->f_path.dentry->d_inode; 875 + struct inode *inode = file_inode(filp); 876 876 877 877 return nlmclnt_proc(NFS_SERVER(inode)->nlm_host, cmd, fl); 878 878 }
+1 -1
fs/nfs/nfs4file.c
··· 94 94 nfs4_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) 95 95 { 96 96 int ret; 97 - struct inode *inode = file->f_path.dentry->d_inode; 97 + struct inode *inode = file_inode(file); 98 98 99 99 do { 100 100 ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
+1 -1
fs/nfs/proc.c
··· 662 662 static int 663 663 nfs_proc_lock(struct file *filp, int cmd, struct file_lock *fl) 664 664 { 665 - struct inode *inode = filp->f_path.dentry->d_inode; 665 + struct inode *inode = file_inode(filp); 666 666 667 667 return nlmclnt_proc(NFS_SERVER(inode)->nlm_host, cmd, fl); 668 668 }
+3 -3
fs/nfsd/fault_inject.c
··· 101 101 loff_t pos = *ppos; 102 102 103 103 if (!pos) 104 - nfsd_inject_get(file->f_dentry->d_inode->i_private, &val); 104 + nfsd_inject_get(file_inode(file)->i_private, &val); 105 105 size = scnprintf(read_buf, sizeof(read_buf), "%llu\n", val); 106 106 107 107 if (pos < 0) ··· 133 133 134 134 size = rpc_pton(net, write_buf, size, (struct sockaddr *)&sa, sizeof(sa)); 135 135 if (size > 0) 136 - nfsd_inject_set_client(file->f_dentry->d_inode->i_private, &sa, size); 136 + nfsd_inject_set_client(file_inode(file)->i_private, &sa, size); 137 137 else { 138 138 val = simple_strtoll(write_buf, NULL, 0); 139 - nfsd_inject_set(file->f_dentry->d_inode->i_private, val); 139 + nfsd_inject_set(file_inode(file)->i_private, val); 140 140 } 141 141 return len; /* on success, claim we got the whole input */ 142 142 }
+1 -1
fs/nfsd/nfsctl.c
··· 85 85 86 86 static ssize_t nfsctl_transaction_write(struct file *file, const char __user *buf, size_t size, loff_t *pos) 87 87 { 88 - ino_t ino = file->f_path.dentry->d_inode->i_ino; 88 + ino_t ino = file_inode(file)->i_ino; 89 89 char *data; 90 90 ssize_t rv; 91 91
+3 -3
fs/nfsd/vfs.c
··· 979 979 */ 980 980 static int wait_for_concurrent_writes(struct file *file) 981 981 { 982 - struct inode *inode = file->f_path.dentry->d_inode; 982 + struct inode *inode = file_inode(file); 983 983 static ino_t last_ino; 984 984 static dev_t last_dev; 985 985 int err = 0; ··· 1070 1070 if (err) 1071 1071 return err; 1072 1072 1073 - inode = file->f_path.dentry->d_inode; 1073 + inode = file_inode(file); 1074 1074 1075 1075 /* Get readahead parameters */ 1076 1076 ra = nfsd_get_raparms(inode->i_sb->s_dev, inode->i_ino); ··· 1957 1957 offset = *offsetp; 1958 1958 1959 1959 while (1) { 1960 - struct inode *dir_inode = file->f_path.dentry->d_inode; 1960 + struct inode *dir_inode = file_inode(file); 1961 1961 unsigned int reclen; 1962 1962 1963 1963 cdp->err = nfserr_eof; /* will be cleared on successful read */
+1 -1
fs/nilfs2/dir.c
··· 259 259 static int nilfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 260 260 { 261 261 loff_t pos = filp->f_pos; 262 - struct inode *inode = filp->f_dentry->d_inode; 262 + struct inode *inode = file_inode(filp); 263 263 struct super_block *sb = inode->i_sb; 264 264 unsigned int offset = pos & ~PAGE_CACHE_MASK; 265 265 unsigned long n = pos >> PAGE_CACHE_SHIFT;
+1 -1
fs/nilfs2/file.c
··· 67 67 static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 68 68 { 69 69 struct page *page = vmf->page; 70 - struct inode *inode = vma->vm_file->f_dentry->d_inode; 70 + struct inode *inode = file_inode(vma->vm_file); 71 71 struct nilfs_transaction_info ti; 72 72 int ret = 0; 73 73
+1 -1
fs/nilfs2/ioctl.c
··· 793 793 794 794 long nilfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 795 795 { 796 - struct inode *inode = filp->f_dentry->d_inode; 796 + struct inode *inode = file_inode(filp); 797 797 void __user *argp = (void __user *)arg; 798 798 799 799 switch (cmd) {
+2 -2
fs/notify/dnotify/dnotify.c
··· 174 174 struct dnotify_struct **prev; 175 175 struct inode *inode; 176 176 177 - inode = filp->f_path.dentry->d_inode; 177 + inode = file_inode(filp); 178 178 if (!S_ISDIR(inode->i_mode)) 179 179 return; 180 180 ··· 296 296 } 297 297 298 298 /* dnotify only works on directories */ 299 - inode = filp->f_path.dentry->d_inode; 299 + inode = file_inode(filp); 300 300 if (!S_ISDIR(inode->i_mode)) { 301 301 error = -ENOTDIR; 302 302 goto out_err;
+1 -1
fs/notify/fanotify/fanotify_user.c
··· 466 466 467 467 ret = -ENOTDIR; 468 468 if ((flags & FAN_MARK_ONLYDIR) && 469 - !(S_ISDIR(f.file->f_path.dentry->d_inode->i_mode))) { 469 + !(S_ISDIR(file_inode(f.file)->i_mode))) { 470 470 fdput(f); 471 471 goto out; 472 472 }
+1 -1
fs/ntfs/dir.c
··· 1101 1101 { 1102 1102 s64 ia_pos, ia_start, prev_ia_pos, bmp_pos; 1103 1103 loff_t fpos, i_size; 1104 - struct inode *bmp_vi, *vdir = filp->f_path.dentry->d_inode; 1104 + struct inode *bmp_vi, *vdir = file_inode(filp); 1105 1105 struct super_block *sb = vdir->i_sb; 1106 1106 ntfs_inode *ndir = NTFS_I(vdir); 1107 1107 ntfs_volume *vol = NTFS_SB(sb);
+2 -2
fs/ocfs2/aops.c
··· 569 569 int ret, 570 570 bool is_async) 571 571 { 572 - struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; 572 + struct inode *inode = file_inode(iocb->ki_filp); 573 573 int level; 574 574 wait_queue_head_t *wq = ocfs2_ioend_wq(inode); 575 575 ··· 626 626 unsigned long nr_segs) 627 627 { 628 628 struct file *file = iocb->ki_filp; 629 - struct inode *inode = file->f_path.dentry->d_inode->i_mapping->host; 629 + struct inode *inode = file_inode(file)->i_mapping->host; 630 630 631 631 /* 632 632 * Fallback to buffered I/O if we see an inode without
+1 -1
fs/ocfs2/dir.c
··· 2015 2015 int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir) 2016 2016 { 2017 2017 int error = 0; 2018 - struct inode *inode = filp->f_path.dentry->d_inode; 2018 + struct inode *inode = file_inode(filp); 2019 2019 int lock_level = 0; 2020 2020 2021 2021 trace_ocfs2_readdir((unsigned long long)OCFS2_I(inode)->ip_blkno);
+3 -3
fs/ocfs2/dlmfs/dlmfs.c
··· 224 224 static unsigned int dlmfs_file_poll(struct file *file, poll_table *wait) 225 225 { 226 226 int event = 0; 227 - struct inode *inode = file->f_path.dentry->d_inode; 227 + struct inode *inode = file_inode(file); 228 228 struct dlmfs_inode_private *ip = DLMFS_I(inode); 229 229 230 230 poll_wait(file, &ip->ip_lockres.l_event, wait); ··· 245 245 int bytes_left; 246 246 ssize_t readlen, got; 247 247 char *lvb_buf; 248 - struct inode *inode = filp->f_path.dentry->d_inode; 248 + struct inode *inode = file_inode(filp); 249 249 250 250 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n", 251 251 inode->i_ino, count, *ppos); ··· 293 293 int bytes_left; 294 294 ssize_t writelen; 295 295 char *lvb_buf; 296 - struct inode *inode = filp->f_path.dentry->d_inode; 296 + struct inode *inode = file_inode(filp); 297 297 298 298 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n", 299 299 inode->i_ino, count, *ppos);
+5 -5
fs/ocfs2/file.c
··· 1949 1949 int ocfs2_change_file_space(struct file *file, unsigned int cmd, 1950 1950 struct ocfs2_space_resv *sr) 1951 1951 { 1952 - struct inode *inode = file->f_path.dentry->d_inode; 1952 + struct inode *inode = file_inode(file); 1953 1953 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 1954 1954 int ret; 1955 1955 ··· 1977 1977 static long ocfs2_fallocate(struct file *file, int mode, loff_t offset, 1978 1978 loff_t len) 1979 1979 { 1980 - struct inode *inode = file->f_path.dentry->d_inode; 1980 + struct inode *inode = file_inode(file); 1981 1981 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 1982 1982 struct ocfs2_space_resv sr; 1983 1983 int change_size = 1; ··· 2232 2232 loff_t old_size, *ppos = &iocb->ki_pos; 2233 2233 u32 old_clusters; 2234 2234 struct file *file = iocb->ki_filp; 2235 - struct inode *inode = file->f_path.dentry->d_inode; 2235 + struct inode *inode = file_inode(file); 2236 2236 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 2237 2237 int full_coherency = !(osb->s_mount_opt & 2238 2238 OCFS2_MOUNT_COHERENCY_BUFFERED); ··· 2516 2516 unsigned int flags) 2517 2517 { 2518 2518 int ret = 0, lock_level = 0; 2519 - struct inode *inode = in->f_path.dentry->d_inode; 2519 + struct inode *inode = file_inode(in); 2520 2520 2521 2521 trace_ocfs2_file_splice_read(inode, in, in->f_path.dentry, 2522 2522 (unsigned long long)OCFS2_I(inode)->ip_blkno, ··· 2546 2546 { 2547 2547 int ret = 0, rw_level = -1, have_alloc_sem = 0, lock_level = 0; 2548 2548 struct file *filp = iocb->ki_filp; 2549 - struct inode *inode = filp->f_path.dentry->d_inode; 2549 + struct inode *inode = file_inode(filp); 2550 2550 2551 2551 trace_ocfs2_file_aio_read(inode, filp, filp->f_path.dentry, 2552 2552 (unsigned long long)OCFS2_I(inode)->ip_blkno,
+2 -2
fs/ocfs2/ioctl.c
··· 881 881 882 882 long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 883 883 { 884 - struct inode *inode = filp->f_path.dentry->d_inode; 884 + struct inode *inode = file_inode(filp); 885 885 unsigned int flags; 886 886 int new_clusters; 887 887 int status; ··· 994 994 { 995 995 bool preserve; 996 996 struct reflink_arguments args; 997 - struct inode *inode = file->f_path.dentry->d_inode; 997 + struct inode *inode = file_inode(file); 998 998 struct ocfs2_info info; 999 999 void __user *argp = (void __user *)arg; 1000 1000
+4 -4
fs/ocfs2/mmap.c
··· 62 62 struct page *page) 63 63 { 64 64 int ret = VM_FAULT_NOPAGE; 65 - struct inode *inode = file->f_path.dentry->d_inode; 65 + struct inode *inode = file_inode(file); 66 66 struct address_space *mapping = inode->i_mapping; 67 67 loff_t pos = page_offset(page); 68 68 unsigned int len = PAGE_CACHE_SIZE; ··· 131 131 static int ocfs2_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 132 132 { 133 133 struct page *page = vmf->page; 134 - struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 134 + struct inode *inode = file_inode(vma->vm_file); 135 135 struct buffer_head *di_bh = NULL; 136 136 sigset_t oldset; 137 137 int ret; ··· 180 180 { 181 181 int ret = 0, lock_level = 0; 182 182 183 - ret = ocfs2_inode_lock_atime(file->f_dentry->d_inode, 183 + ret = ocfs2_inode_lock_atime(file_inode(file), 184 184 file->f_vfsmnt, &lock_level); 185 185 if (ret < 0) { 186 186 mlog_errno(ret); 187 187 goto out; 188 188 } 189 - ocfs2_inode_unlock(file->f_dentry->d_inode, lock_level); 189 + ocfs2_inode_unlock(file_inode(file), lock_level); 190 190 out: 191 191 vma->vm_ops = &ocfs2_file_vm_ops; 192 192 return 0;
+1 -1
fs/ocfs2/move_extents.c
··· 1055 1055 { 1056 1056 int status; 1057 1057 1058 - struct inode *inode = filp->f_path.dentry->d_inode; 1058 + struct inode *inode = file_inode(filp); 1059 1059 struct ocfs2_move_extents range; 1060 1060 struct ocfs2_move_extents_context *context = NULL; 1061 1061
+2 -2
fs/ocfs2/refcounttree.c
··· 2927 2927 u32 new_cluster, u32 new_len) 2928 2928 { 2929 2929 int ret = 0, partial; 2930 - struct inode *inode = file->f_path.dentry->d_inode; 2930 + struct inode *inode = file_inode(file); 2931 2931 struct ocfs2_caching_info *ci = INODE_CACHE(inode); 2932 2932 struct super_block *sb = ocfs2_metadata_cache_get_super(ci); 2933 2933 u64 new_block = ocfs2_clusters_to_blocks(sb, new_cluster); ··· 3020 3020 u32 new_cluster, u32 new_len) 3021 3021 { 3022 3022 int ret = 0; 3023 - struct inode *inode = file->f_path.dentry->d_inode; 3023 + struct inode *inode = file_inode(file); 3024 3024 struct super_block *sb = inode->i_sb; 3025 3025 struct ocfs2_caching_info *ci = INODE_CACHE(inode); 3026 3026 int i, blocks = ocfs2_clusters_to_blocks(sb, new_len);
+2 -2
fs/omfs/dir.c
··· 330 330 static int omfs_fill_chain(struct file *filp, void *dirent, filldir_t filldir, 331 331 u64 fsblock, int hindex) 332 332 { 333 - struct inode *dir = filp->f_dentry->d_inode; 333 + struct inode *dir = file_inode(filp); 334 334 struct buffer_head *bh; 335 335 struct omfs_inode *oi; 336 336 u64 self; ··· 405 405 406 406 static int omfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 407 407 { 408 - struct inode *dir = filp->f_dentry->d_inode; 408 + struct inode *dir = file_inode(filp); 409 409 struct buffer_head *bh; 410 410 loff_t offset, res; 411 411 unsigned int hchain, hindex;
+3 -3
fs/open.c
··· 228 228 229 229 int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len) 230 230 { 231 - struct inode *inode = file->f_path.dentry->d_inode; 231 + struct inode *inode = file_inode(file); 232 232 long ret; 233 233 234 234 if (offset < 0 || len <= 0) ··· 426 426 if (!f.file) 427 427 goto out; 428 428 429 - inode = f.file->f_path.dentry->d_inode; 429 + inode = file_inode(f.file); 430 430 431 431 error = -ENOTDIR; 432 432 if (!S_ISDIR(inode->i_mode)) ··· 689 689 f->f_mode = FMODE_PATH; 690 690 691 691 path_get(&f->f_path); 692 - inode = f->f_path.dentry->d_inode; 692 + inode = file_inode(f); 693 693 if (f->f_mode & FMODE_WRITE) { 694 694 error = __get_file_write_access(inode, f->f_path.mnt); 695 695 if (error)
+1 -1
fs/openpromfs/inode.c
··· 262 262 263 263 static int openpromfs_readdir(struct file * filp, void * dirent, filldir_t filldir) 264 264 { 265 - struct inode *inode = filp->f_path.dentry->d_inode; 265 + struct inode *inode = file_inode(filp); 266 266 struct op_inode_info *oi = OP_I(inode); 267 267 struct device_node *dp = oi->u.node; 268 268 struct device_node *child;
+8 -8
fs/pipe.c
··· 361 361 unsigned long nr_segs, loff_t pos) 362 362 { 363 363 struct file *filp = iocb->ki_filp; 364 - struct inode *inode = filp->f_path.dentry->d_inode; 364 + struct inode *inode = file_inode(filp); 365 365 struct pipe_inode_info *pipe; 366 366 int do_wakeup; 367 367 ssize_t ret; ··· 486 486 unsigned long nr_segs, loff_t ppos) 487 487 { 488 488 struct file *filp = iocb->ki_filp; 489 - struct inode *inode = filp->f_path.dentry->d_inode; 489 + struct inode *inode = file_inode(filp); 490 490 struct pipe_inode_info *pipe; 491 491 ssize_t ret; 492 492 int do_wakeup; ··· 677 677 678 678 static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 679 679 { 680 - struct inode *inode = filp->f_path.dentry->d_inode; 680 + struct inode *inode = file_inode(filp); 681 681 struct pipe_inode_info *pipe; 682 682 int count, buf, nrbufs; 683 683 ··· 705 705 pipe_poll(struct file *filp, poll_table *wait) 706 706 { 707 707 unsigned int mask; 708 - struct inode *inode = filp->f_path.dentry->d_inode; 708 + struct inode *inode = file_inode(filp); 709 709 struct pipe_inode_info *pipe = inode->i_pipe; 710 710 int nrbufs; 711 711 ··· 758 758 static int 759 759 pipe_read_fasync(int fd, struct file *filp, int on) 760 760 { 761 - struct inode *inode = filp->f_path.dentry->d_inode; 761 + struct inode *inode = file_inode(filp); 762 762 int retval; 763 763 764 764 mutex_lock(&inode->i_mutex); ··· 772 772 static int 773 773 pipe_write_fasync(int fd, struct file *filp, int on) 774 774 { 775 - struct inode *inode = filp->f_path.dentry->d_inode; 775 + struct inode *inode = file_inode(filp); 776 776 int retval; 777 777 778 778 mutex_lock(&inode->i_mutex); ··· 786 786 static int 787 787 pipe_rdwr_fasync(int fd, struct file *filp, int on) 788 788 { 789 - struct inode *inode = filp->f_path.dentry->d_inode; 789 + struct inode *inode = file_inode(filp); 790 790 struct pipe_inode_info *pipe = inode->i_pipe; 791 791 int retval; 792 792 ··· 1226 1226 */ 1227 1227 struct pipe_inode_info *get_pipe_info(struct file *file) 1228 1228 { 1229 - struct inode *i = file->f_path.dentry->d_inode; 1229 + struct inode *i = file_inode(file); 1230 1230 1231 1231 return S_ISFIFO(i->i_mode) ? i->i_pipe : NULL; 1232 1232 }
+19 -19
fs/proc/base.c
··· 383 383 static ssize_t lstats_write(struct file *file, const char __user *buf, 384 384 size_t count, loff_t *offs) 385 385 { 386 - struct task_struct *task = get_proc_task(file->f_dentry->d_inode); 386 + struct task_struct *task = get_proc_task(file_inode(file)); 387 387 388 388 if (!task) 389 389 return -ESRCH; ··· 602 602 static ssize_t proc_info_read(struct file * file, char __user * buf, 603 603 size_t count, loff_t *ppos) 604 604 { 605 - struct inode * inode = file->f_path.dentry->d_inode; 605 + struct inode * inode = file_inode(file); 606 606 unsigned long page; 607 607 ssize_t length; 608 608 struct task_struct *task = get_proc_task(inode); ··· 668 668 669 669 static int __mem_open(struct inode *inode, struct file *file, unsigned int mode) 670 670 { 671 - struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode); 671 + struct task_struct *task = get_proc_task(file_inode(file)); 672 672 struct mm_struct *mm; 673 673 674 674 if (!task) ··· 869 869 static ssize_t oom_adj_read(struct file *file, char __user *buf, size_t count, 870 870 loff_t *ppos) 871 871 { 872 - struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode); 872 + struct task_struct *task = get_proc_task(file_inode(file)); 873 873 char buffer[PROC_NUMBUF]; 874 874 int oom_adj = OOM_ADJUST_MIN; 875 875 size_t len; ··· 916 916 goto out; 917 917 } 918 918 919 - task = get_proc_task(file->f_path.dentry->d_inode); 919 + task = get_proc_task(file_inode(file)); 920 920 if (!task) { 921 921 err = -ESRCH; 922 922 goto out; ··· 976 976 static ssize_t oom_score_adj_read(struct file *file, char __user *buf, 977 977 size_t count, loff_t *ppos) 978 978 { 979 - struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode); 979 + struct task_struct *task = get_proc_task(file_inode(file)); 980 980 char buffer[PROC_NUMBUF]; 981 981 short oom_score_adj = OOM_SCORE_ADJ_MIN; 982 982 unsigned long flags; ··· 1019 1019 goto out; 1020 1020 } 1021 1021 1022 - task = get_proc_task(file->f_path.dentry->d_inode); 1022 + task = get_proc_task(file_inode(file)); 1023 1023 if (!task) { 1024 1024 err = -ESRCH; 1025 1025 goto out; ··· 1067 1067 static ssize_t proc_loginuid_read(struct file * file, char __user * buf, 1068 1068 size_t count, loff_t *ppos) 1069 1069 { 1070 - struct inode * inode = file->f_path.dentry->d_inode; 1070 + struct inode * inode = file_inode(file); 1071 1071 struct task_struct *task = get_proc_task(inode); 1072 1072 ssize_t length; 1073 1073 char tmpbuf[TMPBUFLEN]; ··· 1084 1084 static ssize_t proc_loginuid_write(struct file * file, const char __user * buf, 1085 1085 size_t count, loff_t *ppos) 1086 1086 { 1087 - struct inode * inode = file->f_path.dentry->d_inode; 1087 + struct inode * inode = file_inode(file); 1088 1088 char *page, *tmp; 1089 1089 ssize_t length; 1090 1090 uid_t loginuid; ··· 1142 1142 static ssize_t proc_sessionid_read(struct file * file, char __user * buf, 1143 1143 size_t count, loff_t *ppos) 1144 1144 { 1145 - struct inode * inode = file->f_path.dentry->d_inode; 1145 + struct inode * inode = file_inode(file); 1146 1146 struct task_struct *task = get_proc_task(inode); 1147 1147 ssize_t length; 1148 1148 char tmpbuf[TMPBUFLEN]; ··· 1165 1165 static ssize_t proc_fault_inject_read(struct file * file, char __user * buf, 1166 1166 size_t count, loff_t *ppos) 1167 1167 { 1168 - struct task_struct *task = get_proc_task(file->f_dentry->d_inode); 1168 + struct task_struct *task = get_proc_task(file_inode(file)); 1169 1169 char buffer[PROC_NUMBUF]; 1170 1170 size_t len; 1171 1171 int make_it_fail; ··· 1197 1197 make_it_fail = simple_strtol(strstrip(buffer), &end, 0); 1198 1198 if (*end) 1199 1199 return -EINVAL; 1200 - task = get_proc_task(file->f_dentry->d_inode); 1200 + task = get_proc_task(file_inode(file)); 1201 1201 if (!task) 1202 1202 return -ESRCH; 1203 1203 task->make_it_fail = make_it_fail; ··· 1237 1237 sched_write(struct file *file, const char __user *buf, 1238 1238 size_t count, loff_t *offset) 1239 1239 { 1240 - struct inode *inode = file->f_path.dentry->d_inode; 1240 + struct inode *inode = file_inode(file); 1241 1241 struct task_struct *p; 1242 1242 1243 1243 p = get_proc_task(inode); ··· 1288 1288 sched_autogroup_write(struct file *file, const char __user *buf, 1289 1289 size_t count, loff_t *offset) 1290 1290 { 1291 - struct inode *inode = file->f_path.dentry->d_inode; 1291 + struct inode *inode = file_inode(file); 1292 1292 struct task_struct *p; 1293 1293 char buffer[PROC_NUMBUF]; 1294 1294 int nice; ··· 1343 1343 static ssize_t comm_write(struct file *file, const char __user *buf, 1344 1344 size_t count, loff_t *offset) 1345 1345 { 1346 - struct inode *inode = file->f_path.dentry->d_inode; 1346 + struct inode *inode = file_inode(file); 1347 1347 struct task_struct *p; 1348 1348 char buffer[TASK_COMM_LEN]; 1349 1349 ··· 2146 2146 static ssize_t proc_pid_attr_read(struct file * file, char __user * buf, 2147 2147 size_t count, loff_t *ppos) 2148 2148 { 2149 - struct inode * inode = file->f_path.dentry->d_inode; 2149 + struct inode * inode = file_inode(file); 2150 2150 char *p = NULL; 2151 2151 ssize_t length; 2152 2152 struct task_struct *task = get_proc_task(inode); ··· 2167 2167 static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf, 2168 2168 size_t count, loff_t *ppos) 2169 2169 { 2170 - struct inode * inode = file->f_path.dentry->d_inode; 2170 + struct inode * inode = file_inode(file); 2171 2171 char *page; 2172 2172 ssize_t length; 2173 2173 struct task_struct *task = get_proc_task(inode); ··· 2256 2256 static ssize_t proc_coredump_filter_read(struct file *file, char __user *buf, 2257 2257 size_t count, loff_t *ppos) 2258 2258 { 2259 - struct task_struct *task = get_proc_task(file->f_dentry->d_inode); 2259 + struct task_struct *task = get_proc_task(file_inode(file)); 2260 2260 struct mm_struct *mm; 2261 2261 char buffer[PROC_NUMBUF]; 2262 2262 size_t len; ··· 2308 2308 goto out_no_task; 2309 2309 2310 2310 ret = -ESRCH; 2311 - task = get_proc_task(file->f_dentry->d_inode); 2311 + task = get_proc_task(file_inode(file)); 2312 2312 if (!task) 2313 2313 goto out_no_task; 2314 2314
+5 -5
fs/proc/generic.c
··· 42 42 __proc_file_read(struct file *file, char __user *buf, size_t nbytes, 43 43 loff_t *ppos) 44 44 { 45 - struct inode * inode = file->f_path.dentry->d_inode; 45 + struct inode * inode = file_inode(file); 46 46 char *page; 47 47 ssize_t retval=0; 48 48 int eof=0; ··· 188 188 proc_file_read(struct file *file, char __user *buf, size_t nbytes, 189 189 loff_t *ppos) 190 190 { 191 - struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 191 + struct proc_dir_entry *pde = PDE(file_inode(file)); 192 192 ssize_t rv = -EIO; 193 193 194 194 spin_lock(&pde->pde_unload_lock); ··· 209 209 proc_file_write(struct file *file, const char __user *buffer, 210 210 size_t count, loff_t *ppos) 211 211 { 212 - struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 212 + struct proc_dir_entry *pde = PDE(file_inode(file)); 213 213 ssize_t rv = -EIO; 214 214 215 215 if (pde->write_proc) { ··· 460 460 { 461 461 unsigned int ino; 462 462 int i; 463 - struct inode *inode = filp->f_path.dentry->d_inode; 463 + struct inode *inode = file_inode(filp); 464 464 int ret = 0; 465 465 466 466 ino = inode->i_ino; ··· 522 522 523 523 int proc_readdir(struct file *filp, void *dirent, filldir_t filldir) 524 524 { 525 - struct inode *inode = filp->f_path.dentry->d_inode; 525 + struct inode *inode = file_inode(filp); 526 526 527 527 return proc_readdir_de(PDE(inode), filp, dirent, filldir); 528 528 }
+7 -7
fs/proc/inode.c
··· 144 144 145 145 static loff_t proc_reg_llseek(struct file *file, loff_t offset, int whence) 146 146 { 147 - struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 147 + struct proc_dir_entry *pde = PDE(file_inode(file)); 148 148 loff_t rv = -EINVAL; 149 149 loff_t (*llseek)(struct file *, loff_t, int); 150 150 ··· 179 179 180 180 static ssize_t proc_reg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) 181 181 { 182 - struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 182 + struct proc_dir_entry *pde = PDE(file_inode(file)); 183 183 ssize_t rv = -EIO; 184 184 ssize_t (*read)(struct file *, char __user *, size_t, loff_t *); 185 185 ··· 201 201 202 202 static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) 203 203 { 204 - struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 204 + struct proc_dir_entry *pde = PDE(file_inode(file)); 205 205 ssize_t rv = -EIO; 206 206 ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *); 207 207 ··· 223 223 224 224 static unsigned int proc_reg_poll(struct file *file, struct poll_table_struct *pts) 225 225 { 226 - struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 226 + struct proc_dir_entry *pde = PDE(file_inode(file)); 227 227 unsigned int rv = DEFAULT_POLLMASK; 228 228 unsigned int (*poll)(struct file *, struct poll_table_struct *); 229 229 ··· 245 245 246 246 static long proc_reg_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 247 247 { 248 - struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 248 + struct proc_dir_entry *pde = PDE(file_inode(file)); 249 249 long rv = -ENOTTY; 250 250 long (*ioctl)(struct file *, unsigned int, unsigned long); 251 251 ··· 268 268 #ifdef CONFIG_COMPAT 269 269 static long proc_reg_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 270 270 { 271 - struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 271 + struct proc_dir_entry *pde = PDE(file_inode(file)); 272 272 long rv = -ENOTTY; 273 273 long (*compat_ioctl)(struct file *, unsigned int, unsigned long); 274 274 ··· 291 291 292 292 static int proc_reg_mmap(struct file *file, struct vm_area_struct *vma) 293 293 { 294 - struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 294 + struct proc_dir_entry *pde = PDE(file_inode(file)); 295 295 int rv = -EIO; 296 296 int (*mmap)(struct file *, struct vm_area_struct *); 297 297
+1 -1
fs/proc/nommu.c
··· 45 45 file = region->vm_file; 46 46 47 47 if (file) { 48 - struct inode *inode = region->vm_file->f_path.dentry->d_inode; 48 + struct inode *inode = file_inode(region->vm_file); 49 49 dev = inode->i_sb->s_dev; 50 50 ino = inode->i_ino; 51 51 }
+1 -1
fs/proc/proc_net.c
··· 163 163 struct net *net; 164 164 165 165 ret = -EINVAL; 166 - net = get_proc_task_net(filp->f_path.dentry->d_inode); 166 + net = get_proc_task_net(file_inode(filp)); 167 167 if (net != NULL) { 168 168 ret = proc_readdir_de(net->proc_net, filp, dirent, filldir); 169 169 put_net(net);
+2 -2
fs/proc/proc_sysctl.c
··· 478 478 static ssize_t proc_sys_call_handler(struct file *filp, void __user *buf, 479 479 size_t count, loff_t *ppos, int write) 480 480 { 481 - struct inode *inode = filp->f_path.dentry->d_inode; 481 + struct inode *inode = file_inode(filp); 482 482 struct ctl_table_header *head = grab_header(inode); 483 483 struct ctl_table *table = PROC_I(inode)->sysctl_entry; 484 484 ssize_t error; ··· 542 542 543 543 static unsigned int proc_sys_poll(struct file *filp, poll_table *wait) 544 544 { 545 - struct inode *inode = filp->f_path.dentry->d_inode; 545 + struct inode *inode = file_inode(filp); 546 546 struct ctl_table_header *head = grab_header(inode); 547 547 struct ctl_table *table = PROC_I(inode)->sysctl_entry; 548 548 unsigned int ret = DEFAULT_POLLMASK;
+3 -3
fs/proc/task_mmu.c
··· 271 271 const char *name = NULL; 272 272 273 273 if (file) { 274 - struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 274 + struct inode *inode = file_inode(vma->vm_file); 275 275 dev = inode->i_sb->s_dev; 276 276 ino = inode->i_ino; 277 277 pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT; ··· 743 743 return rv; 744 744 if (type < CLEAR_REFS_ALL || type > CLEAR_REFS_MAPPED) 745 745 return -EINVAL; 746 - task = get_proc_task(file->f_path.dentry->d_inode); 746 + task = get_proc_task(file_inode(file)); 747 747 if (!task) 748 748 return -ESRCH; 749 749 mm = get_task_mm(task); ··· 1015 1015 static ssize_t pagemap_read(struct file *file, char __user *buf, 1016 1016 size_t count, loff_t *ppos) 1017 1017 { 1018 - struct task_struct *task = get_proc_task(file->f_path.dentry->d_inode); 1018 + struct task_struct *task = get_proc_task(file_inode(file)); 1019 1019 struct mm_struct *mm; 1020 1020 struct pagemapread pm; 1021 1021 int ret = -ESRCH;
+1 -1
fs/proc/task_nommu.c
··· 149 149 file = vma->vm_file; 150 150 151 151 if (file) { 152 - struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 152 + struct inode *inode = file_inode(vma->vm_file); 153 153 dev = inode->i_sb->s_dev; 154 154 ino = inode->i_ino; 155 155 pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT;
+1 -1
fs/qnx4/dir.c
··· 16 16 17 17 static int qnx4_readdir(struct file *filp, void *dirent, filldir_t filldir) 18 18 { 19 - struct inode *inode = filp->f_path.dentry->d_inode; 19 + struct inode *inode = file_inode(filp); 20 20 unsigned int offset; 21 21 struct buffer_head *bh; 22 22 struct qnx4_inode_entry *de;
+1 -1
fs/qnx6/dir.c
··· 117 117 118 118 static int qnx6_readdir(struct file *filp, void *dirent, filldir_t filldir) 119 119 { 120 - struct inode *inode = filp->f_path.dentry->d_inode; 120 + struct inode *inode = file_inode(filp); 121 121 struct super_block *s = inode->i_sb; 122 122 struct qnx6_sb_info *sbi = QNX6_SB(s); 123 123 loff_t pos = filp->f_pos & (QNX6_DIR_ENTRY_SIZE - 1);
+1 -1
fs/ramfs/file-nommu.c
··· 202 202 unsigned long pgoff, unsigned long flags) 203 203 { 204 204 unsigned long maxpages, lpages, nr, loop, ret; 205 - struct inode *inode = file->f_path.dentry->d_inode; 205 + struct inode *inode = file_inode(file); 206 206 struct page **pages = NULL, **ptr, *page; 207 207 loff_t isize; 208 208
+4 -4
fs/read_write.c
··· 163 163 164 164 loff_t default_llseek(struct file *file, loff_t offset, int whence) 165 165 { 166 - struct inode *inode = file->f_path.dentry->d_inode; 166 + struct inode *inode = file_inode(file); 167 167 loff_t retval; 168 168 169 169 mutex_lock(&inode->i_mutex); ··· 290 290 loff_t pos; 291 291 int retval = -EINVAL; 292 292 293 - inode = file->f_path.dentry->d_inode; 293 + inode = file_inode(file); 294 294 if (unlikely((ssize_t) count < 0)) 295 295 return retval; 296 296 pos = *ppos; ··· 901 901 if (!(out.file->f_mode & FMODE_WRITE)) 902 902 goto fput_out; 903 903 retval = -EINVAL; 904 - in_inode = in.file->f_path.dentry->d_inode; 905 - out_inode = out.file->f_path.dentry->d_inode; 904 + in_inode = file_inode(in.file); 905 + out_inode = file_inode(out.file); 906 906 retval = rw_verify_area(WRITE, out.file, &out.file->f_pos, count); 907 907 if (retval < 0) 908 908 goto fput_out;
+1 -1
fs/readdir.c
··· 22 22 23 23 int vfs_readdir(struct file *file, filldir_t filler, void *buf) 24 24 { 25 - struct inode *inode = file->f_path.dentry->d_inode; 25 + struct inode *inode = file_inode(file); 26 26 int res = -ENOTDIR; 27 27 if (!file->f_op || !file->f_op->readdir) 28 28 goto out;
+1 -1
fs/reiserfs/file.c
··· 268 268 * new current position before returning. */ 269 269 ) 270 270 { 271 - struct inode *inode = file->f_path.dentry->d_inode; // Inode of the file that we are writing to. 271 + struct inode *inode = file_inode(file); // Inode of the file that we are writing to. 272 272 /* To simplify coding at this time, we store 273 273 locked pages in array for now */ 274 274 struct reiserfs_transaction_handle th;
+1 -1
fs/reiserfs/ioctl.c
··· 21 21 */ 22 22 long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 23 23 { 24 - struct inode *inode = filp->f_path.dentry->d_inode; 24 + struct inode *inode = file_inode(filp); 25 25 unsigned int flags; 26 26 int err = 0; 27 27
+1 -1
fs/reiserfs/procfs.c
··· 281 281 } 282 282 #if defined( REISERFS_USE_OIDMAPF ) 283 283 if (sb_info->oidmap.use_file && (sb_info->oidmap.mapf != NULL)) { 284 - loff_t size = sb_info->oidmap.mapf->f_path.dentry->d_inode->i_size; 284 + loff_t size = file_inode(sb_info->oidmap.mapf)->i_size; 285 285 total_used += size / sizeof(reiserfs_oidinterval_d_t); 286 286 } 287 287 #endif
+1 -1
fs/romfs/super.c
··· 147 147 */ 148 148 static int romfs_readdir(struct file *filp, void *dirent, filldir_t filldir) 149 149 { 150 - struct inode *i = filp->f_dentry->d_inode; 150 + struct inode *i = file_inode(filp); 151 151 struct romfs_inode ri; 152 152 unsigned long offset, maxoff; 153 153 int j, ino, nextfh;
+1 -1
fs/splice.c
··· 1170 1170 * randomly drop data for eg socket -> socket splicing. Use the 1171 1171 * piped splicing for that! 1172 1172 */ 1173 - i_mode = in->f_path.dentry->d_inode->i_mode; 1173 + i_mode = file_inode(in)->i_mode; 1174 1174 if (unlikely(!S_ISREG(i_mode) && !S_ISBLK(i_mode))) 1175 1175 return -EINVAL; 1176 1176
+1 -1
fs/squashfs/dir.c
··· 102 102 103 103 static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) 104 104 { 105 - struct inode *inode = file->f_dentry->d_inode; 105 + struct inode *inode = file_inode(file); 106 106 struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; 107 107 u64 block = squashfs_i(inode)->start + msblk->directory_table; 108 108 int offset = squashfs_i(inode)->offset, length, dir_count, size,
+1 -1
fs/sync.c
··· 332 332 if (!f.file) 333 333 goto out; 334 334 335 - i_mode = f.file->f_path.dentry->d_inode->i_mode; 335 + i_mode = file_inode(f.file)->i_mode; 336 336 ret = -ESPIPE; 337 337 if (!S_ISREG(i_mode) && !S_ISBLK(i_mode) && !S_ISDIR(i_mode) && 338 338 !S_ISLNK(i_mode))
+3 -3
fs/sysfs/bin.c
··· 70 70 read(struct file *file, char __user *userbuf, size_t bytes, loff_t *off) 71 71 { 72 72 struct bin_buffer *bb = file->private_data; 73 - int size = file->f_path.dentry->d_inode->i_size; 73 + int size = file_inode(file)->i_size; 74 74 loff_t offs = *off; 75 75 int count = min_t(size_t, bytes, PAGE_SIZE); 76 76 char *temp; ··· 140 140 size_t bytes, loff_t *off) 141 141 { 142 142 struct bin_buffer *bb = file->private_data; 143 - int size = file->f_path.dentry->d_inode->i_size; 143 + int size = file_inode(file)->i_size; 144 144 loff_t offs = *off; 145 145 int count = min_t(size_t, bytes, PAGE_SIZE); 146 146 char *temp; ··· 469 469 mutex_lock(&sysfs_bin_lock); 470 470 471 471 hlist_for_each_entry(bb, tmp, &attr_sd->s_bin_attr.buffers, list) { 472 - struct inode *inode = bb->file->f_path.dentry->d_inode; 472 + struct inode *inode = file_inode(bb->file); 473 473 474 474 unmap_mapping_range(inode->i_mapping, 0, 0, 1); 475 475 }
+1 -1
fs/sysv/dir.c
··· 68 68 static int sysv_readdir(struct file * filp, void * dirent, filldir_t filldir) 69 69 { 70 70 unsigned long pos = filp->f_pos; 71 - struct inode *inode = filp->f_path.dentry->d_inode; 71 + struct inode *inode = file_inode(filp); 72 72 struct super_block *sb = inode->i_sb; 73 73 unsigned offset = pos & ~PAGE_CACHE_MASK; 74 74 unsigned long n = pos >> PAGE_CACHE_SHIFT;
+1 -1
fs/ubifs/dir.c
··· 352 352 struct qstr nm; 353 353 union ubifs_key key; 354 354 struct ubifs_dent_node *dent; 355 - struct inode *dir = file->f_path.dentry->d_inode; 355 + struct inode *dir = file_inode(file); 356 356 struct ubifs_info *c = dir->i_sb->s_fs_info; 357 357 358 358 dbg_gen("dir ino %lu, f_pos %#llx", dir->i_ino, file->f_pos);
+1 -1
fs/ubifs/file.c
··· 1444 1444 struct vm_fault *vmf) 1445 1445 { 1446 1446 struct page *page = vmf->page; 1447 - struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 1447 + struct inode *inode = file_inode(vma->vm_file); 1448 1448 struct ubifs_info *c = inode->i_sb->s_fs_info; 1449 1449 struct timespec now = ubifs_current_time(inode); 1450 1450 struct ubifs_budget_req req = { .new_page = 1 };
+1 -1
fs/ubifs/ioctl.c
··· 147 147 long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 148 148 { 149 149 int flags, err; 150 - struct inode *inode = file->f_path.dentry->d_inode; 150 + struct inode *inode = file_inode(file); 151 151 152 152 switch (cmd) { 153 153 case FS_IOC_GETFLAGS:
+1 -1
fs/udf/dir.c
··· 186 186 187 187 static int udf_readdir(struct file *filp, void *dirent, filldir_t filldir) 188 188 { 189 - struct inode *dir = filp->f_path.dentry->d_inode; 189 + struct inode *dir = file_inode(filp); 190 190 int result; 191 191 192 192 if (filp->f_pos == 0) {
+2 -2
fs/udf/file.c
··· 139 139 { 140 140 ssize_t retval; 141 141 struct file *file = iocb->ki_filp; 142 - struct inode *inode = file->f_path.dentry->d_inode; 142 + struct inode *inode = file_inode(file); 143 143 int err, pos; 144 144 size_t count = iocb->ki_left; 145 145 struct udf_inode_info *iinfo = UDF_I(inode); ··· 178 178 179 179 long udf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 180 180 { 181 - struct inode *inode = filp->f_dentry->d_inode; 181 + struct inode *inode = file_inode(filp); 182 182 long old_block, new_block; 183 183 int result = -EINVAL; 184 184
+1 -1
fs/ufs/dir.c
··· 433 433 ufs_readdir(struct file *filp, void *dirent, filldir_t filldir) 434 434 { 435 435 loff_t pos = filp->f_pos; 436 - struct inode *inode = filp->f_path.dentry->d_inode; 436 + struct inode *inode = file_inode(filp); 437 437 struct super_block *sb = inode->i_sb; 438 438 unsigned int offset = pos & ~PAGE_CACHE_MASK; 439 439 unsigned long n = pos >> PAGE_CACHE_SHIFT;
+4 -4
fs/xfs/xfs_dfrag.c
··· 78 78 goto out_put_tmp_file; 79 79 } 80 80 81 - if (IS_SWAPFILE(f.file->f_path.dentry->d_inode) || 82 - IS_SWAPFILE(tmp.file->f_path.dentry->d_inode)) { 81 + if (IS_SWAPFILE(file_inode(f.file)) || 82 + IS_SWAPFILE(file_inode(tmp.file))) { 83 83 error = XFS_ERROR(EINVAL); 84 84 goto out_put_tmp_file; 85 85 } 86 86 87 - ip = XFS_I(f.file->f_path.dentry->d_inode); 88 - tip = XFS_I(tmp.file->f_path.dentry->d_inode); 87 + ip = XFS_I(file_inode(f.file)); 88 + tip = XFS_I(file_inode(tmp.file)); 89 89 90 90 if (ip->i_mount != tip->i_mount) { 91 91 error = XFS_ERROR(EINVAL);
+2 -2
fs/xfs/xfs_file.c
··· 811 811 loff_t offset, 812 812 loff_t len) 813 813 { 814 - struct inode *inode = file->f_path.dentry->d_inode; 814 + struct inode *inode = file_inode(file); 815 815 long error; 816 816 loff_t new_size = 0; 817 817 xfs_flock64_t bf; ··· 912 912 void *dirent, 913 913 filldir_t filldir) 914 914 { 915 - struct inode *inode = filp->f_path.dentry->d_inode; 915 + struct inode *inode = file_inode(filp); 916 916 xfs_inode_t *ip = XFS_I(inode); 917 917 int error; 918 918 size_t bufsize;
+3 -3
fs/xfs/xfs_ioctl.c
··· 80 80 f = fdget(hreq->fd); 81 81 if (!f.file) 82 82 return -EBADF; 83 - inode = f.file->f_path.dentry->d_inode; 83 + inode = file_inode(f.file); 84 84 } else { 85 85 error = user_lpath((const char __user *)hreq->path, &path); 86 86 if (error) ··· 168 168 /* 169 169 * Only allow handle opens under a directory. 170 170 */ 171 - if (!S_ISDIR(parfilp->f_path.dentry->d_inode->i_mode)) 171 + if (!S_ISDIR(file_inode(parfilp)->i_mode)) 172 172 return ERR_PTR(-ENOTDIR); 173 173 174 174 if (hlen != sizeof(xfs_handle_t)) ··· 1334 1334 unsigned int cmd, 1335 1335 unsigned long p) 1336 1336 { 1337 - struct inode *inode = filp->f_path.dentry->d_inode; 1337 + struct inode *inode = file_inode(filp); 1338 1338 struct xfs_inode *ip = XFS_I(inode); 1339 1339 struct xfs_mount *mp = ip->i_mount; 1340 1340 void __user *arg = (void __user *)p;
+1 -1
fs/xfs/xfs_ioctl32.c
··· 530 530 unsigned cmd, 531 531 unsigned long p) 532 532 { 533 - struct inode *inode = filp->f_path.dentry->d_inode; 533 + struct inode *inode = file_inode(filp); 534 534 struct xfs_inode *ip = XFS_I(inode); 535 535 struct xfs_mount *mp = ip->i_mount; 536 536 void __user *arg = (void __user *)p;
+7 -2
include/linux/fs.h
··· 2217 2217 return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); 2218 2218 } 2219 2219 2220 + static inline struct inode *file_inode(struct file *f) 2221 + { 2222 + return f->f_path.dentry->d_inode; 2223 + } 2224 + 2220 2225 /* 2221 2226 * get_write_access() gets write permission for a file. 2222 2227 * put_write_access() releases this write permission. ··· 2244 2239 } 2245 2240 static inline int deny_write_access(struct file *file) 2246 2241 { 2247 - struct inode *inode = file->f_path.dentry->d_inode; 2242 + struct inode *inode = file_inode(file); 2248 2243 return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -ETXTBSY; 2249 2244 } 2250 2245 static inline void put_write_access(struct inode * inode) ··· 2254 2249 static inline void allow_write_access(struct file *file) 2255 2250 { 2256 2251 if (file) 2257 - atomic_inc(&file->f_path.dentry->d_inode->i_writecount); 2252 + atomic_inc(&file_inode(file)->i_writecount); 2258 2253 } 2259 2254 #ifdef CONFIG_IMA 2260 2255 static inline void i_readcount_dec(struct inode *inode)
+1 -1
include/linux/fsnotify.h
··· 244 244 static inline void fsnotify_close(struct file *file) 245 245 { 246 246 struct path *path = &file->f_path; 247 - struct inode *inode = file->f_path.dentry->d_inode; 247 + struct inode *inode = file_inode(file); 248 248 fmode_t mode = file->f_mode; 249 249 __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE; 250 250
+1 -1
include/linux/hugetlb.h
··· 281 281 282 282 static inline struct hstate *hstate_file(struct file *f) 283 283 { 284 - return hstate_inode(f->f_dentry->d_inode); 284 + return hstate_inode(file_inode(f)); 285 285 } 286 286 287 287 static inline struct hstate *hstate_vma(struct vm_area_struct *vma)
+1 -1
include/linux/lockd/lockd.h
··· 291 291 292 292 static inline struct inode *nlmsvc_file_inode(struct nlm_file *file) 293 293 { 294 - return file->f_file->f_path.dentry->d_inode; 294 + return file_inode(file->f_file); 295 295 } 296 296 297 297 static inline int __nlm_privileged_request4(const struct sockaddr *sap)
+8 -8
ipc/mqueue.c
··· 477 477 static ssize_t mqueue_read_file(struct file *filp, char __user *u_data, 478 478 size_t count, loff_t *off) 479 479 { 480 - struct mqueue_inode_info *info = MQUEUE_I(filp->f_path.dentry->d_inode); 480 + struct mqueue_inode_info *info = MQUEUE_I(file_inode(filp)); 481 481 char buffer[FILENT_SIZE]; 482 482 ssize_t ret; 483 483 ··· 498 498 if (ret <= 0) 499 499 return ret; 500 500 501 - filp->f_path.dentry->d_inode->i_atime = filp->f_path.dentry->d_inode->i_ctime = CURRENT_TIME; 501 + file_inode(filp)->i_atime = file_inode(filp)->i_ctime = CURRENT_TIME; 502 502 return ret; 503 503 } 504 504 505 505 static int mqueue_flush_file(struct file *filp, fl_owner_t id) 506 506 { 507 - struct mqueue_inode_info *info = MQUEUE_I(filp->f_path.dentry->d_inode); 507 + struct mqueue_inode_info *info = MQUEUE_I(file_inode(filp)); 508 508 509 509 spin_lock(&info->lock); 510 510 if (task_tgid(current) == info->notify_owner) ··· 516 516 517 517 static unsigned int mqueue_poll_file(struct file *filp, struct poll_table_struct *poll_tab) 518 518 { 519 - struct mqueue_inode_info *info = MQUEUE_I(filp->f_path.dentry->d_inode); 519 + struct mqueue_inode_info *info = MQUEUE_I(file_inode(filp)); 520 520 int retval = 0; 521 521 522 522 poll_wait(filp, &info->wait_q, poll_tab); ··· 973 973 goto out; 974 974 } 975 975 976 - inode = f.file->f_path.dentry->d_inode; 976 + inode = file_inode(f.file); 977 977 if (unlikely(f.file->f_op != &mqueue_file_operations)) { 978 978 ret = -EBADF; 979 979 goto out_fput; ··· 1089 1089 goto out; 1090 1090 } 1091 1091 1092 - inode = f.file->f_path.dentry->d_inode; 1092 + inode = file_inode(f.file); 1093 1093 if (unlikely(f.file->f_op != &mqueue_file_operations)) { 1094 1094 ret = -EBADF; 1095 1095 goto out_fput; ··· 1249 1249 goto out; 1250 1250 } 1251 1251 1252 - inode = f.file->f_path.dentry->d_inode; 1252 + inode = file_inode(f.file); 1253 1253 if (unlikely(f.file->f_op != &mqueue_file_operations)) { 1254 1254 ret = -EBADF; 1255 1255 goto out_fput; ··· 1323 1323 goto out; 1324 1324 } 1325 1325 1326 - inode = f.file->f_path.dentry->d_inode; 1326 + inode = file_inode(f.file); 1327 1327 if (unlikely(f.file->f_op != &mqueue_file_operations)) { 1328 1328 ret = -EBADF; 1329 1329 goto out_fput;
+4 -4
ipc/shm.c
··· 193 193 if (!is_file_hugepages(shp->shm_file)) 194 194 shmem_lock(shp->shm_file, 0, shp->mlock_user); 195 195 else if (shp->mlock_user) 196 - user_shm_unlock(shp->shm_file->f_path.dentry->d_inode->i_size, 196 + user_shm_unlock(file_inode(shp->shm_file)->i_size, 197 197 shp->mlock_user); 198 198 fput (shp->shm_file); 199 199 security_shm_free(shp); ··· 529 529 * shmid gets reported as "inode#" in /proc/pid/maps. 530 530 * proc-ps tools use this. Changing this will break them. 531 531 */ 532 - file->f_dentry->d_inode->i_ino = shp->shm_perm.id; 532 + file_inode(file)->i_ino = shp->shm_perm.id; 533 533 534 534 ns->shm_tot += numpages; 535 535 error = shp->shm_perm.id; ··· 678 678 { 679 679 struct inode *inode; 680 680 681 - inode = shp->shm_file->f_path.dentry->d_inode; 681 + inode = file_inode(shp->shm_file); 682 682 683 683 if (is_file_hugepages(shp->shm_file)) { 684 684 struct address_space *mapping = inode->i_mapping; ··· 1173 1173 (vma->vm_start - addr)/PAGE_SIZE == vma->vm_pgoff) { 1174 1174 1175 1175 1176 - size = vma->vm_file->f_path.dentry->d_inode->i_size; 1176 + size = file_inode(vma->vm_file)->i_size; 1177 1177 do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start); 1178 1178 /* 1179 1179 * We discovered the size of the shm segment, so
+1 -1
kernel/acct.c
··· 205 205 if (IS_ERR(file)) 206 206 return PTR_ERR(file); 207 207 208 - if (!S_ISREG(file->f_path.dentry->d_inode->i_mode)) { 208 + if (!S_ISREG(file_inode(file)->i_mode)) { 209 209 filp_close(file, NULL); 210 210 return -EACCES; 211 211 }
+3 -3
kernel/cgroup.c
··· 2637 2637 */ 2638 2638 static inline struct cftype *__file_cft(struct file *file) 2639 2639 { 2640 - if (file->f_dentry->d_inode->i_fop != &cgroup_file_operations) 2640 + if (file_inode(file)->i_fop != &cgroup_file_operations) 2641 2641 return ERR_PTR(-EINVAL); 2642 2642 return __d_cft(file->f_dentry); 2643 2643 } ··· 3852 3852 3853 3853 /* the process need read permission on control file */ 3854 3854 /* AV: shouldn't we check that it's been opened for read instead? */ 3855 - ret = inode_permission(cfile->f_path.dentry->d_inode, MAY_READ); 3855 + ret = inode_permission(file_inode(cfile), MAY_READ); 3856 3856 if (ret < 0) 3857 3857 goto fail; 3858 3858 ··· 5441 5441 struct inode *inode; 5442 5442 struct cgroup_subsys_state *css; 5443 5443 5444 - inode = f->f_dentry->d_inode; 5444 + inode = file_inode(f); 5445 5445 /* check in cgroup filesystem dir */ 5446 5446 if (inode->i_op != &cgroup_dir_inode_operations) 5447 5447 return ERR_PTR(-EBADF);
+1 -1
kernel/events/core.c
··· 3682 3682 3683 3683 static int perf_fasync(int fd, struct file *filp, int on) 3684 3684 { 3685 - struct inode *inode = filp->f_path.dentry->d_inode; 3685 + struct inode *inode = file_inode(filp); 3686 3686 struct perf_event *event = filp->private_data; 3687 3687 int retval; 3688 3688
+1 -1
kernel/fork.c
··· 413 413 tmp->vm_next = tmp->vm_prev = NULL; 414 414 file = tmp->vm_file; 415 415 if (file) { 416 - struct inode *inode = file->f_path.dentry->d_inode; 416 + struct inode *inode = file_inode(file); 417 417 struct address_space *mapping = file->f_mapping; 418 418 419 419 get_file(file);
+1 -1
kernel/irq/proc.c
··· 76 76 static ssize_t write_irq_affinity(int type, struct file *file, 77 77 const char __user *buffer, size_t count, loff_t *pos) 78 78 { 79 - unsigned int irq = (int)(long)PDE(file->f_path.dentry->d_inode)->data; 79 + unsigned int irq = (int)(long)PDE(file_inode(file))->data; 80 80 cpumask_var_t new_value; 81 81 int err; 82 82
+1 -1
kernel/nsproxy.c
··· 251 251 return PTR_ERR(file); 252 252 253 253 err = -EINVAL; 254 - ei = PROC_I(file->f_dentry->d_inode); 254 + ei = PROC_I(file_inode(file)); 255 255 ops = ei->ns_ops; 256 256 if (nstype && (ops->type != nstype)) 257 257 goto out;
+2 -2
kernel/relay.c
··· 1139 1139 if (!desc->count) 1140 1140 return 0; 1141 1141 1142 - mutex_lock(&filp->f_path.dentry->d_inode->i_mutex); 1142 + mutex_lock(&file_inode(filp)->i_mutex); 1143 1143 do { 1144 1144 if (!relay_file_read_avail(buf, *ppos)) 1145 1145 break; ··· 1159 1159 *ppos = relay_file_read_end_pos(buf, read_start, ret); 1160 1160 } 1161 1161 } while (desc->count && ret); 1162 - mutex_unlock(&filp->f_path.dentry->d_inode->i_mutex); 1162 + mutex_unlock(&file_inode(filp)->i_mutex); 1163 1163 1164 1164 return desc->written; 1165 1165 }
+4 -4
kernel/sys.c
··· 1792 1792 static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd) 1793 1793 { 1794 1794 struct fd exe; 1795 - struct dentry *dentry; 1795 + struct inode *inode; 1796 1796 int err; 1797 1797 1798 1798 exe = fdget(fd); 1799 1799 if (!exe.file) 1800 1800 return -EBADF; 1801 1801 1802 - dentry = exe.file->f_path.dentry; 1802 + inode = file_inode(exe.file); 1803 1803 1804 1804 /* 1805 1805 * Because the original mm->exe_file points to executable file, make ··· 1807 1807 * overall picture. 1808 1808 */ 1809 1809 err = -EACCES; 1810 - if (!S_ISREG(dentry->d_inode->i_mode) || 1810 + if (!S_ISREG(inode->i_mode) || 1811 1811 exe.file->f_path.mnt->mnt_flags & MNT_NOEXEC) 1812 1812 goto exit; 1813 1813 1814 - err = inode_permission(dentry->d_inode, MAY_EXEC); 1814 + err = inode_permission(inode, MAY_EXEC); 1815 1815 if (err) 1816 1816 goto exit; 1817 1817
+1 -1
mm/fadvise.c
··· 38 38 if (!f.file) 39 39 return -EBADF; 40 40 41 - if (S_ISFIFO(f.file->f_path.dentry->d_inode->i_mode)) { 41 + if (S_ISFIFO(file_inode(f.file)->i_mode)) { 42 42 ret = -ESPIPE; 43 43 goto out; 44 44 }
+1 -1
mm/filemap.c
··· 1711 1711 int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) 1712 1712 { 1713 1713 struct page *page = vmf->page; 1714 - struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 1714 + struct inode *inode = file_inode(vma->vm_file); 1715 1715 int ret = VM_FAULT_LOCKED; 1716 1716 1717 1717 sb_start_pagefault(inode->i_sb);
+2 -2
mm/hugetlb.c
··· 127 127 128 128 static inline struct hugepage_subpool *subpool_vma(struct vm_area_struct *vma) 129 129 { 130 - return subpool_inode(vma->vm_file->f_dentry->d_inode); 130 + return subpool_inode(file_inode(vma->vm_file)); 131 131 } 132 132 133 133 /* ··· 2482 2482 address = address & huge_page_mask(h); 2483 2483 pgoff = ((address - vma->vm_start) >> PAGE_SHIFT) + 2484 2484 vma->vm_pgoff; 2485 - mapping = vma->vm_file->f_dentry->d_inode->i_mapping; 2485 + mapping = file_inode(vma->vm_file)->i_mapping; 2486 2486 2487 2487 /* 2488 2488 * Take the mapping lock for the duration of the table walk. As
+4 -4
mm/mmap.c
··· 202 202 struct file *file, struct address_space *mapping) 203 203 { 204 204 if (vma->vm_flags & VM_DENYWRITE) 205 - atomic_inc(&file->f_path.dentry->d_inode->i_writecount); 205 + atomic_inc(&file_inode(file)->i_writecount); 206 206 if (vma->vm_flags & VM_SHARED) 207 207 mapping->i_mmap_writable--; 208 208 ··· 567 567 struct address_space *mapping = file->f_mapping; 568 568 569 569 if (vma->vm_flags & VM_DENYWRITE) 570 - atomic_dec(&file->f_path.dentry->d_inode->i_writecount); 570 + atomic_dec(&file_inode(file)->i_writecount); 571 571 if (vma->vm_flags & VM_SHARED) 572 572 mapping->i_mmap_writable++; 573 573 ··· 1217 1217 return -EAGAIN; 1218 1218 } 1219 1219 1220 - inode = file ? file->f_path.dentry->d_inode : NULL; 1220 + inode = file ? file_inode(file) : NULL; 1221 1221 1222 1222 if (file) { 1223 1223 switch (flags & MAP_TYPE) { ··· 1403 1403 int error; 1404 1404 struct rb_node **rb_link, *rb_parent; 1405 1405 unsigned long charged = 0; 1406 - struct inode *inode = file ? file->f_path.dentry->d_inode : NULL; 1406 + struct inode *inode = file ? file_inode(file) : NULL; 1407 1407 1408 1408 /* Clear old maps */ 1409 1409 error = -ENOMEM;
+6 -6
mm/nommu.c
··· 941 941 */ 942 942 mapping = file->f_mapping; 943 943 if (!mapping) 944 - mapping = file->f_path.dentry->d_inode->i_mapping; 944 + mapping = file_inode(file)->i_mapping; 945 945 946 946 capabilities = 0; 947 947 if (mapping && mapping->backing_dev_info) ··· 950 950 if (!capabilities) { 951 951 /* no explicit capabilities set, so assume some 952 952 * defaults */ 953 - switch (file->f_path.dentry->d_inode->i_mode & S_IFMT) { 953 + switch (file_inode(file)->i_mode & S_IFMT) { 954 954 case S_IFREG: 955 955 case S_IFBLK: 956 956 capabilities = BDI_CAP_MAP_COPY; ··· 985 985 !(file->f_mode & FMODE_WRITE)) 986 986 return -EACCES; 987 987 988 - if (IS_APPEND(file->f_path.dentry->d_inode) && 988 + if (IS_APPEND(file_inode(file)) && 989 989 (file->f_mode & FMODE_WRITE)) 990 990 return -EACCES; 991 991 992 - if (locks_verify_locked(file->f_path.dentry->d_inode)) 992 + if (locks_verify_locked(file_inode(file))) 993 993 return -EAGAIN; 994 994 995 995 if (!(capabilities & BDI_CAP_MAP_DIRECT)) ··· 1322 1322 continue; 1323 1323 1324 1324 /* search for overlapping mappings on the same file */ 1325 - if (pregion->vm_file->f_path.dentry->d_inode != 1326 - file->f_path.dentry->d_inode) 1325 + if (file_inode(pregion->vm_file) != 1326 + file_inode(file)) 1327 1327 continue; 1328 1328 1329 1329 if (pregion->vm_pgoff >= pgend)
+6 -6
mm/shmem.c
··· 1295 1295 1296 1296 static int shmem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) 1297 1297 { 1298 - struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 1298 + struct inode *inode = file_inode(vma->vm_file); 1299 1299 int error; 1300 1300 int ret = VM_FAULT_LOCKED; 1301 1301 ··· 1313 1313 #ifdef CONFIG_NUMA 1314 1314 static int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *mpol) 1315 1315 { 1316 - struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 1316 + struct inode *inode = file_inode(vma->vm_file); 1317 1317 return mpol_set_shared_policy(&SHMEM_I(inode)->policy, vma, mpol); 1318 1318 } 1319 1319 1320 1320 static struct mempolicy *shmem_get_policy(struct vm_area_struct *vma, 1321 1321 unsigned long addr) 1322 1322 { 1323 - struct inode *inode = vma->vm_file->f_path.dentry->d_inode; 1323 + struct inode *inode = file_inode(vma->vm_file); 1324 1324 pgoff_t index; 1325 1325 1326 1326 index = ((addr - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; ··· 1330 1330 1331 1331 int shmem_lock(struct file *file, int lock, struct user_struct *user) 1332 1332 { 1333 - struct inode *inode = file->f_path.dentry->d_inode; 1333 + struct inode *inode = file_inode(file); 1334 1334 struct shmem_inode_info *info = SHMEM_I(inode); 1335 1335 int retval = -ENOMEM; 1336 1336 ··· 1465 1465 1466 1466 static void do_shmem_file_read(struct file *filp, loff_t *ppos, read_descriptor_t *desc, read_actor_t actor) 1467 1467 { 1468 - struct inode *inode = filp->f_path.dentry->d_inode; 1468 + struct inode *inode = file_inode(filp); 1469 1469 struct address_space *mapping = inode->i_mapping; 1470 1470 pgoff_t index; 1471 1471 unsigned long offset; ··· 1808 1808 static long shmem_fallocate(struct file *file, int mode, loff_t offset, 1809 1809 loff_t len) 1810 1810 { 1811 - struct inode *inode = file->f_path.dentry->d_inode; 1811 + struct inode *inode = file_inode(file); 1812 1812 struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb); 1813 1813 struct shmem_falloc shmem_falloc; 1814 1814 pgoff_t start, index, end;
+1 -1
mm/swapfile.c
··· 1699 1699 len = seq_path(swap, &file->f_path, " \t\n\\"); 1700 1700 seq_printf(swap, "%*s%s\t%u\t%u\t%d\n", 1701 1701 len < 40 ? 40 - len : 1, " ", 1702 - S_ISBLK(file->f_path.dentry->d_inode->i_mode) ? 1702 + S_ISBLK(file_inode(file)->i_mode) ? 1703 1703 "partition" : "file\t", 1704 1704 si->pages << (PAGE_SHIFT - 10), 1705 1705 si->inuse_pages << (PAGE_SHIFT - 10),
+1 -1
net/atm/proc.c
··· 385 385 page = get_zeroed_page(GFP_KERNEL); 386 386 if (!page) 387 387 return -ENOMEM; 388 - dev = PDE(file->f_path.dentry->d_inode)->data; 388 + dev = PDE(file_inode(file))->data; 389 389 if (!dev->ops->proc_read) 390 390 length = -EINVAL; 391 391 else {
+1 -1
net/core/net_namespace.c
··· 344 344 if (IS_ERR(file)) 345 345 return ERR_CAST(file); 346 346 347 - ei = PROC_I(file->f_dentry->d_inode); 347 + ei = PROC_I(file_inode(file)); 348 348 if (ei->ns_ops == &netns_operations) 349 349 net = get_net(ei->ns); 350 350 else
+1 -1
net/ipv4/netfilter/ipt_CLUSTERIP.c
··· 657 657 static ssize_t clusterip_proc_write(struct file *file, const char __user *input, 658 658 size_t size, loff_t *ofs) 659 659 { 660 - struct clusterip_config *c = PDE(file->f_path.dentry->d_inode)->data; 660 + struct clusterip_config *c = PDE(file_inode(file))->data; 661 661 #define PROC_WRITELEN 10 662 662 char buffer[PROC_WRITELEN+1]; 663 663 unsigned long nodenum;
+1 -1
net/netfilter/xt_recent.c
··· 540 540 recent_mt_proc_write(struct file *file, const char __user *input, 541 541 size_t size, loff_t *loff) 542 542 { 543 - const struct proc_dir_entry *pde = PDE(file->f_path.dentry->d_inode); 543 + const struct proc_dir_entry *pde = PDE(file_inode(file)); 544 544 struct recent_table *t = pde->data; 545 545 struct recent_entry *e; 546 546 char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")];
+1 -1
net/netlink/af_netlink.c
··· 809 809 810 810 struct sock *netlink_getsockbyfilp(struct file *filp) 811 811 { 812 - struct inode *inode = filp->f_path.dentry->d_inode; 812 + struct inode *inode = file_inode(filp); 813 813 struct sock *sock; 814 814 815 815 if (!S_ISSOCK(inode->i_mode))
+1 -1
net/sunrpc/auth_gss/auth_gss.c
··· 616 616 const void *p, *end; 617 617 void *buf; 618 618 struct gss_upcall_msg *gss_msg; 619 - struct rpc_pipe *pipe = RPC_I(filp->f_dentry->d_inode)->pipe; 619 + struct rpc_pipe *pipe = RPC_I(file_inode(filp))->pipe; 620 620 struct gss_cl_ctx *ctx; 621 621 uid_t uid; 622 622 ssize_t err = -EFBIG;
+14 -14
net/sunrpc/cache.c
··· 755 755 { 756 756 struct cache_reader *rp = filp->private_data; 757 757 struct cache_request *rq; 758 - struct inode *inode = filp->f_path.dentry->d_inode; 758 + struct inode *inode = file_inode(filp); 759 759 int err; 760 760 761 761 if (count == 0) ··· 886 886 struct cache_detail *cd) 887 887 { 888 888 struct address_space *mapping = filp->f_mapping; 889 - struct inode *inode = filp->f_path.dentry->d_inode; 889 + struct inode *inode = file_inode(filp); 890 890 ssize_t ret = -EINVAL; 891 891 892 892 if (!cd->cache_parse) ··· 1454 1454 static ssize_t cache_read_procfs(struct file *filp, char __user *buf, 1455 1455 size_t count, loff_t *ppos) 1456 1456 { 1457 - struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1457 + struct cache_detail *cd = PDE(file_inode(filp))->data; 1458 1458 1459 1459 return cache_read(filp, buf, count, ppos, cd); 1460 1460 } ··· 1462 1462 static ssize_t cache_write_procfs(struct file *filp, const char __user *buf, 1463 1463 size_t count, loff_t *ppos) 1464 1464 { 1465 - struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1465 + struct cache_detail *cd = PDE(file_inode(filp))->data; 1466 1466 1467 1467 return cache_write(filp, buf, count, ppos, cd); 1468 1468 } 1469 1469 1470 1470 static unsigned int cache_poll_procfs(struct file *filp, poll_table *wait) 1471 1471 { 1472 - struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1472 + struct cache_detail *cd = PDE(file_inode(filp))->data; 1473 1473 1474 1474 return cache_poll(filp, wait, cd); 1475 1475 } ··· 1477 1477 static long cache_ioctl_procfs(struct file *filp, 1478 1478 unsigned int cmd, unsigned long arg) 1479 1479 { 1480 - struct inode *inode = filp->f_path.dentry->d_inode; 1480 + struct inode *inode = file_inode(filp); 1481 1481 struct cache_detail *cd = PDE(inode)->data; 1482 1482 1483 1483 return cache_ioctl(inode, filp, cmd, arg, cd); ··· 1546 1546 static ssize_t read_flush_procfs(struct file *filp, char __user *buf, 1547 1547 size_t count, loff_t *ppos) 1548 1548 { 1549 - struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1549 + struct cache_detail *cd = PDE(file_inode(filp))->data; 1550 1550 1551 1551 return read_flush(filp, buf, count, ppos, cd); 1552 1552 } ··· 1555 1555 const char __user *buf, 1556 1556 size_t count, loff_t *ppos) 1557 1557 { 1558 - struct cache_detail *cd = PDE(filp->f_path.dentry->d_inode)->data; 1558 + struct cache_detail *cd = PDE(file_inode(filp))->data; 1559 1559 1560 1560 return write_flush(filp, buf, count, ppos, cd); 1561 1561 } ··· 1686 1686 static ssize_t cache_read_pipefs(struct file *filp, char __user *buf, 1687 1687 size_t count, loff_t *ppos) 1688 1688 { 1689 - struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1689 + struct cache_detail *cd = RPC_I(file_inode(filp))->private; 1690 1690 1691 1691 return cache_read(filp, buf, count, ppos, cd); 1692 1692 } ··· 1694 1694 static ssize_t cache_write_pipefs(struct file *filp, const char __user *buf, 1695 1695 size_t count, loff_t *ppos) 1696 1696 { 1697 - struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1697 + struct cache_detail *cd = RPC_I(file_inode(filp))->private; 1698 1698 1699 1699 return cache_write(filp, buf, count, ppos, cd); 1700 1700 } 1701 1701 1702 1702 static unsigned int cache_poll_pipefs(struct file *filp, poll_table *wait) 1703 1703 { 1704 - struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1704 + struct cache_detail *cd = RPC_I(file_inode(filp))->private; 1705 1705 1706 1706 return cache_poll(filp, wait, cd); 1707 1707 } ··· 1709 1709 static long cache_ioctl_pipefs(struct file *filp, 1710 1710 unsigned int cmd, unsigned long arg) 1711 1711 { 1712 - struct inode *inode = filp->f_dentry->d_inode; 1712 + struct inode *inode = file_inode(filp); 1713 1713 struct cache_detail *cd = RPC_I(inode)->private; 1714 1714 1715 1715 return cache_ioctl(inode, filp, cmd, arg, cd); ··· 1778 1778 static ssize_t read_flush_pipefs(struct file *filp, char __user *buf, 1779 1779 size_t count, loff_t *ppos) 1780 1780 { 1781 - struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1781 + struct cache_detail *cd = RPC_I(file_inode(filp))->private; 1782 1782 1783 1783 return read_flush(filp, buf, count, ppos, cd); 1784 1784 } ··· 1787 1787 const char __user *buf, 1788 1788 size_t count, loff_t *ppos) 1789 1789 { 1790 - struct cache_detail *cd = RPC_I(filp->f_path.dentry->d_inode)->private; 1790 + struct cache_detail *cd = RPC_I(file_inode(filp))->private; 1791 1791 1792 1792 return write_flush(filp, buf, count, ppos, cd); 1793 1793 }
+5 -5
net/sunrpc/rpc_pipe.c
··· 284 284 static ssize_t 285 285 rpc_pipe_read(struct file *filp, char __user *buf, size_t len, loff_t *offset) 286 286 { 287 - struct inode *inode = filp->f_path.dentry->d_inode; 287 + struct inode *inode = file_inode(filp); 288 288 struct rpc_pipe *pipe; 289 289 struct rpc_pipe_msg *msg; 290 290 int res = 0; ··· 328 328 static ssize_t 329 329 rpc_pipe_write(struct file *filp, const char __user *buf, size_t len, loff_t *offset) 330 330 { 331 - struct inode *inode = filp->f_path.dentry->d_inode; 331 + struct inode *inode = file_inode(filp); 332 332 int res; 333 333 334 334 mutex_lock(&inode->i_mutex); ··· 342 342 static unsigned int 343 343 rpc_pipe_poll(struct file *filp, struct poll_table_struct *wait) 344 344 { 345 - struct inode *inode = filp->f_path.dentry->d_inode; 345 + struct inode *inode = file_inode(filp); 346 346 struct rpc_inode *rpci = RPC_I(inode); 347 347 unsigned int mask = POLLOUT | POLLWRNORM; 348 348 ··· 360 360 static long 361 361 rpc_pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 362 362 { 363 - struct inode *inode = filp->f_path.dentry->d_inode; 363 + struct inode *inode = file_inode(filp); 364 364 struct rpc_pipe *pipe; 365 365 int len; 366 366 ··· 830 830 * responses to upcalls. They will result in calls to @msg->downcall. 831 831 * 832 832 * The @private argument passed here will be available to all these methods 833 - * from the file pointer, via RPC_I(file->f_dentry->d_inode)->private. 833 + * from the file pointer, via RPC_I(file_inode(file))->private. 834 834 */ 835 835 struct dentry *rpc_mkpipe_dentry(struct dentry *parent, const char *name, 836 836 void *private, struct rpc_pipe *pipe)
+1 -1
net/unix/garbage.c
··· 99 99 struct sock *unix_get_socket(struct file *filp) 100 100 { 101 101 struct sock *u_sock = NULL; 102 - struct inode *inode = filp->f_path.dentry->d_inode; 102 + struct inode *inode = file_inode(filp); 103 103 104 104 /* 105 105 * Socket ?
+2 -2
security/apparmor/domain.c
··· 349 349 unsigned int state; 350 350 struct file_perms perms = {}; 351 351 struct path_cond cond = { 352 - bprm->file->f_path.dentry->d_inode->i_uid, 353 - bprm->file->f_path.dentry->d_inode->i_mode 352 + file_inode(bprm->file)->i_uid, 353 + file_inode(bprm->file)->i_mode 354 354 }; 355 355 const char *name = NULL, *target = NULL, *info = NULL; 356 356 int error = cap_bprm_set_creds(bprm);
+2 -2
security/apparmor/file.c
··· 449 449 u32 request) 450 450 { 451 451 struct path_cond cond = { 452 - .uid = file->f_path.dentry->d_inode->i_uid, 453 - .mode = file->f_path.dentry->d_inode->i_mode 452 + .uid = file_inode(file)->i_uid, 453 + .mode = file_inode(file)->i_mode 454 454 }; 455 455 456 456 return aa_path_perm(op, profile, &file->f_path, PATH_DELEGATE_DELETED,
+3 -3
security/apparmor/lsm.c
··· 379 379 struct aa_profile *profile; 380 380 int error = 0; 381 381 382 - if (!mediated_filesystem(file->f_path.dentry->d_inode)) 382 + if (!mediated_filesystem(file_inode(file))) 383 383 return 0; 384 384 385 385 /* If in exec, permission is handled by bprm hooks. ··· 394 394 395 395 profile = aa_cred_profile(cred); 396 396 if (!unconfined(profile)) { 397 - struct inode *inode = file->f_path.dentry->d_inode; 397 + struct inode *inode = file_inode(file); 398 398 struct path_cond cond = { inode->i_uid, inode->i_mode }; 399 399 400 400 error = aa_path_perm(OP_OPEN, profile, &file->f_path, 0, ··· 432 432 BUG_ON(!fprofile); 433 433 434 434 if (!file->f_path.mnt || 435 - !mediated_filesystem(file->f_path.dentry->d_inode)) 435 + !mediated_filesystem(file_inode(file))) 436 436 return 0; 437 437 438 438 profile = __aa_current_profile();
+3 -3
security/integrity/ima/ima_api.c
··· 140 140 int ima_collect_measurement(struct integrity_iint_cache *iint, 141 141 struct file *file) 142 142 { 143 - struct inode *inode = file->f_dentry->d_inode; 143 + struct inode *inode = file_inode(file); 144 144 const char *filename = file->f_dentry->d_name.name; 145 145 int result = 0; 146 146 147 147 if (!(iint->flags & IMA_COLLECTED)) { 148 - u64 i_version = file->f_dentry->d_inode->i_version; 148 + u64 i_version = file_inode(file)->i_version; 149 149 150 150 iint->ima_xattr.type = IMA_XATTR_DIGEST; 151 151 result = ima_calc_hash(file, iint->ima_xattr.digest); ··· 182 182 const char *op = "add_template_measure"; 183 183 const char *audit_cause = "ENOMEM"; 184 184 int result = -ENOMEM; 185 - struct inode *inode = file->f_dentry->d_inode; 185 + struct inode *inode = file_inode(file); 186 186 struct ima_template_entry *entry; 187 187 int violation = 0; 188 188
+1 -1
security/integrity/ima/ima_crypto.c
··· 63 63 file->f_mode |= FMODE_READ; 64 64 read = 1; 65 65 } 66 - i_size = i_size_read(file->f_dentry->d_inode); 66 + i_size = i_size_read(file_inode(file)); 67 67 while (offset < i_size) { 68 68 int rbuf_len; 69 69
+2 -2
security/integrity/ima/ima_main.c
··· 132 132 */ 133 133 void ima_file_free(struct file *file) 134 134 { 135 - struct inode *inode = file->f_dentry->d_inode; 135 + struct inode *inode = file_inode(file); 136 136 struct integrity_iint_cache *iint; 137 137 138 138 if (!iint_initialized || !S_ISREG(inode->i_mode)) ··· 148 148 static int process_measurement(struct file *file, const unsigned char *filename, 149 149 int mask, int function) 150 150 { 151 - struct inode *inode = file->f_dentry->d_inode; 151 + struct inode *inode = file_inode(file); 152 152 struct integrity_iint_cache *iint; 153 153 unsigned char *pathname = NULL, *pathbuf = NULL; 154 154 int rc = -ENOMEM, action, must_appraise;
+5 -5
security/selinux/hooks.c
··· 1528 1528 u32 av) 1529 1529 { 1530 1530 struct file_security_struct *fsec = file->f_security; 1531 - struct inode *inode = file->f_path.dentry->d_inode; 1531 + struct inode *inode = file_inode(file); 1532 1532 struct common_audit_data ad; 1533 1533 u32 sid = cred_sid(cred); 1534 1534 int rc; ··· 1957 1957 struct task_security_struct *new_tsec; 1958 1958 struct inode_security_struct *isec; 1959 1959 struct common_audit_data ad; 1960 - struct inode *inode = bprm->file->f_path.dentry->d_inode; 1960 + struct inode *inode = file_inode(bprm->file); 1961 1961 int rc; 1962 1962 1963 1963 rc = cap_bprm_set_creds(bprm); ··· 2929 2929 static int selinux_revalidate_file_permission(struct file *file, int mask) 2930 2930 { 2931 2931 const struct cred *cred = current_cred(); 2932 - struct inode *inode = file->f_path.dentry->d_inode; 2932 + struct inode *inode = file_inode(file); 2933 2933 2934 2934 /* file_mask_to_av won't add FILE__WRITE if MAY_APPEND is set */ 2935 2935 if ((file->f_flags & O_APPEND) && (mask & MAY_WRITE)) ··· 2941 2941 2942 2942 static int selinux_file_permission(struct file *file, int mask) 2943 2943 { 2944 - struct inode *inode = file->f_path.dentry->d_inode; 2944 + struct inode *inode = file_inode(file); 2945 2945 struct file_security_struct *fsec = file->f_security; 2946 2946 struct inode_security_struct *isec = inode->i_security; 2947 2947 u32 sid = current_sid(); ··· 3218 3218 struct inode_security_struct *isec; 3219 3219 3220 3220 fsec = file->f_security; 3221 - isec = file->f_path.dentry->d_inode->i_security; 3221 + isec = file_inode(file)->i_security; 3222 3222 /* 3223 3223 * Save inode label and policy sequence number 3224 3224 * at open-time so that selinux_file_permission
+8 -12
security/selinux/selinuxfs.c
··· 202 202 { 203 203 char tmpbuf[TMPBUFLEN]; 204 204 ssize_t length; 205 - ino_t ino = filp->f_path.dentry->d_inode->i_ino; 205 + ino_t ino = file_inode(filp)->i_ino; 206 206 int handle_unknown = (ino == SEL_REJECT_UNKNOWN) ? 207 207 security_get_reject_unknown() : !security_get_allow_unknown(); 208 208 ··· 671 671 672 672 static ssize_t selinux_transaction_write(struct file *file, const char __user *buf, size_t size, loff_t *pos) 673 673 { 674 - ino_t ino = file->f_path.dentry->d_inode->i_ino; 674 + ino_t ino = file_inode(file)->i_ino; 675 675 char *data; 676 676 ssize_t rv; 677 677 ··· 1042 1042 ssize_t length; 1043 1043 ssize_t ret; 1044 1044 int cur_enforcing; 1045 - struct inode *inode = filep->f_path.dentry->d_inode; 1046 - unsigned index = inode->i_ino & SEL_INO_MASK; 1045 + unsigned index = file_inode(filep)->i_ino & SEL_INO_MASK; 1047 1046 const char *name = filep->f_path.dentry->d_name.name; 1048 1047 1049 1048 mutex_lock(&sel_mutex); ··· 1076 1077 char *page = NULL; 1077 1078 ssize_t length; 1078 1079 int new_value; 1079 - struct inode *inode = filep->f_path.dentry->d_inode; 1080 - unsigned index = inode->i_ino & SEL_INO_MASK; 1080 + unsigned index = file_inode(filep)->i_ino & SEL_INO_MASK; 1081 1081 const char *name = filep->f_path.dentry->d_name.name; 1082 1082 1083 1083 mutex_lock(&sel_mutex); ··· 1484 1486 static ssize_t sel_read_initcon(struct file *file, char __user *buf, 1485 1487 size_t count, loff_t *ppos) 1486 1488 { 1487 - struct inode *inode; 1488 1489 char *con; 1489 1490 u32 sid, len; 1490 1491 ssize_t ret; 1491 1492 1492 - inode = file->f_path.dentry->d_inode; 1493 - sid = inode->i_ino&SEL_INO_MASK; 1493 + sid = file_inode(file)->i_ino&SEL_INO_MASK; 1494 1494 ret = security_sid_to_context(sid, &con, &len); 1495 1495 if (ret) 1496 1496 return ret; ··· 1549 1553 static ssize_t sel_read_class(struct file *file, char __user *buf, 1550 1554 size_t count, loff_t *ppos) 1551 1555 { 1552 - unsigned long ino = file->f_path.dentry->d_inode->i_ino; 1556 + unsigned long ino = file_inode(file)->i_ino; 1553 1557 char res[TMPBUFLEN]; 1554 1558 ssize_t len = snprintf(res, sizeof(res), "%d", sel_ino_to_class(ino)); 1555 1559 return simple_read_from_buffer(buf, count, ppos, res, len); ··· 1563 1567 static ssize_t sel_read_perm(struct file *file, char __user *buf, 1564 1568 size_t count, loff_t *ppos) 1565 1569 { 1566 - unsigned long ino = file->f_path.dentry->d_inode->i_ino; 1570 + unsigned long ino = file_inode(file)->i_ino; 1567 1571 char res[TMPBUFLEN]; 1568 1572 ssize_t len = snprintf(res, sizeof(res), "%d", sel_ino_to_perm(ino)); 1569 1573 return simple_read_from_buffer(buf, count, ppos, res, len); ··· 1580 1584 int value; 1581 1585 char tmpbuf[TMPBUFLEN]; 1582 1586 ssize_t length; 1583 - unsigned long i_ino = file->f_path.dentry->d_inode->i_ino; 1587 + unsigned long i_ino = file_inode(file)->i_ino; 1584 1588 1585 1589 value = security_policycap_supported(i_ino & SEL_INO_MASK); 1586 1590 length = scnprintf(tmpbuf, TMPBUFLEN, "%d", value);
+4 -10
security/smack/smack_lsm.c
··· 456 456 */ 457 457 static int smack_bprm_set_creds(struct linux_binprm *bprm) 458 458 { 459 - struct inode *inode = bprm->file->f_path.dentry->d_inode; 459 + struct inode *inode = file_inode(bprm->file); 460 460 struct task_smack *bsp = bprm->cred->security; 461 461 struct inode_smack *isp; 462 462 int rc; ··· 1187 1187 char *msmack; 1188 1188 char *osmack; 1189 1189 struct inode_smack *isp; 1190 - struct dentry *dp; 1191 1190 int may; 1192 1191 int mmay; 1193 1192 int tmay; 1194 1193 int rc; 1195 1194 1196 - if (file == NULL || file->f_dentry == NULL) 1195 + if (file == NULL) 1197 1196 return 0; 1198 1197 1199 - dp = file->f_dentry; 1200 - 1201 - if (dp->d_inode == NULL) 1202 - return 0; 1203 - 1204 - isp = dp->d_inode->i_security; 1198 + isp = file_inode(file)->i_security; 1205 1199 if (isp->smk_mmap == NULL) 1206 1200 return 0; 1207 1201 msmack = isp->smk_mmap; ··· 1353 1359 */ 1354 1360 static int smack_file_open(struct file *file, const struct cred *cred) 1355 1361 { 1356 - struct inode_smack *isp = file->f_path.dentry->d_inode->i_security; 1362 + struct inode_smack *isp = file_inode(file)->i_security; 1357 1363 1358 1364 file->f_security = isp->smk_inode; 1359 1365
+1 -1
security/tomoyo/securityfs_if.c
··· 135 135 */ 136 136 static int tomoyo_open(struct inode *inode, struct file *file) 137 137 { 138 - const int key = ((u8 *) file->f_path.dentry->d_inode->i_private) 138 + const int key = ((u8 *) file_inode(file)->i_private) 139 139 - ((u8 *) NULL); 140 140 return tomoyo_open_control(key, file); 141 141 }
+1 -1
sound/core/info.c
··· 496 496 497 497 static int snd_info_entry_mmap(struct file *file, struct vm_area_struct *vma) 498 498 { 499 - struct inode *inode = file->f_path.dentry->d_inode; 499 + struct inode *inode = file_inode(file); 500 500 struct snd_info_private_data *data; 501 501 struct snd_info_entry *entry; 502 502
+1 -1
sound/core/pcm_native.c
··· 1586 1586 file = fget_light(fd, fput_needed); 1587 1587 if (!file) 1588 1588 return NULL; 1589 - inode = file->f_path.dentry->d_inode; 1589 + inode = file_inode(file); 1590 1590 if (!S_ISCHR(inode->i_mode) || 1591 1591 imajor(inode) != snd_major) { 1592 1592 fput_light(file, *fput_needed);
+3 -3
sound/oss/msnd_pinnacle.c
··· 642 642 643 643 static long dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 644 644 { 645 - int minor = iminor(file->f_path.dentry->d_inode); 645 + int minor = iminor(file_inode(file)); 646 646 int ret; 647 647 648 648 if (cmd == OSS_GETVERSION) { ··· 1012 1012 1013 1013 static ssize_t dev_read(struct file *file, char __user *buf, size_t count, loff_t *off) 1014 1014 { 1015 - int minor = iminor(file->f_path.dentry->d_inode); 1015 + int minor = iminor(file_inode(file)); 1016 1016 if (minor == dev.dsp_minor) 1017 1017 return dsp_read(buf, count); 1018 1018 else ··· 1021 1021 1022 1022 static ssize_t dev_write(struct file *file, const char __user *buf, size_t count, loff_t *off) 1023 1023 { 1024 - int minor = iminor(file->f_path.dentry->d_inode); 1024 + int minor = iminor(file_inode(file)); 1025 1025 if (minor == dev.dsp_minor) 1026 1026 return dsp_write(buf, count); 1027 1027 else
+5 -5
sound/oss/soundcard.c
··· 143 143 144 144 static ssize_t sound_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) 145 145 { 146 - int dev = iminor(file->f_path.dentry->d_inode); 146 + int dev = iminor(file_inode(file)); 147 147 int ret = -EINVAL; 148 148 149 149 /* ··· 176 176 177 177 static ssize_t sound_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) 178 178 { 179 - int dev = iminor(file->f_path.dentry->d_inode); 179 + int dev = iminor(file_inode(file)); 180 180 int ret = -EINVAL; 181 181 182 182 mutex_lock(&soundcard_mutex); ··· 333 333 static long sound_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 334 334 { 335 335 int len = 0, dtype; 336 - int dev = iminor(file->f_dentry->d_inode); 336 + int dev = iminor(file_inode(file)); 337 337 long ret = -EINVAL; 338 338 void __user *p = (void __user *)arg; 339 339 ··· 406 406 407 407 static unsigned int sound_poll(struct file *file, poll_table * wait) 408 408 { 409 - struct inode *inode = file->f_path.dentry->d_inode; 409 + struct inode *inode = file_inode(file); 410 410 int dev = iminor(inode); 411 411 412 412 DEB(printk("sound_poll(dev=%d)\n", dev)); ··· 431 431 int dev_class; 432 432 unsigned long size; 433 433 struct dma_buffparms *dmap = NULL; 434 - int dev = iminor(file->f_path.dentry->d_inode); 434 + int dev = iminor(file_inode(file)); 435 435 436 436 dev_class = dev & 0x0f; 437 437 dev >>= 4;
+1 -1
sound/sound_firmware.c
··· 19 19 printk(KERN_INFO "Unable to load '%s'.\n", fn); 20 20 return 0; 21 21 } 22 - l = i_size_read(filp->f_path.dentry->d_inode); 22 + l = i_size_read(file_inode(filp)); 23 23 if (l <= 0 || l > 131072) 24 24 { 25 25 printk(KERN_INFO "Invalid firmware '%s'\n", fn);