diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2008-03-14 14:14:56 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-03-19 18:00:34 -0400 |
commit | ecfc555a8327ff09b07066d73a98c04115007eec (patch) | |
tree | 304691e77d21b8cecfd529eddfdfb2ba3fdfac31 /fs/nfs | |
parent | 82d101d58a2312297ee79f96d44c1d8c7fe1032d (diff) |
NFS: Always enable NFS direct I/O
Since O_DIRECT is a standard feature that is enabled in most distros,
eliminate the CONFIG_NFS_DIRECTIO build option, and change the
fs/nfs/Makefile to always build in the NFS direct I/O engine.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/Makefile | 3 | ||||
-rw-r--r-- | fs/nfs/file.c | 6 | ||||
-rw-r--r-- | fs/nfs/internal.h | 5 |
3 files changed, 1 insertions, 13 deletions
diff --git a/fs/nfs/Makefile b/fs/nfs/Makefile index df0f41e09885..ac6170c594a3 100644 --- a/fs/nfs/Makefile +++ b/fs/nfs/Makefile | |||
@@ -5,7 +5,7 @@ | |||
5 | obj-$(CONFIG_NFS_FS) += nfs.o | 5 | obj-$(CONFIG_NFS_FS) += nfs.o |
6 | 6 | ||
7 | nfs-y := client.o dir.o file.o getroot.o inode.o super.o nfs2xdr.o \ | 7 | nfs-y := client.o dir.o file.o getroot.o inode.o super.o nfs2xdr.o \ |
8 | pagelist.o proc.o read.o symlink.o unlink.o \ | 8 | direct.o pagelist.o proc.o read.o symlink.o unlink.o \ |
9 | write.o namespace.o mount_clnt.o | 9 | write.o namespace.o mount_clnt.o |
10 | nfs-$(CONFIG_ROOT_NFS) += nfsroot.o | 10 | nfs-$(CONFIG_ROOT_NFS) += nfsroot.o |
11 | nfs-$(CONFIG_NFS_V3) += nfs3proc.o nfs3xdr.o | 11 | nfs-$(CONFIG_NFS_V3) += nfs3proc.o nfs3xdr.o |
@@ -14,5 +14,4 @@ nfs-$(CONFIG_NFS_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o \ | |||
14 | delegation.o idmap.o \ | 14 | delegation.o idmap.o \ |
15 | callback.o callback_xdr.o callback_proc.o \ | 15 | callback.o callback_xdr.o callback_proc.o \ |
16 | nfs4namespace.o | 16 | nfs4namespace.o |
17 | nfs-$(CONFIG_NFS_DIRECTIO) += direct.o | ||
18 | nfs-$(CONFIG_SYSCTL) += sysctl.o | 17 | nfs-$(CONFIG_SYSCTL) += sysctl.o |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index ef57a5ae5904..10e8b807e7ff 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -234,10 +234,8 @@ nfs_file_read(struct kiocb *iocb, const struct iovec *iov, | |||
234 | ssize_t result; | 234 | ssize_t result; |
235 | size_t count = iov_length(iov, nr_segs); | 235 | size_t count = iov_length(iov, nr_segs); |
236 | 236 | ||
237 | #ifdef CONFIG_NFS_DIRECTIO | ||
238 | if (iocb->ki_filp->f_flags & O_DIRECT) | 237 | if (iocb->ki_filp->f_flags & O_DIRECT) |
239 | return nfs_file_direct_read(iocb, iov, nr_segs, pos); | 238 | return nfs_file_direct_read(iocb, iov, nr_segs, pos); |
240 | #endif | ||
241 | 239 | ||
242 | dfprintk(VFS, "nfs: read(%s/%s, %lu@%lu)\n", | 240 | dfprintk(VFS, "nfs: read(%s/%s, %lu@%lu)\n", |
243 | dentry->d_parent->d_name.name, dentry->d_name.name, | 241 | dentry->d_parent->d_name.name, dentry->d_name.name, |
@@ -383,9 +381,7 @@ const struct address_space_operations nfs_file_aops = { | |||
383 | .write_end = nfs_write_end, | 381 | .write_end = nfs_write_end, |
384 | .invalidatepage = nfs_invalidate_page, | 382 | .invalidatepage = nfs_invalidate_page, |
385 | .releasepage = nfs_release_page, | 383 | .releasepage = nfs_release_page, |
386 | #ifdef CONFIG_NFS_DIRECTIO | ||
387 | .direct_IO = nfs_direct_IO, | 384 | .direct_IO = nfs_direct_IO, |
388 | #endif | ||
389 | .launder_page = nfs_launder_page, | 385 | .launder_page = nfs_launder_page, |
390 | }; | 386 | }; |
391 | 387 | ||
@@ -443,10 +439,8 @@ static ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov, | |||
443 | ssize_t result; | 439 | ssize_t result; |
444 | size_t count = iov_length(iov, nr_segs); | 440 | size_t count = iov_length(iov, nr_segs); |
445 | 441 | ||
446 | #ifdef CONFIG_NFS_DIRECTIO | ||
447 | if (iocb->ki_filp->f_flags & O_DIRECT) | 442 | if (iocb->ki_filp->f_flags & O_DIRECT) |
448 | return nfs_file_direct_write(iocb, iov, nr_segs, pos); | 443 | return nfs_file_direct_write(iocb, iov, nr_segs, pos); |
449 | #endif | ||
450 | 444 | ||
451 | dfprintk(VFS, "nfs: write(%s/%s(%ld), %lu@%Ld)\n", | 445 | dfprintk(VFS, "nfs: write(%s/%s(%ld), %lu@%Ld)\n", |
452 | dentry->d_parent->d_name.name, dentry->d_name.name, | 446 | dentry->d_parent->d_name.name, dentry->d_name.name, |
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 999ad8ee0645..04ae867dddba 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -116,13 +116,8 @@ extern void nfs_destroy_readpagecache(void); | |||
116 | extern int __init nfs_init_writepagecache(void); | 116 | extern int __init nfs_init_writepagecache(void); |
117 | extern void nfs_destroy_writepagecache(void); | 117 | extern void nfs_destroy_writepagecache(void); |
118 | 118 | ||
119 | #ifdef CONFIG_NFS_DIRECTIO | ||
120 | extern int __init nfs_init_directcache(void); | 119 | extern int __init nfs_init_directcache(void); |
121 | extern void nfs_destroy_directcache(void); | 120 | extern void nfs_destroy_directcache(void); |
122 | #else | ||
123 | #define nfs_init_directcache() (0) | ||
124 | #define nfs_destroy_directcache() do {} while(0) | ||
125 | #endif | ||
126 | 121 | ||
127 | /* nfs2xdr.c */ | 122 | /* nfs2xdr.c */ |
128 | extern int nfs_stat_to_errno(int); | 123 | extern int nfs_stat_to_errno(int); |