aboutsummaryrefslogtreecommitdiff
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-09-18 16:20:29 -0700
committerSteve French <smfrench@gmail.com>2012-09-24 21:46:28 -0500
commitc9de5c80d536e556568ccd45b9599870d4993b7d (patch)
tree5ae40ff872bc69cf5be996f2e6a75ea746d8ed58 /fs/cifs/file.c
parent09a4707e7638247302c6d798061aed117141fb74 (diff)
CIFS: Move async write to ops struct
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 29ac8ee4603..703c1648b06 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1754,6 +1754,7 @@ static int cifs_writepages(struct address_space *mapping,
bool done = false, scanned = false, range_whole = false;
pgoff_t end, index;
struct cifs_writedata *wdata;
+ struct TCP_Server_Info *server;
struct page *page;
int rc = 0;
@@ -1904,7 +1905,8 @@ retry:
break;
}
wdata->pid = wdata->cfile->pid;
- rc = cifs_async_writev(wdata);
+ server = tlink_tcon(wdata->cfile->tlink)->ses->server;
+ rc = server->ops->async_writev(wdata);
} while (wbc->sync_mode == WB_SYNC_ALL && rc == -EAGAIN);
for (i = 0; i < nr_pages; ++i)
@@ -2235,6 +2237,9 @@ static int
cifs_uncached_retry_writev(struct cifs_writedata *wdata)
{
int rc;
+ struct TCP_Server_Info *server;
+
+ server = tlink_tcon(wdata->cfile->tlink)->ses->server;
do {
if (wdata->cfile->invalidHandle) {
@@ -2242,7 +2247,7 @@ cifs_uncached_retry_writev(struct cifs_writedata *wdata)
if (rc != 0)
continue;
}
- rc = cifs_async_writev(wdata);
+ rc = server->ops->async_writev(wdata);
} while (rc == -EAGAIN);
return rc;
@@ -2277,6 +2282,10 @@ cifs_iovec_write(struct file *file, const struct iovec *iov,
cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
open_file = file->private_data;
tcon = tlink_tcon(open_file->tlink);
+
+ if (!tcon->ses->server->ops->async_writev)
+ return -ENOSYS;
+
offset = *poffset;
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD)