Skip to content

Commit

Permalink
cifs: add pid field to cifs_writedata
Browse files Browse the repository at this point in the history
We'll need this to handle rwpidforward option correctly when we use
async writes in the aio_write op.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
  • Loading branch information
Jeff Layton committed Mar 23, 2012
1 parent da472fc commit fe5f5d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions fs/cifs/cifsproto.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ struct cifs_writedata {
struct work_struct work;
struct cifsFileInfo *cfile;
__u64 offset;
pid_t pid;
unsigned int bytes;
int result;
unsigned int nr_pages;
Expand Down
4 changes: 2 additions & 2 deletions fs/cifs/cifssmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2166,8 +2166,8 @@ cifs_async_writev(struct cifs_writedata *wdata)
goto async_writev_out;
}

smb->hdr.Pid = cpu_to_le16((__u16)wdata->cfile->pid);
smb->hdr.PidHigh = cpu_to_le16((__u16)(wdata->cfile->pid >> 16));
smb->hdr.Pid = cpu_to_le16((__u16)wdata->pid);
smb->hdr.PidHigh = cpu_to_le16((__u16)(wdata->pid >> 16));

smb->AndXCommand = 0xFF; /* none */
smb->Fid = wdata->cfile->netfid;
Expand Down
1 change: 1 addition & 0 deletions fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1802,6 +1802,7 @@ static int cifs_writepages(struct address_space *mapping,
rc = -EBADF;
break;
}
wdata->pid = wdata->cfile->pid;
rc = cifs_async_writev(wdata);
} while (wbc->sync_mode == WB_SYNC_ALL && rc == -EAGAIN);

Expand Down

0 comments on commit fe5f5d2

Please sign in to comment.