Skip to content

Commit

Permalink
[PATCH] struct path: convert usb
Browse files Browse the repository at this point in the history
Signed-off-by: Josef Sipek <jsipek@fsl.cs.sunysb.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Josef Sipek authored and Linus Torvalds committed Dec 8, 2006
1 parent 592ccbf commit 33cb899
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/core/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ static loff_t default_file_lseek (struct file *file, loff_t offset, int orig)
{
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) {
case 0:
if (offset > 0) {
Expand All @@ -396,7 +396,7 @@ static loff_t default_file_lseek (struct file *file, loff_t offset, int orig)
default:
break;
}
mutex_unlock(&file->f_dentry->d_inode->i_mutex);
mutex_unlock(&file->f_path.dentry->d_inode->i_mutex);
return retval;
}

Expand Down
16 changes: 8 additions & 8 deletions drivers/usb/gadget/file_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -1909,10 +1909,10 @@ static int fsync_sub(struct lun *curlun)
if (!filp->f_op->fsync)
return -EINVAL;

inode = filp->f_dentry->d_inode;
inode = filp->f_path.dentry->d_inode;
mutex_lock(&inode->i_mutex);
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)
rc = err;
err = filemap_fdatawait(inode->i_mapping);
Expand Down Expand Up @@ -1950,7 +1950,7 @@ static int do_synchronize_cache(struct fsg_dev *fsg)
static void invalidate_sub(struct lun *curlun)
{
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;

rc = invalidate_inode_pages(inode->i_mapping);
Expand Down Expand Up @@ -3526,8 +3526,8 @@ static int open_backing_file(struct lun *curlun, const char *filename)
if (!(filp->f_mode & FMODE_WRITE))
ro = 1;

if (filp->f_dentry)
inode = filp->f_dentry->d_inode;
if (filp->f_path.dentry)
inode = filp->f_path.dentry->d_inode;
if (inode && S_ISBLK(inode->i_mode)) {
if (bdev_read_only(inode->i_bdev))
ro = 1;
Expand Down Expand Up @@ -3606,7 +3606,7 @@ static ssize_t show_file(struct device *dev, struct device_attribute *attr, char

down_read(&fsg->filesem);
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);
if (IS_ERR(p))
rc = PTR_ERR(p);
Expand Down Expand Up @@ -4030,8 +4030,8 @@ static int __init fsg_bind(struct usb_gadget *gadget)
if (backing_file_is_open(curlun)) {
p = NULL;
if (pathbuf) {
p = d_path(curlun->filp->f_dentry,
curlun->filp->f_vfsmnt,
p = d_path(curlun->filp->f_path.dentry,
curlun->filp->f_path.mnt,
pathbuf, PATH_MAX);
if (IS_ERR(p))
p = NULL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/misc/sisusbvga/sisusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3168,7 +3168,7 @@ sisusb_compat_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
case SISUSB_GET_CONFIG:
case SISUSB_COMMAND:
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();
return retval;

Expand Down

0 comments on commit 33cb899

Please sign in to comment.