Commit fe5f5d2e authored by Jeff Layton's avatar Jeff Layton

cifs: add pid field to cifs_writedata

We'll need this to handle rwpidforward option correctly when we use
async writes in the aio_write op.
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Reviewed-by: default avatarPavel Shilovsky <piastry@etersoft.ru>
parent da472fc8
...@@ -487,6 +487,7 @@ struct cifs_writedata { ...@@ -487,6 +487,7 @@ struct cifs_writedata {
struct work_struct work; struct work_struct work;
struct cifsFileInfo *cfile; struct cifsFileInfo *cfile;
__u64 offset; __u64 offset;
pid_t pid;
unsigned int bytes; unsigned int bytes;
int result; int result;
unsigned int nr_pages; unsigned int nr_pages;
......
...@@ -2166,8 +2166,8 @@ cifs_async_writev(struct cifs_writedata *wdata) ...@@ -2166,8 +2166,8 @@ cifs_async_writev(struct cifs_writedata *wdata)
goto async_writev_out; goto async_writev_out;
} }
smb->hdr.Pid = cpu_to_le16((__u16)wdata->cfile->pid); smb->hdr.Pid = cpu_to_le16((__u16)wdata->pid);
smb->hdr.PidHigh = cpu_to_le16((__u16)(wdata->cfile->pid >> 16)); smb->hdr.PidHigh = cpu_to_le16((__u16)(wdata->pid >> 16));
smb->AndXCommand = 0xFF; /* none */ smb->AndXCommand = 0xFF; /* none */
smb->Fid = wdata->cfile->netfid; smb->Fid = wdata->cfile->netfid;
......
...@@ -1802,6 +1802,7 @@ static int cifs_writepages(struct address_space *mapping, ...@@ -1802,6 +1802,7 @@ static int cifs_writepages(struct address_space *mapping,
rc = -EBADF; rc = -EBADF;
break; break;
} }
wdata->pid = wdata->cfile->pid;
rc = cifs_async_writev(wdata); rc = cifs_async_writev(wdata);
} while (wbc->sync_mode == WB_SYNC_ALL && rc == -EAGAIN); } while (wbc->sync_mode == WB_SYNC_ALL && rc == -EAGAIN);
......
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