macos: make the OpenAFS client aware of APFS 43/12743/2
authorMarcio Barbosa <mbarbosa@sinenomine.net>
Thu, 12 Oct 2017 15:42:40 +0000 (12:42 -0300)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 18 Dec 2017 21:57:20 +0000 (16:57 -0500)
Apple has introduced a new file system called APFS. Starting from High
Sierra, APFS replaces Mac OS Extended (HFS+) as the default file system
for solid-state drives and other flash storage devices.

The current OpenAFS client is not aware of APFS. As a result, the
installation of the current client into an APFS volume will panic the
machine.

To fix this problem, make the OpenAFS client aware of APFS.

Change-Id: Ib5ac88b87f348744864f4e33f1f222efbc852d41
Reviewed-on: https://gerrit.openafs.org/12743
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/afs/DARWIN/osi_file.c
src/afs/DARWIN/osi_machdep.h

index a83dbf2..19bfdf9 100644 (file)
@@ -53,6 +53,10 @@ afs_InitDualFSCacheOps(struct vnode *vp)
     else if (strncmp("ufs", vp->v_mount->mnt_vfc->vfc_name, 3) == 0)
 #endif
        afs_CacheFSType = AFS_APPL_UFS_CACHE;
+#ifdef AFS_DARWIN80_ENV
+    else if (strncmp("apfs", buffer, 4) == 0)
+       afs_CacheFSType = AFS_APPL_APFS_CACHE;
+#endif
     else
        osi_Panic("Unknown cache vnode type\n");
 #ifdef AFS_DARWIN80_ENV
index 1750052..a4f01b3 100644 (file)
@@ -214,6 +214,7 @@ extern struct lock__bsd__ afs_global_lock;
 
 #define AFS_APPL_UFS_CACHE 1
 #define AFS_APPL_HFS_CACHE 2
+#define AFS_APPL_APFS_CACHE 3
 
 extern ino_t VnodeToIno(vnode_t avp);
 extern dev_t VnodeToDev(vnode_t vp);