diff options
| author | Rob Herring <robh@kernel.org> | 2015-03-10 10:03:04 -0400 |
|---|---|---|
| committer | Rob Herring <robh@kernel.org> | 2015-03-10 10:03:04 -0400 |
| commit | 2c192699a7050ef5bdf1e2cc95fdddfbcf524509 (patch) | |
| tree | 945d4553691ecb24151a2fa83b7d489665dd3248 /fs/nfs/write.c | |
| parent | 25e8f336e535d10c30216e1ba330fbea98dfccc5 (diff) | |
| parent | 9eccca0843205f87c00404b663188b88eb248051 (diff) | |
Merge tag 'v4.0-rc3' into HEAD
Linux 4.0-rc3
Merging in v4.0-rc3 because commit 30a22c215a00 (console: Fix
console name size mismatch) is a dependency.
Diffstat (limited to 'fs/nfs/write.c')
| -rw-r--r-- | fs/nfs/write.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 595d81e354d1..849ed784d6ac 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
| @@ -1377,6 +1377,36 @@ static int nfs_should_remove_suid(const struct inode *inode) | |||
| 1377 | return 0; | 1377 | return 0; |
| 1378 | } | 1378 | } |
| 1379 | 1379 | ||
| 1380 | static void nfs_writeback_check_extend(struct nfs_pgio_header *hdr, | ||
| 1381 | struct nfs_fattr *fattr) | ||
| 1382 | { | ||
| 1383 | struct nfs_pgio_args *argp = &hdr->args; | ||
| 1384 | struct nfs_pgio_res *resp = &hdr->res; | ||
| 1385 | |||
| 1386 | if (!(fattr->valid & NFS_ATTR_FATTR_SIZE)) | ||
| 1387 | return; | ||
| 1388 | if (argp->offset + resp->count != fattr->size) | ||
| 1389 | return; | ||
| 1390 | if (nfs_size_to_loff_t(fattr->size) < i_size_read(hdr->inode)) | ||
| 1391 | return; | ||
| 1392 | /* Set attribute barrier */ | ||
| 1393 | nfs_fattr_set_barrier(fattr); | ||
| 1394 | } | ||
| 1395 | |||
| 1396 | void nfs_writeback_update_inode(struct nfs_pgio_header *hdr) | ||
| 1397 | { | ||
| 1398 | struct nfs_fattr *fattr = hdr->res.fattr; | ||
| 1399 | struct inode *inode = hdr->inode; | ||
| 1400 | |||
| 1401 | if (fattr == NULL) | ||
| 1402 | return; | ||
| 1403 | spin_lock(&inode->i_lock); | ||
| 1404 | nfs_writeback_check_extend(hdr, fattr); | ||
| 1405 | nfs_post_op_update_inode_force_wcc_locked(inode, fattr); | ||
| 1406 | spin_unlock(&inode->i_lock); | ||
| 1407 | } | ||
| 1408 | EXPORT_SYMBOL_GPL(nfs_writeback_update_inode); | ||
| 1409 | |||
| 1380 | /* | 1410 | /* |
| 1381 | * This function is called when the WRITE call is complete. | 1411 | * This function is called when the WRITE call is complete. |
| 1382 | */ | 1412 | */ |
