PERFORCE change 42185 for review

Chris Vance cvance at FreeBSD.org
Wed Nov 12 15:16:48 PST 2003


http://perforce.freebsd.org/chv.cgi?CH=42185

Change 42185 by cvance at cvance_osx_laptop on 2003/11/12 15:15:34

	Initialize the hfs mount point extattr structure
	Fix a couple bugs, add some debugging.
	HFS extattrs now auto-initialize (or seem to, at least).

Affected files ...

.. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/hfs/hfs_extattr.c#3 edit
.. //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/hfs/hfs_vfsops.c#3 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/hfs/hfs_extattr.c#3 (text+ko) ====

@@ -126,6 +126,23 @@
 
 
 /*
+ * Initialize per-FS structures supporting extended attributes.  Do not
+ * start extended attributes yet.
+ */
+void
+hfs_extattr_uepm_init(struct hfs_extattr_per_mount *uepm)
+{
+
+	uepm->uepm_flags = 0;
+
+	LIST_INIT(&uepm->uepm_list);
+	/* XXX is PVFS right, here? */
+	lockinit(&uepm->uepm_lock, PVFS, "extattr", 0, 0);
+	uepm->uepm_flags |= HFS_EXTATTR_UEPM_INITIALIZED;
+}
+
+
+/*
  * Destroy per-FS structures supporting extended attributes.  Assumes
  * that EAs have already been stopped, and will panic if not.
  */
@@ -194,6 +211,7 @@
 	struct vnode *target_vp;
 	int error;
 
+	printf("hfs_extattr_lookup: called with dirname=%s\n", dirname);
 	bzero(&cnp, sizeof(cnp));
 	cnp.cn_nameiop = LOOKUP;
 	cnp.cn_flags = ISLASTCN;
@@ -233,9 +251,11 @@
 		 * Check that hfs_lookup() didn't release the lock when we
 		 * didn't want it to.
 		 */
+		/*
 		if (lockparent == UE_GETDIR_LOCKPARENT)
 			panic("hfs_extattr_lookup: lockparent but PDIRUNLOCK");
-
+		*/
+		printf("hfs_extattr_lookup: hfs_lookup failed with error %d\n", error);
 		return (error);
 	}
 /*
@@ -243,14 +263,16 @@
 		panic("hfs_extattr_lookup: target_vp == start_dvp");
 */
 
+/*
 	if (target_vp != start_dvp &&
 	    (lockparent == UE_GETDIR_LOCKPARENT_DONT))
 		panic("hfs_extattr_lookup: !lockparent but !PDIRUNLOCK");
 
 	if (lockparent == UE_GETDIR_LOCKPARENT)
 		panic("hfs_extattr_lookup: lockparent but PDIRUNLOCK");
+*/
 
-	/* printf("hfs_extattr_lookup: success\n"); */
+	printf("hfs_extattr_lookup: success, vp=%x\n", vp);
 	*vp = target_vp;
 	return (0);
 }

==== //depot/projects/trustedbsd/sedarwin/apsl/xnu/bsd/hfs/hfs_vfsops.c#3 (text+ko) ====

@@ -1147,7 +1147,9 @@
 	mp->mnt_stat.f_fsid.val[1] = mp->mnt_vfc->vfc_typenum;
 	mp->mnt_maxsymlinklen = 0;
 	devvp->v_specflags |= SI_MOUNTEDON;
-
+#ifdef HFS_EXTATTR
+	hfs_extattr_uepm_init(&hfsmp->hfs_extattr);
+#endif
 	if (ronly == 0) {
 		(void) hfs_flushvolumeheader(hfsmp, MNT_WAIT, 0);
 	}


More information about the p4-projects mailing list