diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-01-23 17:07:38 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-22 23:31:31 -0500 |
commit | 496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch) | |
tree | 8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /drivers/usb | |
parent | 57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff) |
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/devices.c | 4 | ||||
-rw-r--r-- | drivers/usb/core/devio.c | 6 | ||||
-rw-r--r-- | drivers/usb/gadget/atmel_usba_udc.c | 8 | ||||
-rw-r--r-- | drivers/usb/gadget/f_mass_storage.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/printer.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/rndis.c | 2 | ||||
-rw-r--r-- | drivers/usb/gadget/storage_common.c | 2 |
7 files changed, 13 insertions, 13 deletions
diff --git a/drivers/usb/core/devices.c b/drivers/usb/core/devices.c index cbacea933b18..2c42e06f9717 100644 --- a/drivers/usb/core/devices.c +++ b/drivers/usb/core/devices.c | |||
@@ -658,7 +658,7 @@ static loff_t usb_device_lseek(struct file *file, loff_t offset, int orig) | |||
658 | { | 658 | { |
659 | loff_t ret; | 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 | switch (orig) { | 663 | switch (orig) { |
664 | case 0: | 664 | case 0: |
@@ -674,7 +674,7 @@ static loff_t usb_device_lseek(struct file *file, loff_t offset, int orig) | |||
674 | ret = -EINVAL; | 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 | return ret; | 678 | return ret; |
679 | } | 679 | } |
680 | 680 | ||
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index b78fbe222b72..6e8af6ddb5f7 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -160,7 +160,7 @@ static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig) | |||
160 | { | 160 | { |
161 | loff_t ret; | 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 | switch (orig) { | 165 | switch (orig) { |
166 | case 0: | 166 | case 0: |
@@ -176,7 +176,7 @@ static loff_t usbdev_lseek(struct file *file, loff_t offset, int orig) | |||
176 | ret = -EINVAL; | 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 | return ret; | 180 | return ret; |
181 | } | 181 | } |
182 | 182 | ||
@@ -1970,7 +1970,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, | |||
1970 | void __user *p) | 1970 | void __user *p) |
1971 | { | 1971 | { |
1972 | struct dev_state *ps = file->private_data; | 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 | struct usb_device *dev = ps->dev; | 1974 | struct usb_device *dev = ps->dev; |
1975 | int ret = -ENOTTY; | 1975 | int ret = -ENOTTY; |
1976 | 1976 | ||
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index a7aed84d98c9..fd49dba53613 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c | |||
@@ -93,7 +93,7 @@ static ssize_t queue_dbg_read(struct file *file, char __user *buf, | |||
93 | if (!access_ok(VERIFY_WRITE, buf, nbytes)) | 93 | if (!access_ok(VERIFY_WRITE, buf, nbytes)) |
94 | return -EFAULT; | 94 | return -EFAULT; |
95 | 95 | ||
96 | mutex_lock(&file->f_dentry->d_inode->i_mutex); | 96 | mutex_lock(&file_inode(file)->i_mutex); |
97 | list_for_each_entry_safe(req, tmp_req, queue, queue) { | 97 | list_for_each_entry_safe(req, tmp_req, queue, queue) { |
98 | len = snprintf(tmpbuf, sizeof(tmpbuf), | 98 | len = snprintf(tmpbuf, sizeof(tmpbuf), |
99 | "%8p %08x %c%c%c %5d %c%c%c\n", | 99 | "%8p %08x %c%c%c %5d %c%c%c\n", |
@@ -120,7 +120,7 @@ static ssize_t queue_dbg_read(struct file *file, char __user *buf, | |||
120 | nbytes -= len; | 120 | nbytes -= len; |
121 | buf += len; | 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 | return actual; | 125 | return actual; |
126 | } | 126 | } |
@@ -168,13 +168,13 @@ out: | |||
168 | static ssize_t regs_dbg_read(struct file *file, char __user *buf, | 168 | static ssize_t regs_dbg_read(struct file *file, char __user *buf, |
169 | size_t nbytes, loff_t *ppos) | 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 | int ret; | 172 | int ret; |
173 | 173 | ||
174 | mutex_lock(&inode->i_mutex); | 174 | mutex_lock(&inode->i_mutex); |
175 | ret = simple_read_from_buffer(buf, nbytes, ppos, | 175 | ret = simple_read_from_buffer(buf, nbytes, ppos, |
176 | file->private_data, | 176 | file->private_data, |
177 | file->f_dentry->d_inode->i_size); | 177 | file_inode(file)->i_size); |
178 | mutex_unlock(&inode->i_mutex); | 178 | mutex_unlock(&inode->i_mutex); |
179 | 179 | ||
180 | return ret; | 180 | return ret; |
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 5d027b3e1ef0..50a46a429efb 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c | |||
@@ -992,7 +992,7 @@ static int do_synchronize_cache(struct fsg_common *common) | |||
992 | static void invalidate_sub(struct fsg_lun *curlun) | 992 | static void invalidate_sub(struct fsg_lun *curlun) |
993 | { | 993 | { |
994 | struct file *filp = curlun->filp; | 994 | struct file *filp = curlun->filp; |
995 | struct inode *inode = filp->f_path.dentry->d_inode; | 995 | struct inode *inode = file_inode(filp); |
996 | unsigned long rc; | 996 | unsigned long rc; |
997 | 997 | ||
998 | rc = invalidate_mapping_pages(inode->i_mapping, 0, -1); | 998 | rc = invalidate_mapping_pages(inode->i_mapping, 0, -1); |
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c index 35bcc83d1e04..bf7a56b6d48a 100644 --- a/drivers/usb/gadget/printer.c +++ b/drivers/usb/gadget/printer.c | |||
@@ -688,7 +688,7 @@ static int | |||
688 | printer_fsync(struct file *fd, loff_t start, loff_t end, int datasync) | 688 | printer_fsync(struct file *fd, loff_t start, loff_t end, int datasync) |
689 | { | 689 | { |
690 | struct printer_dev *dev = fd->private_data; | 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 | unsigned long flags; | 692 | unsigned long flags; |
693 | int tx_list_empty; | 693 | int tx_list_empty; |
694 | 694 | ||
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c index e4192b887de9..d9297eebbf73 100644 --- a/drivers/usb/gadget/rndis.c +++ b/drivers/usb/gadget/rndis.c | |||
@@ -1065,7 +1065,7 @@ static int rndis_proc_show(struct seq_file *m, void *v) | |||
1065 | static ssize_t rndis_proc_write(struct file *file, const char __user *buffer, | 1065 | static ssize_t rndis_proc_write(struct file *file, const char __user *buffer, |
1066 | size_t count, loff_t *ppos) | 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 | u32 speed = 0; | 1069 | u32 speed = 0; |
1070 | int i, fl_speed = 0; | 1070 | int i, fl_speed = 0; |
1071 | 1071 | ||
diff --git a/drivers/usb/gadget/storage_common.c b/drivers/usb/gadget/storage_common.c index 0e3ae43454a2..b5d3f0eeeb7d 100644 --- a/drivers/usb/gadget/storage_common.c +++ b/drivers/usb/gadget/storage_common.c | |||
@@ -501,7 +501,7 @@ static int fsg_lun_open(struct fsg_lun *curlun, const char *filename) | |||
501 | if (!(filp->f_mode & FMODE_WRITE)) | 501 | if (!(filp->f_mode & FMODE_WRITE)) |
502 | ro = 1; | 502 | ro = 1; |
503 | 503 | ||
504 | inode = filp->f_path.dentry->d_inode; | 504 | inode = file_inode(filp); |
505 | if ((!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) { | 505 | if ((!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))) { |
506 | LINFO(curlun, "invalid file type: %s\n", filename); | 506 | LINFO(curlun, "invalid file type: %s\n", filename); |
507 | goto out; | 507 | goto out; |