From owner-p4-projects@FreeBSD.ORG Wed Nov 12 15:16:48 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 38CE216A4D0; Wed, 12 Nov 2003 15:16:48 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1414916A4CE for ; Wed, 12 Nov 2003 15:16:48 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7999443FE1 for ; Wed, 12 Nov 2003 15:16:47 -0800 (PST) (envelope-from cvance@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hACNGgXJ030170 for ; Wed, 12 Nov 2003 15:16:42 -0800 (PST) (envelope-from cvance@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hACNGSwe030163 for perforce@freebsd.org; Wed, 12 Nov 2003 15:16:28 -0800 (PST) (envelope-from cvance@nailabs.com) Date: Wed, 12 Nov 2003 15:16:28 -0800 (PST) Message-Id: <200311122316.hACNGSwe030163@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to cvance@nailabs.com using -f From: Chris Vance To: Perforce Change Reviews Subject: PERFORCE change 42185 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2003 23:16:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=42185 Change 42185 by cvance@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); }