diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 22:02:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 22:02:39 -0400 |
commit | bbd9d6f7fbb0305c9a592bf05a32e87eb364a4ff (patch) | |
tree | 12b2bb4202b05f6ae6a43c6ce830a0472043dbe5 /fs/cifs/file.c | |
parent | 8e204874db000928e37199c2db82b7eb8966cc3c (diff) | |
parent | 5a9a43646cf709312d71eca71cef90ad802f28f9 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (107 commits)
vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp
isofs: Remove global fs lock
jffs2: fix IN_DELETE_SELF on overwriting rename() killing a directory
fix IN_DELETE_SELF on overwriting rename() on ramfs et.al.
mm/truncate.c: fix build for CONFIG_BLOCK not enabled
fs:update the NOTE of the file_operations structure
Remove dead code in dget_parent()
AFS: Fix silly characters in a comment
switch d_add_ci() to d_splice_alias() in "found negative" case as well
simplify gfs2_lookup()
jfs_lookup(): don't bother with . or ..
get rid of useless dget_parent() in btrfs rename() and link()
get rid of useless dget_parent() in fs/btrfs/ioctl.c
fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
drivers: fix up various ->llseek() implementations
fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek
Ext4: handle SEEK_HOLE/SEEK_DATA generically
Btrfs: implement our own ->llseek
fs: add SEEK_HOLE and SEEK_DATA flags
reiserfs: make reiserfs default to barrier=flush
...
Fix up trivial conflicts in fs/xfs/linux-2.6/xfs_super.c due to the new
shrinker callout for the inode cache, that clashed with the xfs code to
start the periodic workers later.
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index a9b4a24f2a16..378acdafa356 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -1401,7 +1401,8 @@ static int cifs_write_end(struct file *file, struct address_space *mapping, | |||
1401 | return rc; | 1401 | return rc; |
1402 | } | 1402 | } |
1403 | 1403 | ||
1404 | int cifs_strict_fsync(struct file *file, int datasync) | 1404 | int cifs_strict_fsync(struct file *file, loff_t start, loff_t end, |
1405 | int datasync) | ||
1405 | { | 1406 | { |
1406 | int xid; | 1407 | int xid; |
1407 | int rc = 0; | 1408 | int rc = 0; |
@@ -1410,6 +1411,11 @@ int cifs_strict_fsync(struct file *file, int datasync) | |||
1410 | struct inode *inode = file->f_path.dentry->d_inode; | 1411 | struct inode *inode = file->f_path.dentry->d_inode; |
1411 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 1412 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
1412 | 1413 | ||
1414 | rc = filemap_write_and_wait_range(inode->i_mapping, start, end); | ||
1415 | if (rc) | ||
1416 | return rc; | ||
1417 | mutex_lock(&inode->i_mutex); | ||
1418 | |||
1413 | xid = GetXid(); | 1419 | xid = GetXid(); |
1414 | 1420 | ||
1415 | cFYI(1, "Sync file - name: %s datasync: 0x%x", | 1421 | cFYI(1, "Sync file - name: %s datasync: 0x%x", |
@@ -1428,16 +1434,23 @@ int cifs_strict_fsync(struct file *file, int datasync) | |||
1428 | rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); | 1434 | rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); |
1429 | 1435 | ||
1430 | FreeXid(xid); | 1436 | FreeXid(xid); |
1437 | mutex_unlock(&inode->i_mutex); | ||
1431 | return rc; | 1438 | return rc; |
1432 | } | 1439 | } |
1433 | 1440 | ||
1434 | int cifs_fsync(struct file *file, int datasync) | 1441 | int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) |
1435 | { | 1442 | { |
1436 | int xid; | 1443 | int xid; |
1437 | int rc = 0; | 1444 | int rc = 0; |
1438 | struct cifs_tcon *tcon; | 1445 | struct cifs_tcon *tcon; |
1439 | struct cifsFileInfo *smbfile = file->private_data; | 1446 | struct cifsFileInfo *smbfile = file->private_data; |
1440 | struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 1447 | struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); |
1448 | struct inode *inode = file->f_mapping->host; | ||
1449 | |||
1450 | rc = filemap_write_and_wait_range(inode->i_mapping, start, end); | ||
1451 | if (rc) | ||
1452 | return rc; | ||
1453 | mutex_lock(&inode->i_mutex); | ||
1441 | 1454 | ||
1442 | xid = GetXid(); | 1455 | xid = GetXid(); |
1443 | 1456 | ||
@@ -1449,6 +1462,7 @@ int cifs_fsync(struct file *file, int datasync) | |||
1449 | rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); | 1462 | rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); |
1450 | 1463 | ||
1451 | FreeXid(xid); | 1464 | FreeXid(xid); |
1465 | mutex_unlock(&inode->i_mutex); | ||
1452 | return rc; | 1466 | return rc; |
1453 | } | 1467 | } |
1454 | 1468 | ||