From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 22:28:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD12D106564A; Sun, 26 Feb 2012 22:28:44 +0000 (UTC) (envelope-from giovanni.trematerra@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 230A38FC08; Sun, 26 Feb 2012 22:28:43 +0000 (UTC) Received: by qao25 with SMTP id 25so1171098qao.13 for ; Sun, 26 Feb 2012 14:28:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=W9/HjDIOPku7/ONd5W9FGotIXGM51et9/h277uL/0QU=; b=I9KwvxxJoDi5+sX/DBxtQf/lODrF6eK26UpQqJwd9C4gqvTHxu8RlBQTQ8WVZtg1/T V4Z+w472X0+upS+fGnIyRKs4foUR3VP1cIY+DnbHIVwCsRDg+yCj+ldz1ZSc7bzMnT7l bNno0QcKLwH1T9t3W0kzmkKthdHUb0FXqoSDc= MIME-Version: 1.0 Received: by 10.224.195.135 with SMTP id ec7mr7504046qab.54.1330295322591; Sun, 26 Feb 2012 14:28:42 -0800 (PST) Received: by 10.229.82.7 with HTTP; Sun, 26 Feb 2012 14:28:42 -0800 (PST) In-Reply-To: <20120226211248.GO32748@hoeg.nl> References: <201202261514.q1QFET0v070810@svn.freebsd.org> <20120226211248.GO32748@hoeg.nl> Date: Sun, 26 Feb 2012 23:28:42 +0100 Message-ID: From: Giovanni Trematerra To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Jilles Tjoelker , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232183 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 22:28:44 -0000 On Sun, Feb 26, 2012 at 10:12 PM, Ed Schouten wrote: > Hi Jilles, > > * Jilles Tjoelker , 20120226 16:14: >> +static int >> +pipe_chmod(fp, mode, active_cred, td) >> + =A0 =A0 struct file *fp; >> + =A0 =A0 mode_t mode; >> + =A0 =A0 struct ucred *active_cred; >> + =A0 =A0 struct thread *td; >> +{ >> + =A0 =A0 struct pipe *cpipe; >> + =A0 =A0 int error; >> + >> + =A0 =A0 cpipe =3D fp->f_data; >> + =A0 =A0 if (cpipe->pipe_state & PIPE_NAMED) >> + =A0 =A0 =A0 =A0 =A0 =A0 error =3D vn_chmod(fp, mode, active_cred, td); >> + =A0 =A0 else >> + =A0 =A0 =A0 =A0 =A0 =A0 error =3D invfo_chmod(fp, mode, active_cred, t= d); >> + =A0 =A0 return (error); >> +} > > Maybe this would be a useless optimisation, but wouldn't it be better to > just use two separate struct fileops here? > I don't think the problem here is related to performance. it might be a problem of readability. I prefer to use one fileops for pipes and fifos just to remark that fifos are actual pipes. If others think that would be better to have two separated fileops, for readability, I'm not against it. -- Gianni