Date: Sun, 26 Feb 2012 23:28:42 +0100 From: Giovanni Trematerra <giovanni.trematerra@gmail.com> To: Ed Schouten <ed@80386.nl> Cc: Jilles Tjoelker <jilles@freebsd.org>, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232183 - head/sys/kern Message-ID: <CACfq091oHuByGzmYGwf7e3rNZwqWVXiDre4rvAWsggpV-MYovw@mail.gmail.com> In-Reply-To: <20120226211248.GO32748@hoeg.nl> References: <201202261514.q1QFET0v070810@svn.freebsd.org> <20120226211248.GO32748@hoeg.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Feb 26, 2012 at 10:12 PM, Ed Schouten <ed@80386.nl> wrote: > Hi Jilles, > > * Jilles Tjoelker <jilles@FreeBSD.org>, 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACfq091oHuByGzmYGwf7e3rNZwqWVXiDre4rvAWsggpV-MYovw>