From owner-freebsd-current Mon Feb 25 23: 9:32 2002 Delivered-To: freebsd-current@freebsd.org Received: from mail12.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id 0747037B404 for ; Mon, 25 Feb 2002 23:09:26 -0800 (PST) Received: (qmail 3184 invoked from network); 26 Feb 2002 07:09:24 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([65.90.117.19]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 26 Feb 2002 07:09:24 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Tue, 26 Feb 2002 02:09:24 -0500 (EST) From: John Baldwin To: Julian Elischer Subject: Re: First (easy) td_ucred patch Cc: current@FreeBSD.org, dillon@FreeBSD.org Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 23-Feb-02 Julian Elischer wrote: > > > On Fri, 22 Feb 2002, John Baldwin wrote: >> http://www.FreeBSD.org/~jhb/patches/ucred.patch >> > > The following diff removes the capacity to cope with the case when td is > NULL. I presume it is there because it CAN be NULL. (Though I have not > checked further.) No, it can't be NULL anymore. In 4.x, when we were idle, curproc could be null. In current we have an idle thread context, so we td can't be null except for very, _very_ early during startup which this code doesn't need to worry about. :) > --- //depot/vendor/freebsd/sys/fs/smbfs/smbfs_vnops.c 2001/12/20 > 08:43:46 > +++ //depot/projects/smpng/sys/fs/smbfs/smbfs_vnops.c 2002/02/21 > 15:55:47 > @@ -976,7 +976,6 @@ > caddr_t id = (caddr_t)1 /* ap->a_id */; > /* int flags = ap->a_flags;*/ > struct thread *td = curthread; > - struct proc *p = td ? td->td_proc : NULL; > struct smb_cred scred; > u_quad_t size; > off_t start, end, oadd; > @@ -1027,7 +1026,7 @@ > return EOVERFLOW; > end = start + oadd; > } > - smb_makescred(&scred, td, p ? p->p_ucred : NULL); > + smb_makescred(&scred, td, td->td_ucred); > switch (ap->a_op) { > case F_SETLK: > switch (fl->l_type) { > -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message