aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c37
1 files changed, 15 insertions, 22 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 5f7c374ae89c..40b690073fc1 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -145,7 +145,7 @@ client_can_cache:
145 full_path, inode->i_sb, xid); 145 full_path, inode->i_sb, xid);
146 else 146 else
147 rc = cifs_get_inode_info(&file->f_path.dentry->d_inode, 147 rc = cifs_get_inode_info(&file->f_path.dentry->d_inode,
148 full_path, buf, inode->i_sb, xid); 148 full_path, buf, inode->i_sb, xid, NULL);
149 149
150 if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) { 150 if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) {
151 pCifsInode->clientCanCacheAll = TRUE; 151 pCifsInode->clientCanCacheAll = TRUE;
@@ -353,9 +353,9 @@ static int cifs_reopen_file(struct file *file, int can_flush)
353 int disposition = FILE_OPEN; 353 int disposition = FILE_OPEN;
354 __u16 netfid; 354 __u16 netfid;
355 355
356 if (file->private_data) { 356 if (file->private_data)
357 pCifsFile = (struct cifsFileInfo *)file->private_data; 357 pCifsFile = (struct cifsFileInfo *)file->private_data;
358 } else 358 else
359 return -EBADF; 359 return -EBADF;
360 360
361 xid = GetXid(); 361 xid = GetXid();
@@ -440,7 +440,7 @@ reopen_error_exit:
440 else 440 else
441 rc = cifs_get_inode_info(&inode, 441 rc = cifs_get_inode_info(&inode,
442 full_path, NULL, inode->i_sb, 442 full_path, NULL, inode->i_sb,
443 xid); 443 xid, NULL);
444 } /* else we are writing out data to server already 444 } /* else we are writing out data to server already
445 and could deadlock if we tried to flush data, and 445 and could deadlock if we tried to flush data, and
446 since we do not know if we have data that would 446 since we do not know if we have data that would
@@ -499,9 +499,8 @@ int cifs_close(struct inode *inode, struct file *file)
499 the struct would be in each open file, 499 the struct would be in each open file,
500 but this should give enough time to 500 but this should give enough time to
501 clear the socket */ 501 clear the socket */
502#ifdef CONFIG_CIFS_DEBUG2 502 cFYI(DBG2,
503 cFYI(1, ("close delay, write pending")); 503 ("close delay, write pending"));
504#endif /* DEBUG2 */
505 msleep(timeout); 504 msleep(timeout);
506 timeout *= 4; 505 timeout *= 4;
507 } 506 }
@@ -1423,9 +1422,8 @@ static int cifs_writepage(struct page *page, struct writeback_control *wbc)
1423 xid = GetXid(); 1422 xid = GetXid();
1424/* BB add check for wbc flags */ 1423/* BB add check for wbc flags */
1425 page_cache_get(page); 1424 page_cache_get(page);
1426 if (!PageUptodate(page)) { 1425 if (!PageUptodate(page))
1427 cFYI(1, ("ppw - page not up to date")); 1426 cFYI(1, ("ppw - page not up to date"));
1428 }
1429 1427
1430 /* 1428 /*
1431 * Set the "writeback" flag, and clear "dirty" in the radix tree. 1429 * Set the "writeback" flag, and clear "dirty" in the radix tree.
@@ -1460,9 +1458,9 @@ static int cifs_commit_write(struct file *file, struct page *page,
1460 cFYI(1, ("commit write for page %p up to position %lld for %d", 1458 cFYI(1, ("commit write for page %p up to position %lld for %d",
1461 page, position, to)); 1459 page, position, to));
1462 spin_lock(&inode->i_lock); 1460 spin_lock(&inode->i_lock);
1463 if (position > inode->i_size) { 1461 if (position > inode->i_size)
1464 i_size_write(inode, position); 1462 i_size_write(inode, position);
1465 } 1463
1466 spin_unlock(&inode->i_lock); 1464 spin_unlock(&inode->i_lock);
1467 if (!PageUptodate(page)) { 1465 if (!PageUptodate(page)) {
1468 position = ((loff_t)page->index << PAGE_CACHE_SHIFT) + offset; 1466 position = ((loff_t)page->index << PAGE_CACHE_SHIFT) + offset;
@@ -1596,9 +1594,9 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
1596 } 1594 }
1597 open_file = (struct cifsFileInfo *)file->private_data; 1595 open_file = (struct cifsFileInfo *)file->private_data;
1598 1596
1599 if ((file->f_flags & O_ACCMODE) == O_WRONLY) { 1597 if ((file->f_flags & O_ACCMODE) == O_WRONLY)
1600 cFYI(1, ("attempting read on write only file instance")); 1598 cFYI(1, ("attempting read on write only file instance"));
1601 } 1599
1602 for (total_read = 0, current_offset = read_data; 1600 for (total_read = 0, current_offset = read_data;
1603 read_size > total_read; 1601 read_size > total_read;
1604 total_read += bytes_read, current_offset += bytes_read) { 1602 total_read += bytes_read, current_offset += bytes_read) {
@@ -1625,9 +1623,8 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
1625 smb_read_data + 1623 smb_read_data +
1626 4 /* RFC1001 length field */ + 1624 4 /* RFC1001 length field */ +
1627 le16_to_cpu(pSMBr->DataOffset), 1625 le16_to_cpu(pSMBr->DataOffset),
1628 bytes_read)) { 1626 bytes_read))
1629 rc = -EFAULT; 1627 rc = -EFAULT;
1630 }
1631 1628
1632 if (buf_type == CIFS_SMALL_BUFFER) 1629 if (buf_type == CIFS_SMALL_BUFFER)
1633 cifs_small_buf_release(smb_read_data); 1630 cifs_small_buf_release(smb_read_data);
@@ -1814,9 +1811,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
1814 pTcon = cifs_sb->tcon; 1811 pTcon = cifs_sb->tcon;
1815 1812
1816 pagevec_init(&lru_pvec, 0); 1813 pagevec_init(&lru_pvec, 0);
1817#ifdef CONFIG_CIFS_DEBUG2 1814 cFYI(DBG2, ("rpages: num pages %d", num_pages));
1818 cFYI(1, ("rpages: num pages %d", num_pages));
1819#endif
1820 for (i = 0; i < num_pages; ) { 1815 for (i = 0; i < num_pages; ) {
1821 unsigned contig_pages; 1816 unsigned contig_pages;
1822 struct page *tmp_page; 1817 struct page *tmp_page;
@@ -1849,10 +1844,8 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
1849 /* Read size needs to be in multiples of one page */ 1844 /* Read size needs to be in multiples of one page */
1850 read_size = min_t(const unsigned int, read_size, 1845 read_size = min_t(const unsigned int, read_size,
1851 cifs_sb->rsize & PAGE_CACHE_MASK); 1846 cifs_sb->rsize & PAGE_CACHE_MASK);
1852#ifdef CONFIG_CIFS_DEBUG2 1847 cFYI(DBG2, ("rpages: read size 0x%x contiguous pages %d",
1853 cFYI(1, ("rpages: read size 0x%x contiguous pages %d",
1854 read_size, contig_pages)); 1848 read_size, contig_pages));
1855#endif
1856 rc = -EAGAIN; 1849 rc = -EAGAIN;
1857 while (rc == -EAGAIN) { 1850 while (rc == -EAGAIN) {
1858 if ((open_file->invalidHandle) && 1851 if ((open_file->invalidHandle) &&
@@ -2026,7 +2019,7 @@ int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file)
2026 struct cifs_sb_info *cifs_sb; 2019 struct cifs_sb_info *cifs_sb;
2027 2020
2028 cifs_sb = CIFS_SB(cifsInode->vfs_inode.i_sb); 2021 cifs_sb = CIFS_SB(cifsInode->vfs_inode.i_sb);
2029 if ( cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO ) { 2022 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) {
2030 /* since no page cache to corrupt on directio 2023 /* since no page cache to corrupt on directio
2031 we can change size safely */ 2024 we can change size safely */
2032 return 1; 2025 return 1;