diff options
author | Martin Brandenburg <martin@omnibond.com> | 2017-04-25 21:38:03 +0200 |
---|---|---|
committer | Mike Marshall <hubcap@omnibond.com> | 2017-04-26 20:33:00 +0200 |
commit | 68a24a6cc4a6025e111c282186a2506281d79b4b (patch) | |
tree | 5fad31549fc817c548bbdd28aaa719b152f630c7 /fs/orangefs/file.c | |
parent | orangefs: remove ORANGEFS_READDIR macros (diff) | |
download | linux-68a24a6cc4a6025e111c282186a2506281d79b4b.tar.xz linux-68a24a6cc4a6025e111c282186a2506281d79b4b.zip |
orangefs: implement statx
Fortunately OrangeFS has had a getattr request mask for a long time.
The server basically has two difficulty levels for attributes. Fetching
any attribute except size requires communicating with the metadata
server for that handle. Since all the attributes are right there, it
makes sense to return them all. Fetching the size requires
communicating with every I/O server (that the file is distributed
across). Therefore if asked for anything except size, get everything
except size, and if asked for size, get everything.
Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/file.c')
-rw-r--r-- | fs/orangefs/file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index e6bbc8083d77..b421df11fe95 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -475,7 +475,8 @@ 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_getattr(file->f_mapping->host, 0, 1); + rc = orangefs_inode_getattr(file->f_mapping->host, 0, 1, + STATX_SIZE); if (rc == -ESTALE) rc = -EIO; if (rc) { @@ -693,7 +694,8 @@ 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_getattr(file->f_mapping->host, 0, 1); + ret = orangefs_inode_getattr(file->f_mapping->host, 0, 1, + STATX_SIZE); if (ret == -ESTALE) ret = -EIO; if (ret) { |