[Ocfs2-devel] [fuse-devel] [PATCH v5 7/7] add a flag for per-operation O_DSYNC semantics

Anand Avati avati at gluster.org
Thu Nov 6 21:52:07 PST 2014


On Thu, Nov 6, 2014 at 8:22 PM, Anton Altaparmakov <aia21 at cam.ac.uk> wrote:

> > On 7 Nov 2014, at 01:46, Jeff Moyer <jmoyer at redhat.com> wrote:
> > Minor nit, but I'd rather read something that looks like this:
> >
> >       if (type == READ && (flags & RWF_NONBLOCK))
> >               return -EAGAIN;
> >       else if (type == WRITE && (flags & RWF_DSYNC))
> >               return -EINVAL;
>
> But your version is less logically efficient for the case where "type ==
> READ" is true and "flags & RWF_NONBLOCK" is false because your version then
> has to do the "if (type == WRITE" check before discovering it does not need
> to take that branch either, whilst the original version does not have to do
> such a test at all.
>

Seriously? Just focus on the code readability/maintainability which makes
the code most easily understood/obvious to a new pair of eyes, and leave
such micro-optimizations to the compiler..

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20141106/e91dd4ab/attachment-0001.html 


More information about the Ocfs2-devel mailing list