nfs_clvnops.c (220732) | nfs_clvnops.c (220751) |
---|---|
1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * from nfs_vnops.c 8.16 (Berkeley) 5/27/95 33 */ 34 35#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 19 unchanged lines hidden (view full) --- 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * from nfs_vnops.c 8.16 (Berkeley) 5/27/95 33 */ 34 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clvnops.c 220732 2011-04-16 23:20:21Z rmacklem $"); | 36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clvnops.c 220751 2011-04-17 18:56:17Z rmacklem $"); |
37 38/* 39 * vnode op calls for Sun NFS version 2, 3 and 4 40 */ 41 42#include "opt_inet.h" 43 44#include <sys/param.h> --- 169 unchanged lines hidden (view full) --- 214SYSCTL_INT(_vfs_newnfs, OID_AUTO, commit_on_close, CTLFLAG_RW, 215 &newnfs_commit_on_close, 0, "write+commit on close, else only write"); 216 217static int nfs_clean_pages_on_close = 1; 218SYSCTL_INT(_vfs_newnfs, OID_AUTO, clean_pages_on_close, CTLFLAG_RW, 219 &nfs_clean_pages_on_close, 0, "NFS clean dirty pages on close"); 220 221int newnfs_directio_enable = 0; | 37 38/* 39 * vnode op calls for Sun NFS version 2, 3 and 4 40 */ 41 42#include "opt_inet.h" 43 44#include <sys/param.h> --- 169 unchanged lines hidden (view full) --- 214SYSCTL_INT(_vfs_newnfs, OID_AUTO, commit_on_close, CTLFLAG_RW, 215 &newnfs_commit_on_close, 0, "write+commit on close, else only write"); 216 217static int nfs_clean_pages_on_close = 1; 218SYSCTL_INT(_vfs_newnfs, OID_AUTO, clean_pages_on_close, CTLFLAG_RW, 219 &nfs_clean_pages_on_close, 0, "NFS clean dirty pages on close"); 220 221int newnfs_directio_enable = 0; |
222SYSCTL_INT(_vfs_newnfs, OID_AUTO, directio_enable, CTLFLAG_RW, | 222SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs_directio_enable, CTLFLAG_RW, |
223 &newnfs_directio_enable, 0, "Enable NFS directio"); 224 225/* 226 * This sysctl allows other processes to mmap a file that has been opened 227 * O_DIRECT by a process. In general, having processes mmap the file while 228 * Direct IO is in progress can lead to Data Inconsistencies. But, we allow 229 * this by default to prevent DoS attacks - to prevent a malicious user from 230 * opening up files O_DIRECT preventing other users from mmap'ing these 231 * files. "Protected" environments where stricter consistency guarantees are 232 * required can disable this knob. The process that opened the file O_DIRECT 233 * cannot mmap() the file, because mmap'ed IO on an O_DIRECT open() is not 234 * meaningful. 235 */ 236int newnfs_directio_allow_mmap = 1; | 223 &newnfs_directio_enable, 0, "Enable NFS directio"); 224 225/* 226 * This sysctl allows other processes to mmap a file that has been opened 227 * O_DIRECT by a process. In general, having processes mmap the file while 228 * Direct IO is in progress can lead to Data Inconsistencies. But, we allow 229 * this by default to prevent DoS attacks - to prevent a malicious user from 230 * opening up files O_DIRECT preventing other users from mmap'ing these 231 * files. "Protected" environments where stricter consistency guarantees are 232 * required can disable this knob. The process that opened the file O_DIRECT 233 * cannot mmap() the file, because mmap'ed IO on an O_DIRECT open() is not 234 * meaningful. 235 */ 236int newnfs_directio_allow_mmap = 1; |
237SYSCTL_INT(_vfs_newnfs, OID_AUTO, directio_allow_mmap, CTLFLAG_RW, | 237SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs_directio_allow_mmap, CTLFLAG_RW, |
238 &newnfs_directio_allow_mmap, 0, "Enable mmaped IO on file with O_DIRECT opens"); 239 240#if 0 241SYSCTL_INT(_vfs_newnfs, OID_AUTO, access_cache_hits, CTLFLAG_RD, 242 &newnfsstats.accesscache_hits, 0, "NFS ACCESS cache hit count"); 243 244SYSCTL_INT(_vfs_newnfs, OID_AUTO, access_cache_misses, CTLFLAG_RD, 245 &newnfsstats.accesscache_misses, 0, "NFS ACCESS cache miss count"); --- 3119 unchanged lines hidden --- | 238 &newnfs_directio_allow_mmap, 0, "Enable mmaped IO on file with O_DIRECT opens"); 239 240#if 0 241SYSCTL_INT(_vfs_newnfs, OID_AUTO, access_cache_hits, CTLFLAG_RD, 242 &newnfsstats.accesscache_hits, 0, "NFS ACCESS cache hit count"); 243 244SYSCTL_INT(_vfs_newnfs, OID_AUTO, access_cache_misses, CTLFLAG_RD, 245 &newnfsstats.accesscache_misses, 0, "NFS ACCESS cache miss count"); --- 3119 unchanged lines hidden --- |