diff options
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/file_storage.c | 18 | ||||
-rw-r--r-- | drivers/usb/gadget/inode.c | 1 |
2 files changed, 1 insertions, 18 deletions
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index c4e62a6297d7..2e71368f45b4 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c | |||
@@ -1863,26 +1863,10 @@ static int do_write(struct fsg_dev *fsg) | |||
1863 | static int fsync_sub(struct lun *curlun) | 1863 | static int fsync_sub(struct lun *curlun) |
1864 | { | 1864 | { |
1865 | struct file *filp = curlun->filp; | 1865 | struct file *filp = curlun->filp; |
1866 | struct inode *inode; | ||
1867 | int rc, err; | ||
1868 | 1866 | ||
1869 | if (curlun->ro || !filp) | 1867 | if (curlun->ro || !filp) |
1870 | return 0; | 1868 | return 0; |
1871 | if (!filp->f_op->fsync) | 1869 | return vfs_fsync(filp, filp->f_path.dentry, 1); |
1872 | return -EINVAL; | ||
1873 | |||
1874 | inode = filp->f_path.dentry->d_inode; | ||
1875 | mutex_lock(&inode->i_mutex); | ||
1876 | rc = filemap_fdatawrite(inode->i_mapping); | ||
1877 | err = filp->f_op->fsync(filp, filp->f_path.dentry, 1); | ||
1878 | if (!rc) | ||
1879 | rc = err; | ||
1880 | err = filemap_fdatawait(inode->i_mapping); | ||
1881 | if (!rc) | ||
1882 | rc = err; | ||
1883 | mutex_unlock(&inode->i_mutex); | ||
1884 | VLDBG(curlun, "fdatasync -> %d\n", rc); | ||
1885 | return rc; | ||
1886 | } | 1870 | } |
1887 | 1871 | ||
1888 | static void fsync_all(struct fsg_dev *fsg) | 1872 | static void fsync_all(struct fsg_dev *fsg) |
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c index eeb26c0f88e5..317b48fdbf01 100644 --- a/drivers/usb/gadget/inode.c +++ b/drivers/usb/gadget/inode.c | |||
@@ -2001,7 +2001,6 @@ gadgetfs_make_inode (struct super_block *sb, | |||
2001 | inode->i_mode = mode; | 2001 | inode->i_mode = mode; |
2002 | inode->i_uid = default_uid; | 2002 | inode->i_uid = default_uid; |
2003 | inode->i_gid = default_gid; | 2003 | inode->i_gid = default_gid; |
2004 | inode->i_blocks = 0; | ||
2005 | inode->i_atime = inode->i_mtime = inode->i_ctime | 2004 | inode->i_atime = inode->i_mtime = inode->i_ctime |
2006 | = CURRENT_TIME; | 2005 | = CURRENT_TIME; |
2007 | inode->i_private = data; | 2006 | inode->i_private = data; |