]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
XBSD: do not claim AFS_VM_RDWR_ENV
authorBenjamin Kaduk <kaduk@mit.edu>
Tue, 21 Feb 2017 04:18:09 +0000 (22:18 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 16 Mar 2017 03:13:31 +0000 (23:13 -0400)
The AFS_VM_RDWR_ENV configuration parameter (defined or not defined
in each platform's param.h) is undocumented, but appears to be an
indication of a property of the platform OS's VFS layer, or perhaps just
of the complexity of the read/write vnops that we implement for it.
That is, AFS_VM_RDWR_ENV is defined when the read/write vnops implement
partial write logic (and presumably when they interact with the OS VM
layer in ways not expressed by the afs_write() abstraction); systems
that do not define AFS_VM_RDWR_ENV can use the afs_write() function
fairly directly as the vnode operation.  Use of AFS_VM_RDWR_ENV
evolved over time, with the original (AFS 3.2/3.3-era) code using a
simple scheme that handled partial writes directly in afs_write()
and avoided complexity in callers. In AFS 3.4, sunos and solaris
gained a more complicated read/write vnop that incorporated the
afs_DoPartialWrite() call itself, and eventually in 3.6 we see the
behavior established at the original IBM import, with all the (Unix)
OSes supported at that time defining AFS_VM_RDWR_ENV.

When DARWIN support was brought in in commit
a41175cfbbf4d06ccfe14ae54bef8b7464ecd80b, its param.h properly did
not define AFS_VM_RDWR_ENV, as OS X uses a VFS interface that shares
some level of abstraction with the traditional BSD VFS and its
read/write/getpages/putpages operations, so the afs_write() behavior
was natural and no extra complications needed for integration with the
VM layer or other optimizations.

However, when the initial FreeBSD support came in a few months later,
it seems to have taken inspiration from the OSes that were supported
in the initial IBM import, and kept the AFS_VM_RDWR_ENV definition.
This was then propagated to all the later BSDs as they were added.

Perhaps the most noticeable consequence of this definition is that
the calls to afs_DoPartialWrite() from afs_write() are bypassed, with
a comment that "[i]f write is implemented via VM, afs_DoPartialWrite()
is called from the high-level write op" (and calls to afs_FakeOpen()
and afs_FakeClose() are similarly skipped).  This means that attempting
to write a file larger than the local cache will hang waiting for
more space to be freed, which will never happen as the vcache remains
locked and will not be written out in the background.

In the absence of a documented meaning for AFS_VM_RDWR_ENV, this
also gives us a proxy that can be used to indicate whether a given
OS's support intended to claim the AFS_VM_RDWR_ENV -- such platforms
will actually contain the call to afs_DoPartialWrite() in the
appropriate vnode operation.  This can be used to sanity-check the
places where AFS_VM_RDWR_ENV is removed by this commit.  Interestingly,
HP-UX does not call afs_DoPartialWrite() but also is clearly in a VFS
that uses a rdwr()-based approach, as the corresponding vnode operation
is implemented by mp_afs_rdwr(), so leave it unchanged for now.

Tim Creech is responsible for noting the lack of calls to
afs_DoPartialWrite() on FreeBSD, and Chaskiel Grundman for the
historical research into pre-OpenAFS AFS behavior.

Designing and implementing more complicated BSD read/write vnops that
incorporate afs_DoPartialWrite() and other improvements is left for
future work.

Change-Id: I8e89855ac31303934f97d0753b64899fb7e3867c
Reviewed-on: https://gerrit.openafs.org/12520
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Antoine Verheijen <apv@ualberta.ca>
Reviewed-by: Tim Creech <tcreech@tcreech.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
40 files changed:
src/config/param.alpha_nbsd15.h
src/config/param.alpha_nbsd16.h
src/config/param.generic_fbsd.h
src/config/param.i386_dfbsd_23.h
src/config/param.i386_nbsd15.h
src/config/param.i386_nbsd16.h
src/config/param.nbsd15.h
src/config/param.nbsd16.h
src/config/param.nbsd20.h
src/config/param.nbsd21.h
src/config/param.nbsd30.h
src/config/param.nbsd40.h
src/config/param.nbsd50.h
src/config/param.nbsd60.h
src/config/param.nbsd70.h
src/config/param.obsd31.h
src/config/param.obsd32.h
src/config/param.obsd33.h
src/config/param.obsd34.h
src/config/param.obsd35.h
src/config/param.obsd36.h
src/config/param.obsd37.h
src/config/param.obsd38.h
src/config/param.obsd39.h
src/config/param.obsd40.h
src/config/param.obsd41.h
src/config/param.obsd42.h
src/config/param.obsd43.h
src/config/param.obsd44.h
src/config/param.obsd45.h
src/config/param.obsd46.h
src/config/param.obsd47.h
src/config/param.obsd48.h
src/config/param.obsd49.h
src/config/param.obsd50.h
src/config/param.obsd51.h
src/config/param.obsd52.h
src/config/param.obsd53.h
src/config/param.obsd54.h
src/config/param.ppc_nbsd16.h

index 2c3dc2fad1ae94ffabdceb76b1e4cfb998ef8a84..bf17abb8d4e8c4c5f2e8c879d37ee1afdbba26d8 100644 (file)
@@ -48,7 +48,6 @@
 #define AFSLITTLE_ENDIAN    1
 #define AFS_HAVE_FFS        1  /* Use system's ffs. */
 #define AFS_HAVE_STATVFS    0  /* System doesn't support statvfs */
-#define AFS_VM_RDWR_ENV            1   /* read/write implemented via VM */
 
 #define        afsio_iov       uio_iov
 #define        afsio_iovcnt    uio_iovcnt
index b16e9e9c9080485450a6be2e1a3ef5a43f8f2d7f..b73a6b26241d51e950959fbbefbc2f02799fe06d 100644 (file)
@@ -48,7 +48,6 @@
 #define AFSLITTLE_ENDIAN    1
 #define AFS_HAVE_FFS        1  /* Use system's ffs. */
 #define AFS_HAVE_STATVFS    0  /* System doesn't support statvfs */
-#define AFS_VM_RDWR_ENV            1   /* read/write implemented via VM */
 
 #define        afsio_iov       uio_iov
 #define        afsio_iovcnt    uio_iovcnt
index f8bea607abe93bb70c24f7d5194d403182b69e68..9977eeeea55bbab26839b5d64c4fe6621290e7cd 100644 (file)
@@ -3,7 +3,6 @@
 
 #define AFSLITTLE_ENDIAN       1
 #define AFS_HAVE_FFS           1       /* Use system's ffs. */
-#define AFS_VM_RDWR_ENV                1       /* read/write implemented via VM */
 
 #ifndef UKERNEL
 /* This section for kernel libafs compiles only */
index e2864274254fdf1f1bff215d9f13ceb20c9ba322..0887819901da5f39283284c23f670e0a48f162ed 100644 (file)
@@ -8,7 +8,6 @@
 #define AFSLITTLE_ENDIAN    1
 #define AFS_HAVE_FFS        1  /* Use system's ffs. */
 #define AFS_HAVE_STATVFS    1  /* System doesn't support statvfs */
-#define AFS_VM_RDWR_ENV            1   /* read/write implemented via VM */
 #define AFS_FAKEOPEN_ENV    1   /* call afs_FakeOpen as if !AFS_VM_RDWR */
 
 
index a27b33d34a386a7f8a9a83cc57bfcbb21825e605..206241965d8a585b7fd486681d404e2d9c1519cd 100644 (file)
@@ -50,7 +50,6 @@
 #define AFSLITTLE_ENDIAN    1
 #define AFS_HAVE_FFS        1  /* Use system's ffs. */
 #define AFS_HAVE_STATVFS    0  /* System doesn't support statvfs */
-#define AFS_VM_RDWR_ENV            1   /* read/write implemented via VM */
 
 #define        afsio_iov       uio_iov
 #define        afsio_iovcnt    uio_iovcnt
index 08facf559f3b45721f7e1d8c3eea4b0189f45bbc..261224393e864e3dd870ca58844a4225fe931420 100644 (file)
@@ -52,7 +52,6 @@
 #define AFSLITTLE_ENDIAN    1
 #define AFS_HAVE_FFS        1  /* Use system's ffs. */
 #define AFS_HAVE_STATVFS    0  /* System doesn't support statvfs */
-#define AFS_VM_RDWR_ENV            1   /* read/write implemented via VM */
 
 #define        afsio_iov       uio_iov
 #define        afsio_iovcnt    uio_iovcnt
index 80b16ae67de64ebfdc48d7549a719d63c2e32b3c..905a1c107bed492b5da77d934c5b4bd5307c9842 100644 (file)
@@ -32,7 +32,6 @@
 
 #include <afs/afs_sysnames.h>
 
-#define AFS_VM_RDWR_ENV        1
 #define AFS_VFS_ENV    1
 #define AFS_VFSINCL_ENV 1
 #define AFS_GREEDY43_ENV       1
index a4edddeb48208dd1d06e7b557c8a85a47b393d7e..bb88fe2005ac719ef008094a5875192821ae0eb9 100644 (file)
@@ -33,7 +33,6 @@
 
 #include <afs/afs_sysnames.h>
 
-#define AFS_VM_RDWR_ENV        1
 #define AFS_VFS_ENV    1
 #define AFS_VFSINCL_ENV 1
 #define AFS_GREEDY43_ENV       1
index 77c7891db3464440cec1a1e5fc3daa353c54a458..07e741567d282a27349e276f08f7f4126154f1f4 100644 (file)
@@ -56,7 +56,6 @@
 
 #include <afs/afs_sysnames.h>
 
-#define AFS_VM_RDWR_ENV        1
 #define AFS_VFS_ENV    1
 #define AFS_GREEDY43_ENV       1
 
index 0b5344e661d12d17c4cb60ec3e3cfbb852b8ae6b..bb63588dfe2f91333002154cf4b409ccf78ce1c2 100644 (file)
@@ -56,7 +56,6 @@
 
 #include <afs/afs_sysnames.h>
 
-#define AFS_VM_RDWR_ENV        1
 #define AFS_VFS_ENV    1
 #define AFS_GREEDY43_ENV       1
 
index 1fc306290cb083612bf76dce98cd8fa38464a0b2..95a1c02461524668fea7d06bc05eb335d0a7d6de 100644 (file)
@@ -52,7 +52,6 @@
 
 #include <afs/afs_sysnames.h>
 
-#define AFS_VM_RDWR_ENV        1
 #define AFS_VFS_ENV    1
 #define AFS_GREEDY43_ENV       1
 
index 13876a71a898fa2c820adc4d292f0f64ba9f1b62..d4b47308100063d3e0696d725f78ccca3c54832a 100644 (file)
@@ -55,7 +55,6 @@
 
 #include <afs/afs_sysnames.h>
 
-#define AFS_VM_RDWR_ENV        1
 #define AFS_VFS_ENV    1
 #define AFS_GREEDY43_ENV       1
 
index 9a7677e1b8d35d86e327b176159bedc919d38adb..a65e5c9801273dc04dd65e73df82befc5a976d9f 100644 (file)
@@ -62,7 +62,6 @@
 
 #include <afs/afs_sysnames.h>
 
-#define AFS_VM_RDWR_ENV        1
 #define AFS_VFS_ENV    1
 #define AFS_GREEDY43_ENV       1
 
index 8d42db55a6e84feba220128ee48ccc7b1c8c86a5..196e9d40b3ec63ae8e4288792ee0e5ee74eda2ad 100644 (file)
@@ -63,7 +63,6 @@
 
 #include <afs/afs_sysnames.h>
 
-#define AFS_VM_RDWR_ENV        1
 #define AFS_VFS_ENV    1
 #define AFS_GREEDY43_ENV       1
 
index f54c5eec663416ebd8bc028538f25e22ea7bb824..f01ecb9b4fb9f9b1707dea8e6c7a67cb76f3332c 100644 (file)
@@ -64,7 +64,6 @@
 
 #include <afs/afs_sysnames.h>
 
-#define AFS_VM_RDWR_ENV        1
 #define AFS_VFS_ENV    1
 #define AFS_GREEDY43_ENV       1
 
index fb98352020bb19873588b7df81a9a405a25da702..a660e98fd65c4317c6e29c0844a911e430aea990 100644 (file)
@@ -23,7 +23,6 @@
 
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index c0fd71f1008b3afaf9713a2fed1b1dde27be8fe0..0abbf7d083bd88e3910a7bfe758f261be99f75b9 100644 (file)
@@ -22,7 +22,6 @@
 
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index b2290279bdb450e3bd54ecccc4ecf9fdf8a63ea2..80119092a90decd335c0b0ad3715ad80b29aa31f 100644 (file)
@@ -23,7 +23,6 @@
 
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 560627590543cac9901cdb97971d0bc5b23a6c4c..177b331e4dbc0c8299ad51fd0db9c64d706a23ee 100644 (file)
@@ -24,7 +24,6 @@
 
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index c57197a1ffb48c76ebfb6fc36d58899ce2eaa576..c67ef63e06c93319ff7e1e5f579139753f0b6c6b 100644 (file)
@@ -24,7 +24,6 @@
 
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index c657b1c9d9eeb11c0351beaee0285020b6ec81d2..2f0ebd079a3e7217709c07b59ce9db05baae25ac 100644 (file)
@@ -26,7 +26,6 @@
 
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 58625b628dba2bf47f6e6fb188212896f245d853..401cfa841f5fea2cea1da95637da39a075215bd3 100644 (file)
@@ -27,7 +27,6 @@
 
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 384e4f98bbeaefcdcd398f398a7887a0ada38deb..2eb5f293183ed4f75d8a4342053f09fbf38cfa56 100644 (file)
@@ -28,7 +28,6 @@
 
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 16330efb6a44b40b423553c3beb3f419eb0c5a16..2d3d9a3646ad3f75a58c8b8649a3aec262c6b977 100644 (file)
@@ -32,7 +32,6 @@
 
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 73c8025f2af082a34d3b3dfc8994d6012eb22533..6f6c0608b569f1ee946af71ee94e1c5cb544064f 100644 (file)
@@ -30,7 +30,6 @@
 
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 7ca5a4c03e482d1f1c0c47d1ff2a94065567d7de..7c4453b3620c8d1ec7568e1cb3aab52a469d3045 100644 (file)
@@ -31,7 +31,6 @@
 
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 0d29ec1f2293451144fe726b71dbbc7e037a4943..a8b5edd0c504bdf5c8c8157ea65d645ee2d9f8e9 100644 (file)
@@ -32,7 +32,6 @@
 
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 8c2b5e46c816feef342dcaaba00a99fc4bee02cb..9be4abdb2458d47e3bd96ca18f105da304fc08b4 100644 (file)
@@ -33,7 +33,6 @@
 
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 9f628405c162ec01fbfde99bcd75e3af93cf8b6d..26bdc07b3327d11a5b5798645584a5867f5f88ab 100644 (file)
@@ -34,7 +34,6 @@
 
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 511b51aad4d840d9f619cc1fc6d4a405b3848686..ed8a99604a951904e8503291c2e253fe8aa7303c 100644 (file)
@@ -34,7 +34,6 @@
 #define AFS_OBSD45_ENV         1
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 76cd82114600dc436887e264b10c9b460ed680ef..4157780cee82864e28f69003af5d4bc3d715d827 100644 (file)
@@ -35,7 +35,6 @@
 #define AFS_OBSD46_ENV          1
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 1750658002c15bfaa8a591edf03e3a4095772187..556140690443382322a17f33ec2c8537923513f4 100644 (file)
@@ -36,7 +36,6 @@
 #define AFS_OBSD47_ENV          1
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 652916bcf1adb41f35225bf10a7eb826bc77f7a6..6c4462083c17100996fcb767771d40bf46ec585b 100644 (file)
@@ -37,7 +37,6 @@
 #define AFS_OBSD48_ENV          1
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index a5c1f3ed88f269a7f569a565cd433c2d09324093..7adf325d34e6f07188468e6dac5d3e539073eeae 100644 (file)
@@ -38,7 +38,6 @@
 #define AFS_OBSD49_ENV          1
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 660b9580505ecf3cb5a552196a5ff9c5a933e276..06d1990e49676a22b1f6eb8de48f285e4a436ed0 100644 (file)
@@ -39,7 +39,6 @@
 #define AFS_OBSD50_ENV          1
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index ccfc3448b7e10dd29045226cc89a7eec9b771268..8c7756a1749ee6ec6b3a0f8c930502343ce4727a 100644 (file)
@@ -40,7 +40,6 @@
 #define AFS_OBSD51_ENV          1
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index af217cb5cb3f1cc579e199b05f304bb4269d54e2..4d27576850f9a44e2cfe83dc052982bd6480b8b3 100644 (file)
@@ -41,7 +41,6 @@
 #define AFS_OBSD52_ENV          1
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index dc3e588fd623b9acc526ecca2418dee45d1e2cbf..58b4282c3ef8460890450f38c8ae24d7746d8ea2 100644 (file)
@@ -42,7 +42,6 @@
 #define AFS_OBSD53_ENV          1
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index 4f6268236e7ea655d344364d685a194a743d8ddb..45d0cc192346ab24d82da757c82993963b53bd37 100644 (file)
@@ -43,7 +43,6 @@
 #define AFS_OBSD54_ENV          1
 #undef  AFS_NONFSTRANS
 #define AFS_NONFSTRANS         1
-#define AFS_VM_RDWR_ENV                1
 #define AFS_VFS_ENV            1
 #define AFS_VFSINCL_ENV                1
 
index f97e68ce4c6637fef22bf89b96792e632976635c..e4a90694ddc851cdc73cc9000ecaf55ae4bebbb4 100644 (file)
@@ -47,7 +47,6 @@
 #define AFSLITTLE_ENDIAN    1
 #define AFS_HAVE_FFS        1  /* Use system's ffs. */
 #define AFS_HAVE_STATVFS    0  /* System doesn't support statvfs */
-#define AFS_VM_RDWR_ENV            1   /* read/write implemented via VM */
 
 #define        afsio_iov       uio_iov
 #define        afsio_iovcnt    uio_iovcnt