writepages and readpages operations did not call get/free_xid
so the statistics for file copy could get confusing with "vfs operations"
not increasing. Add get_xid and free_xid to cifs readpages and
writepages functions.
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
pgoff_t end, index;
struct cifs_writedata *wdata;
int rc = 0;
pgoff_t end, index;
struct cifs_writedata *wdata;
int rc = 0;
/*
* If wsize is smaller than the page cache size, default to writing
/*
* If wsize is smaller than the page cache size, default to writing
if (cifs_sb->wsize < PAGE_SIZE)
return generic_writepages(mapping, wbc);
if (cifs_sb->wsize < PAGE_SIZE)
return generic_writepages(mapping, wbc);
if (wbc->range_cyclic) {
index = mapping->writeback_index; /* Start from prev offset */
end = -1;
if (wbc->range_cyclic) {
index = mapping->writeback_index; /* Start from prev offset */
end = -1;
if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0))
mapping->writeback_index = index;
if (wbc->range_cyclic || (range_whole && wbc->nr_to_write > 0))
mapping->writeback_index = index;
struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
struct TCP_Server_Info *server;
pid_t pid;
struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
struct TCP_Server_Info *server;
pid_t pid;
/*
* Reads as many pages as possible from fscache. Returns -ENOBUFS
* immediately if the cookie is negative
/*
* Reads as many pages as possible from fscache. Returns -ENOBUFS
* immediately if the cookie is negative
*/
rc = cifs_readpages_from_fscache(mapping->host, mapping, page_list,
&num_pages);
*/
rc = cifs_readpages_from_fscache(mapping->host, mapping, page_list,
&num_pages);
+ if (rc == 0) {
+ free_xid(xid);
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD)
pid = open_file->pid;
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD)
pid = open_file->pid;
*/
if (unlikely(rsize < PAGE_SIZE)) {
add_credits_and_wake_if(server, credits, 0);
*/
if (unlikely(rsize < PAGE_SIZE)) {
add_credits_and_wake_if(server, credits, 0);
* allocator.
*/
cifs_fscache_readpages_cancel(mapping->host, page_list);
* allocator.
*/
cifs_fscache_readpages_cancel(mapping->host, page_list);