From d2721be299c124d76b611ab2980c51be148fa1a7 Mon Sep 17 00:00:00 2001 From: Benjamin Kaduk Date: Mon, 20 Feb 2017 22:18:09 -0600 Subject: [PATCH] XBSD: do not claim AFS_VM_RDWR_ENV 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 Reviewed-by: Antoine Verheijen Reviewed-by: Tim Creech Reviewed-by: Benjamin Kaduk --- src/config/param.alpha_nbsd15.h | 1 - src/config/param.alpha_nbsd16.h | 1 - src/config/param.generic_fbsd.h | 1 - src/config/param.i386_dfbsd_23.h | 1 - src/config/param.i386_nbsd15.h | 1 - src/config/param.i386_nbsd16.h | 1 - src/config/param.nbsd15.h | 1 - src/config/param.nbsd16.h | 1 - src/config/param.nbsd20.h | 1 - src/config/param.nbsd21.h | 1 - src/config/param.nbsd30.h | 1 - src/config/param.nbsd40.h | 1 - src/config/param.nbsd50.h | 1 - src/config/param.nbsd60.h | 1 - src/config/param.nbsd70.h | 1 - src/config/param.obsd31.h | 1 - src/config/param.obsd32.h | 1 - src/config/param.obsd33.h | 1 - src/config/param.obsd34.h | 1 - src/config/param.obsd35.h | 1 - src/config/param.obsd36.h | 1 - src/config/param.obsd37.h | 1 - src/config/param.obsd38.h | 1 - src/config/param.obsd39.h | 1 - src/config/param.obsd40.h | 1 - src/config/param.obsd41.h | 1 - src/config/param.obsd42.h | 1 - src/config/param.obsd43.h | 1 - src/config/param.obsd44.h | 1 - src/config/param.obsd45.h | 1 - src/config/param.obsd46.h | 1 - src/config/param.obsd47.h | 1 - src/config/param.obsd48.h | 1 - src/config/param.obsd49.h | 1 - src/config/param.obsd50.h | 1 - src/config/param.obsd51.h | 1 - src/config/param.obsd52.h | 1 - src/config/param.obsd53.h | 1 - src/config/param.obsd54.h | 1 - src/config/param.ppc_nbsd16.h | 1 - 40 files changed, 40 deletions(-) diff --git a/src/config/param.alpha_nbsd15.h b/src/config/param.alpha_nbsd15.h index 2c3dc2f..bf17abb 100644 --- a/src/config/param.alpha_nbsd15.h +++ b/src/config/param.alpha_nbsd15.h @@ -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 diff --git a/src/config/param.alpha_nbsd16.h b/src/config/param.alpha_nbsd16.h index b16e9e9..b73a6b2 100644 --- a/src/config/param.alpha_nbsd16.h +++ b/src/config/param.alpha_nbsd16.h @@ -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 diff --git a/src/config/param.generic_fbsd.h b/src/config/param.generic_fbsd.h index f8bea60..9977eee 100644 --- a/src/config/param.generic_fbsd.h +++ b/src/config/param.generic_fbsd.h @@ -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 */ diff --git a/src/config/param.i386_dfbsd_23.h b/src/config/param.i386_dfbsd_23.h index e286427..0887819 100644 --- a/src/config/param.i386_dfbsd_23.h +++ b/src/config/param.i386_dfbsd_23.h @@ -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 */ diff --git a/src/config/param.i386_nbsd15.h b/src/config/param.i386_nbsd15.h index a27b33d..2062419 100644 --- a/src/config/param.i386_nbsd15.h +++ b/src/config/param.i386_nbsd15.h @@ -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 diff --git a/src/config/param.i386_nbsd16.h b/src/config/param.i386_nbsd16.h index 08facf5..2612243 100644 --- a/src/config/param.i386_nbsd16.h +++ b/src/config/param.i386_nbsd16.h @@ -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 diff --git a/src/config/param.nbsd15.h b/src/config/param.nbsd15.h index 80b16ae..905a1c1 100644 --- a/src/config/param.nbsd15.h +++ b/src/config/param.nbsd15.h @@ -32,7 +32,6 @@ #include -#define AFS_VM_RDWR_ENV 1 #define AFS_VFS_ENV 1 #define AFS_VFSINCL_ENV 1 #define AFS_GREEDY43_ENV 1 diff --git a/src/config/param.nbsd16.h b/src/config/param.nbsd16.h index a4eddde..bb88fe2 100644 --- a/src/config/param.nbsd16.h +++ b/src/config/param.nbsd16.h @@ -33,7 +33,6 @@ #include -#define AFS_VM_RDWR_ENV 1 #define AFS_VFS_ENV 1 #define AFS_VFSINCL_ENV 1 #define AFS_GREEDY43_ENV 1 diff --git a/src/config/param.nbsd20.h b/src/config/param.nbsd20.h index 77c7891..07e7415 100644 --- a/src/config/param.nbsd20.h +++ b/src/config/param.nbsd20.h @@ -56,7 +56,6 @@ #include -#define AFS_VM_RDWR_ENV 1 #define AFS_VFS_ENV 1 #define AFS_GREEDY43_ENV 1 diff --git a/src/config/param.nbsd21.h b/src/config/param.nbsd21.h index 0b5344e..bb63588 100644 --- a/src/config/param.nbsd21.h +++ b/src/config/param.nbsd21.h @@ -56,7 +56,6 @@ #include -#define AFS_VM_RDWR_ENV 1 #define AFS_VFS_ENV 1 #define AFS_GREEDY43_ENV 1 diff --git a/src/config/param.nbsd30.h b/src/config/param.nbsd30.h index 1fc3062..95a1c02 100644 --- a/src/config/param.nbsd30.h +++ b/src/config/param.nbsd30.h @@ -52,7 +52,6 @@ #include -#define AFS_VM_RDWR_ENV 1 #define AFS_VFS_ENV 1 #define AFS_GREEDY43_ENV 1 diff --git a/src/config/param.nbsd40.h b/src/config/param.nbsd40.h index 13876a7..d4b4730 100644 --- a/src/config/param.nbsd40.h +++ b/src/config/param.nbsd40.h @@ -55,7 +55,6 @@ #include -#define AFS_VM_RDWR_ENV 1 #define AFS_VFS_ENV 1 #define AFS_GREEDY43_ENV 1 diff --git a/src/config/param.nbsd50.h b/src/config/param.nbsd50.h index 9a7677e..a65e5c9 100644 --- a/src/config/param.nbsd50.h +++ b/src/config/param.nbsd50.h @@ -62,7 +62,6 @@ #include -#define AFS_VM_RDWR_ENV 1 #define AFS_VFS_ENV 1 #define AFS_GREEDY43_ENV 1 diff --git a/src/config/param.nbsd60.h b/src/config/param.nbsd60.h index 8d42db5..196e9d4 100644 --- a/src/config/param.nbsd60.h +++ b/src/config/param.nbsd60.h @@ -63,7 +63,6 @@ #include -#define AFS_VM_RDWR_ENV 1 #define AFS_VFS_ENV 1 #define AFS_GREEDY43_ENV 1 diff --git a/src/config/param.nbsd70.h b/src/config/param.nbsd70.h index f54c5ee..f01ecb9 100644 --- a/src/config/param.nbsd70.h +++ b/src/config/param.nbsd70.h @@ -64,7 +64,6 @@ #include -#define AFS_VM_RDWR_ENV 1 #define AFS_VFS_ENV 1 #define AFS_GREEDY43_ENV 1 diff --git a/src/config/param.obsd31.h b/src/config/param.obsd31.h index fb98352..a660e98 100644 --- a/src/config/param.obsd31.h +++ b/src/config/param.obsd31.h @@ -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 diff --git a/src/config/param.obsd32.h b/src/config/param.obsd32.h index c0fd71f..0abbf7d 100644 --- a/src/config/param.obsd32.h +++ b/src/config/param.obsd32.h @@ -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 diff --git a/src/config/param.obsd33.h b/src/config/param.obsd33.h index b229027..8011909 100644 --- a/src/config/param.obsd33.h +++ b/src/config/param.obsd33.h @@ -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 diff --git a/src/config/param.obsd34.h b/src/config/param.obsd34.h index 5606275..177b331 100644 --- a/src/config/param.obsd34.h +++ b/src/config/param.obsd34.h @@ -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 diff --git a/src/config/param.obsd35.h b/src/config/param.obsd35.h index c57197a..c67ef63 100644 --- a/src/config/param.obsd35.h +++ b/src/config/param.obsd35.h @@ -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 diff --git a/src/config/param.obsd36.h b/src/config/param.obsd36.h index c657b1c..2f0ebd0 100644 --- a/src/config/param.obsd36.h +++ b/src/config/param.obsd36.h @@ -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 diff --git a/src/config/param.obsd37.h b/src/config/param.obsd37.h index 58625b6..401cfa8 100644 --- a/src/config/param.obsd37.h +++ b/src/config/param.obsd37.h @@ -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 diff --git a/src/config/param.obsd38.h b/src/config/param.obsd38.h index 384e4f9..2eb5f29 100644 --- a/src/config/param.obsd38.h +++ b/src/config/param.obsd38.h @@ -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 diff --git a/src/config/param.obsd39.h b/src/config/param.obsd39.h index 16330ef..2d3d9a3 100644 --- a/src/config/param.obsd39.h +++ b/src/config/param.obsd39.h @@ -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 diff --git a/src/config/param.obsd40.h b/src/config/param.obsd40.h index 73c8025..6f6c060 100644 --- a/src/config/param.obsd40.h +++ b/src/config/param.obsd40.h @@ -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 diff --git a/src/config/param.obsd41.h b/src/config/param.obsd41.h index 7ca5a4c..7c4453b 100644 --- a/src/config/param.obsd41.h +++ b/src/config/param.obsd41.h @@ -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 diff --git a/src/config/param.obsd42.h b/src/config/param.obsd42.h index 0d29ec1..a8b5edd 100644 --- a/src/config/param.obsd42.h +++ b/src/config/param.obsd42.h @@ -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 diff --git a/src/config/param.obsd43.h b/src/config/param.obsd43.h index 8c2b5e4..9be4abd 100644 --- a/src/config/param.obsd43.h +++ b/src/config/param.obsd43.h @@ -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 diff --git a/src/config/param.obsd44.h b/src/config/param.obsd44.h index 9f62840..26bdc07 100644 --- a/src/config/param.obsd44.h +++ b/src/config/param.obsd44.h @@ -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 diff --git a/src/config/param.obsd45.h b/src/config/param.obsd45.h index 511b51a..ed8a996 100644 --- a/src/config/param.obsd45.h +++ b/src/config/param.obsd45.h @@ -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 diff --git a/src/config/param.obsd46.h b/src/config/param.obsd46.h index 76cd821..4157780 100644 --- a/src/config/param.obsd46.h +++ b/src/config/param.obsd46.h @@ -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 diff --git a/src/config/param.obsd47.h b/src/config/param.obsd47.h index 1750658..5561406 100644 --- a/src/config/param.obsd47.h +++ b/src/config/param.obsd47.h @@ -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 diff --git a/src/config/param.obsd48.h b/src/config/param.obsd48.h index 652916b..6c44620 100644 --- a/src/config/param.obsd48.h +++ b/src/config/param.obsd48.h @@ -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 diff --git a/src/config/param.obsd49.h b/src/config/param.obsd49.h index a5c1f3e..7adf325 100644 --- a/src/config/param.obsd49.h +++ b/src/config/param.obsd49.h @@ -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 diff --git a/src/config/param.obsd50.h b/src/config/param.obsd50.h index 660b958..06d1990 100644 --- a/src/config/param.obsd50.h +++ b/src/config/param.obsd50.h @@ -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 diff --git a/src/config/param.obsd51.h b/src/config/param.obsd51.h index ccfc344..8c7756a 100644 --- a/src/config/param.obsd51.h +++ b/src/config/param.obsd51.h @@ -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 diff --git a/src/config/param.obsd52.h b/src/config/param.obsd52.h index af217cb..4d27576 100644 --- a/src/config/param.obsd52.h +++ b/src/config/param.obsd52.h @@ -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 diff --git a/src/config/param.obsd53.h b/src/config/param.obsd53.h index dc3e588..58b4282 100644 --- a/src/config/param.obsd53.h +++ b/src/config/param.obsd53.h @@ -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 diff --git a/src/config/param.obsd54.h b/src/config/param.obsd54.h index 4f62682..45d0cc1 100644 --- a/src/config/param.obsd54.h +++ b/src/config/param.obsd54.h @@ -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 diff --git a/src/config/param.ppc_nbsd16.h b/src/config/param.ppc_nbsd16.h index f97e68c..e4a9069 100644 --- a/src/config/param.ppc_nbsd16.h +++ b/src/config/param.ppc_nbsd16.h @@ -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 -- 1.9.4