Commit 33cb8994 authored by Josef Sipek's avatar Josef Sipek Committed by Linus Torvalds

[PATCH] struct path: convert usb

Signed-off-by: default avatarJosef Sipek <jsipek@fsl.cs.sunysb.edu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 592ccbf9
...@@ -379,7 +379,7 @@ static loff_t default_file_lseek (struct file *file, loff_t offset, int orig) ...@@ -379,7 +379,7 @@ static loff_t default_file_lseek (struct file *file, loff_t offset, int orig)
{ {
loff_t retval = -EINVAL; loff_t retval = -EINVAL;
mutex_lock(&file->f_dentry->d_inode->i_mutex); mutex_lock(&file->f_path.dentry->d_inode->i_mutex);
switch(orig) { switch(orig) {
case 0: case 0:
if (offset > 0) { if (offset > 0) {
...@@ -396,7 +396,7 @@ static loff_t default_file_lseek (struct file *file, loff_t offset, int orig) ...@@ -396,7 +396,7 @@ static loff_t default_file_lseek (struct file *file, loff_t offset, int orig)
default: default:
break; break;
} }
mutex_unlock(&file->f_dentry->d_inode->i_mutex); mutex_unlock(&file->f_path.dentry->d_inode->i_mutex);
return retval; return retval;
} }
......
...@@ -1909,10 +1909,10 @@ static int fsync_sub(struct lun *curlun) ...@@ -1909,10 +1909,10 @@ static int fsync_sub(struct lun *curlun)
if (!filp->f_op->fsync) if (!filp->f_op->fsync)
return -EINVAL; return -EINVAL;
inode = filp->f_dentry->d_inode; inode = filp->f_path.dentry->d_inode;
mutex_lock(&inode->i_mutex); mutex_lock(&inode->i_mutex);
rc = filemap_fdatawrite(inode->i_mapping); rc = filemap_fdatawrite(inode->i_mapping);
err = filp->f_op->fsync(filp, filp->f_dentry, 1); err = filp->f_op->fsync(filp, filp->f_path.dentry, 1);
if (!rc) if (!rc)
rc = err; rc = err;
err = filemap_fdatawait(inode->i_mapping); err = filemap_fdatawait(inode->i_mapping);
...@@ -1950,7 +1950,7 @@ static int do_synchronize_cache(struct fsg_dev *fsg) ...@@ -1950,7 +1950,7 @@ static int do_synchronize_cache(struct fsg_dev *fsg)
static void invalidate_sub(struct lun *curlun) static void invalidate_sub(struct lun *curlun)
{ {
struct file *filp = curlun->filp; struct file *filp = curlun->filp;
struct inode *inode = filp->f_dentry->d_inode; struct inode *inode = filp->f_path.dentry->d_inode;
unsigned long rc; unsigned long rc;
rc = invalidate_inode_pages(inode->i_mapping); rc = invalidate_inode_pages(inode->i_mapping);
...@@ -3526,8 +3526,8 @@ static int open_backing_file(struct lun *curlun, const char *filename) ...@@ -3526,8 +3526,8 @@ static int open_backing_file(struct lun *curlun, const char *filename)
if (!(filp->f_mode & FMODE_WRITE)) if (!(filp->f_mode & FMODE_WRITE))
ro = 1; ro = 1;
if (filp->f_dentry) if (filp->f_path.dentry)
inode = filp->f_dentry->d_inode; inode = filp->f_path.dentry->d_inode;
if (inode && S_ISBLK(inode->i_mode)) { if (inode && S_ISBLK(inode->i_mode)) {
if (bdev_read_only(inode->i_bdev)) if (bdev_read_only(inode->i_bdev))
ro = 1; ro = 1;
...@@ -3606,7 +3606,7 @@ static ssize_t show_file(struct device *dev, struct device_attribute *attr, char ...@@ -3606,7 +3606,7 @@ static ssize_t show_file(struct device *dev, struct device_attribute *attr, char
down_read(&fsg->filesem); down_read(&fsg->filesem);
if (backing_file_is_open(curlun)) { // Get the complete pathname if (backing_file_is_open(curlun)) { // Get the complete pathname
p = d_path(curlun->filp->f_dentry, curlun->filp->f_vfsmnt, p = d_path(curlun->filp->f_path.dentry, curlun->filp->f_path.mnt,
buf, PAGE_SIZE - 1); buf, PAGE_SIZE - 1);
if (IS_ERR(p)) if (IS_ERR(p))
rc = PTR_ERR(p); rc = PTR_ERR(p);
...@@ -4030,8 +4030,8 @@ static int __init fsg_bind(struct usb_gadget *gadget) ...@@ -4030,8 +4030,8 @@ static int __init fsg_bind(struct usb_gadget *gadget)
if (backing_file_is_open(curlun)) { if (backing_file_is_open(curlun)) {
p = NULL; p = NULL;
if (pathbuf) { if (pathbuf) {
p = d_path(curlun->filp->f_dentry, p = d_path(curlun->filp->f_path.dentry,
curlun->filp->f_vfsmnt, curlun->filp->f_path.mnt,
pathbuf, PATH_MAX); pathbuf, PATH_MAX);
if (IS_ERR(p)) if (IS_ERR(p))
p = NULL; p = NULL;
......
...@@ -3168,7 +3168,7 @@ sisusb_compat_ioctl(struct file *f, unsigned int cmd, unsigned long arg) ...@@ -3168,7 +3168,7 @@ sisusb_compat_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
case SISUSB_GET_CONFIG: case SISUSB_GET_CONFIG:
case SISUSB_COMMAND: case SISUSB_COMMAND:
lock_kernel(); lock_kernel();
retval = sisusb_ioctl(f->f_dentry->d_inode, f, cmd, arg); retval = sisusb_ioctl(f->f_path.dentry->d_inode, f, cmd, arg);
unlock_kernel(); unlock_kernel();
return retval; return retval;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment