svn commit: r232183 - head/sys/kern

Giovanni Trematerra giovanni.trematerra at gmail.com
Sun Feb 26 22:28:44 UTC 2012


On Sun, Feb 26, 2012 at 10:12 PM, Ed Schouten <ed at 80386.nl> wrote:
> Hi Jilles,
>
> * Jilles Tjoelker <jilles at 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


More information about the svn-src-all mailing list