summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMartin Brandenburg <martin@omnibond.com>2016-03-15 12:33:20 -0400
committerMike Marshall <hubcap@omnibond.com>2016-03-23 17:36:14 -0400
commite2f7f0d798497f7e2f9296f706ff3263ede0b044 (patch)
treeb780bfdc238b53a92f156f855cb357571e57464c /fs
parent075cca50b6d3ba70ee08cc14535e1c0ba073f871 (diff)
downloadlinux-e2f7f0d798497f7e2f9296f706ff3263ede0b044.tar.bz2
orangefs: use new orangefs_inode_getattr to get size in write and llseek
Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/orangefs/file.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
index 3aff671534d0..d4a00ad26f6e 100644
--- a/fs/orangefs/file.c
+++ b/fs/orangefs/file.c
@@ -455,11 +455,12 @@ static ssize_t orangefs_file_write_iter(struct kiocb *iocb, struct iov_iter *ite
/* Make sure generic_write_checks sees an up to date inode size. */
if (file->f_flags & O_APPEND) {
- rc = orangefs_inode_old_getattr(file->f_mapping->host,
- ORANGEFS_ATTR_SYS_SIZE, 0);
+ rc = orangefs_inode_getattr(file->f_mapping->host, 0, 1);
+ if (rc == -ESTALE)
+ rc = -EIO;
if (rc) {
- gossip_err("%s: orangefs_inode_old_getattr failed, rc:%zd:.\n",
- __func__, rc);
+ gossip_err("%s: orangefs_inode_getattr failed, "
+ "rc:%zd:.\n", __func__, rc);
goto out;
}
}
@@ -670,8 +671,9 @@ static loff_t orangefs_file_llseek(struct file *file, loff_t offset, int origin)
* NOTE: We are only interested in file size here,
* so we set mask accordingly.
*/
- ret = orangefs_inode_old_getattr(inode,
- ORANGEFS_ATTR_SYS_SIZE, 0);
+ ret = orangefs_inode_getattr(file->f_mapping->host, 0, 1);
+ if (ret == -ESTALE)
+ ret = -EIO;
if (ret) {
gossip_debug(GOSSIP_FILE_DEBUG,
"%s:%s:%d calling make bad inode\n",