Re: svn commit: r232183 - head/sys/kern

[ Available lists | Index of svn-src-all | Month of Feb 2012 | Week of 26 Feb 2012 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Giovanni Trematerra <giovanni.trematerra@gmail.com>
Date
26 Feb 2012 22:28:44
Subject
Re: svn commit: r232183 - head/sys/kern
Message-ID
CACfq091oHuByGzmYGwf7e3rNZwqWVXiDre4rvAWsggpV-MYovw@mail.gmail.com


[ Hide this part ]
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)
>> + struct file *fp;
>> + mode_t mode;
>> + struct ucred *active_cred;
>> + struct thread *td;
>> +{
>> + struct pipe *cpipe;
>> + int error;
>> +
>> + cpipe = fp->f_data;
>> + if (cpipe->pipe_state & PIPE_NAMED)
>> + error = vn_chmod(fp, mode, active_cred, td);
>> + else
>> + error = invfo_chmod(fp, mode, active_cred, td);
>> + 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


Elapsed time: 0.134 seconds