diff options
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 628ee17007f8..aa1dccf0df9e 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -2062,6 +2062,7 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end, | |||
2062 | unsigned int xid; | 2062 | unsigned int xid; |
2063 | int rc = 0; | 2063 | int rc = 0; |
2064 | struct cifs_tcon *tcon; | 2064 | struct cifs_tcon *tcon; |
2065 | struct TCP_Server_Info *server; | ||
2065 | struct cifsFileInfo *smbfile = file->private_data; | 2066 | struct cifsFileInfo *smbfile = file->private_data; |
2066 | struct inode *inode = file->f_path.dentry->d_inode; | 2067 | struct inode *inode = file->f_path.dentry->d_inode; |
2067 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 2068 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
@@ -2085,8 +2086,13 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end, | |||
2085 | } | 2086 | } |
2086 | 2087 | ||
2087 | tcon = tlink_tcon(smbfile->tlink); | 2088 | tcon = tlink_tcon(smbfile->tlink); |
2088 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) | 2089 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) { |
2089 | rc = CIFSSMBFlush(xid, tcon, smbfile->fid.netfid); | 2090 | server = tcon->ses->server; |
2091 | if (server->ops->flush) | ||
2092 | rc = server->ops->flush(xid, tcon, &smbfile->fid); | ||
2093 | else | ||
2094 | rc = -ENOSYS; | ||
2095 | } | ||
2090 | 2096 | ||
2091 | free_xid(xid); | 2097 | free_xid(xid); |
2092 | mutex_unlock(&inode->i_mutex); | 2098 | mutex_unlock(&inode->i_mutex); |
@@ -2098,6 +2104,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
2098 | unsigned int xid; | 2104 | unsigned int xid; |
2099 | int rc = 0; | 2105 | int rc = 0; |
2100 | struct cifs_tcon *tcon; | 2106 | struct cifs_tcon *tcon; |
2107 | struct TCP_Server_Info *server; | ||
2101 | struct cifsFileInfo *smbfile = file->private_data; | 2108 | struct cifsFileInfo *smbfile = file->private_data; |
2102 | struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 2109 | struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); |
2103 | struct inode *inode = file->f_mapping->host; | 2110 | struct inode *inode = file->f_mapping->host; |
@@ -2113,8 +2120,13 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
2113 | file->f_path.dentry->d_name.name, datasync); | 2120 | file->f_path.dentry->d_name.name, datasync); |
2114 | 2121 | ||
2115 | tcon = tlink_tcon(smbfile->tlink); | 2122 | tcon = tlink_tcon(smbfile->tlink); |
2116 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) | 2123 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) { |
2117 | rc = CIFSSMBFlush(xid, tcon, smbfile->fid.netfid); | 2124 | server = tcon->ses->server; |
2125 | if (server->ops->flush) | ||
2126 | rc = server->ops->flush(xid, tcon, &smbfile->fid); | ||
2127 | else | ||
2128 | rc = -ENOSYS; | ||
2129 | } | ||
2118 | 2130 | ||
2119 | free_xid(xid); | 2131 | free_xid(xid); |
2120 | mutex_unlock(&inode->i_mutex); | 2132 | mutex_unlock(&inode->i_mutex); |