aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4file.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 15:52:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 15:52:08 -0400
commitead13aee235fa1619d85f2ab5cfb9308a19f8da3 (patch)
treef4f51cda0437d194219e1bfe450c01f4e006a30c /fs/nfs/nfs4file.c
parent929254d8da55a046fe792e79a220f83df761305d (diff)
parentb8fb9c30f25e45dab5d2cd310ab6913b6861d00f (diff)
Merge tag 'nfs-for-3.18-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust: "Highlights include: Stable fixes: - fix an uninitialised pointer Oops in the writeback error path - fix a bogus warning (and early exit from the loop) in nfs_generic_pgio() Features: - Add NFSv4.2 SEEK feature and client support for lseek(SEEK_HOLE/SEEK_DATA) Other fixes: - pnfs: replace broken pnfs_put_lseg_async - Remove dead prototype for nfs4_insert_deviceid_node" * tag 'nfs-for-3.18-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: NFS: Fix a bogus warning in nfs_generic_pgio NFS: Fix an uninitialised pointer Oops in the writeback error path NFSv4.1/pnfs: replace broken pnfs_put_lseg_async NFSv4: Remove dead prototype for nfs4_insert_deviceid_node() NFS: Implement SEEK
Diffstat (limited to 'fs/nfs/nfs4file.c')
-rw-r--r--fs/nfs/nfs4file.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index 3e987ad9ae25..c51fb4db9bfe 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -8,6 +8,10 @@
8#include "fscache.h" 8#include "fscache.h"
9#include "pnfs.h" 9#include "pnfs.h"
10 10
11#ifdef CONFIG_NFS_V4_2
12#include "nfs42.h"
13#endif
14
11#define NFSDBG_FACILITY NFSDBG_FILE 15#define NFSDBG_FACILITY NFSDBG_FILE
12 16
13static int 17static int
@@ -115,8 +119,29 @@ nfs4_file_fsync(struct file *file, loff_t start, loff_t end, int datasync)
115 return ret; 119 return ret;
116} 120}
117 121
122#ifdef CONFIG_NFS_V4_2
123static loff_t nfs4_file_llseek(struct file *filep, loff_t offset, int whence)
124{
125 loff_t ret;
126
127 switch (whence) {
128 case SEEK_HOLE:
129 case SEEK_DATA:
130 ret = nfs42_proc_llseek(filep, offset, whence);
131 if (ret != -ENOTSUPP)
132 return ret;
133 default:
134 return nfs_file_llseek(filep, offset, whence);
135 }
136}
137#endif /* CONFIG_NFS_V4_2 */
138
118const struct file_operations nfs4_file_operations = { 139const struct file_operations nfs4_file_operations = {
140#ifdef CONFIG_NFS_V4_2
141 .llseek = nfs4_file_llseek,
142#else
119 .llseek = nfs_file_llseek, 143 .llseek = nfs_file_llseek,
144#endif
120 .read = new_sync_read, 145 .read = new_sync_read,
121 .write = new_sync_write, 146 .write = new_sync_write,
122 .read_iter = nfs_file_read, 147 .read_iter = nfs_file_read,