diff options
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 5f7c374ae89c..983557d12b0e 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -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(); |
@@ -1423,9 +1423,8 @@ static int cifs_writepage(struct page *page, struct writeback_control *wbc) | |||
1423 | xid = GetXid(); | 1423 | xid = GetXid(); |
1424 | /* BB add check for wbc flags */ | 1424 | /* BB add check for wbc flags */ |
1425 | page_cache_get(page); | 1425 | page_cache_get(page); |
1426 | if (!PageUptodate(page)) { | 1426 | if (!PageUptodate(page)) |
1427 | cFYI(1, ("ppw - page not up to date")); | 1427 | cFYI(1, ("ppw - page not up to date")); |
1428 | } | ||
1429 | 1428 | ||
1430 | /* | 1429 | /* |
1431 | * Set the "writeback" flag, and clear "dirty" in the radix tree. | 1430 | * Set the "writeback" flag, and clear "dirty" in the radix tree. |
@@ -1460,9 +1459,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", | 1459 | cFYI(1, ("commit write for page %p up to position %lld for %d", |
1461 | page, position, to)); | 1460 | page, position, to)); |
1462 | spin_lock(&inode->i_lock); | 1461 | spin_lock(&inode->i_lock); |
1463 | if (position > inode->i_size) { | 1462 | if (position > inode->i_size) |
1464 | i_size_write(inode, position); | 1463 | i_size_write(inode, position); |
1465 | } | 1464 | |
1466 | spin_unlock(&inode->i_lock); | 1465 | spin_unlock(&inode->i_lock); |
1467 | if (!PageUptodate(page)) { | 1466 | if (!PageUptodate(page)) { |
1468 | position = ((loff_t)page->index << PAGE_CACHE_SHIFT) + offset; | 1467 | position = ((loff_t)page->index << PAGE_CACHE_SHIFT) + offset; |
@@ -1596,9 +1595,9 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data, | |||
1596 | } | 1595 | } |
1597 | open_file = (struct cifsFileInfo *)file->private_data; | 1596 | open_file = (struct cifsFileInfo *)file->private_data; |
1598 | 1597 | ||
1599 | if ((file->f_flags & O_ACCMODE) == O_WRONLY) { | 1598 | if ((file->f_flags & O_ACCMODE) == O_WRONLY) |
1600 | cFYI(1, ("attempting read on write only file instance")); | 1599 | cFYI(1, ("attempting read on write only file instance")); |
1601 | } | 1600 | |
1602 | for (total_read = 0, current_offset = read_data; | 1601 | for (total_read = 0, current_offset = read_data; |
1603 | read_size > total_read; | 1602 | read_size > total_read; |
1604 | total_read += bytes_read, current_offset += bytes_read) { | 1603 | total_read += bytes_read, current_offset += bytes_read) { |
@@ -1625,9 +1624,8 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data, | |||
1625 | smb_read_data + | 1624 | smb_read_data + |
1626 | 4 /* RFC1001 length field */ + | 1625 | 4 /* RFC1001 length field */ + |
1627 | le16_to_cpu(pSMBr->DataOffset), | 1626 | le16_to_cpu(pSMBr->DataOffset), |
1628 | bytes_read)) { | 1627 | bytes_read)) |
1629 | rc = -EFAULT; | 1628 | rc = -EFAULT; |
1630 | } | ||
1631 | 1629 | ||
1632 | if (buf_type == CIFS_SMALL_BUFFER) | 1630 | if (buf_type == CIFS_SMALL_BUFFER) |
1633 | cifs_small_buf_release(smb_read_data); | 1631 | cifs_small_buf_release(smb_read_data); |
@@ -2026,7 +2024,7 @@ int is_size_safe_to_change(struct cifsInodeInfo *cifsInode, __u64 end_of_file) | |||
2026 | struct cifs_sb_info *cifs_sb; | 2024 | struct cifs_sb_info *cifs_sb; |
2027 | 2025 | ||
2028 | cifs_sb = CIFS_SB(cifsInode->vfs_inode.i_sb); | 2026 | cifs_sb = CIFS_SB(cifsInode->vfs_inode.i_sb); |
2029 | if ( cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO ) { | 2027 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DIRECT_IO) { |
2030 | /* since no page cache to corrupt on directio | 2028 | /* since no page cache to corrupt on directio |
2031 | we can change size safely */ | 2029 | we can change size safely */ |
2032 | return 1; | 2030 | return 1; |