All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Altaparmakov <aia21@cam.ac.uk>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: Milosz Tanski <milosz@adfin.com>,
	linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Christoph Hellwig <hch@infradead.org>,
	linux-fsdevel@vger.kernel.org, linux-aio@kvack.org,
	Mel Gorman <mgorman@suse.de>,
	Volker Lendecke <Volker.Lendecke@sernet.de>,
	Tejun Heo <tj@kernel.org>, "Theodore Ts'o" <tytso@mit.edu>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-api@vger.kernel.org,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	linux-arch@vger.kernel.org, ceph-devel@vger.kernel.org,
	fuse-devel@lists.sourceforge.net, linux-nfs@vger.kernel.org,
	ocfs2-devel@oss.oracle.com, linux-mm@kvack.org
Subject: Re: [PATCH v5 7/7] add a flag for per-operation O_DSYNC semantics
Date: Fri, 7 Nov 2014 06:22:48 +0200	[thread overview]
Message-ID: <BF30FAEC-D4D3-4079-9ECD-2743747279BD@cam.ac.uk> (raw)
In-Reply-To: <x49r3xf28qn.fsf@segfault.boston.devel.redhat.com>

Hi Jeff,

> On 7 Nov 2014, at 01:46, Jeff Moyer <jmoyer@redhat.com> wrote:
> 
> Milosz Tanski <milosz@adfin.com> writes:
> 
>> -		if (type == READ && (flags & RWF_NONBLOCK))
>> -			return -EAGAIN;
>> +		if (type == READ) {
>> +			if (flags & RWF_NONBLOCK)
>> +				return -EAGAIN;
>> +		} else {
>> +			if (flags & RWF_DSYNC)
>> +				return -EINVAL;
>> +		}
> 
> 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.

Best regards,

	Anton

> I won't lose sleep over it, though.
> 
> Reviewed-by: Jeff Moyer <jmoyer@redhat.com>

-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
University of Cambridge Information Services, Roger Needham Building
7 JJ Thomson Avenue, Cambridge, CB3 0RB, UK


WARNING: multiple messages have this Message-ID (diff)
From: Anton Altaparmakov <aia21-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>
To: Jeff Moyer <jmoyer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Milosz Tanski <milosz-B5zB6C1i6pkAvxtiuMwx3w@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>,
	Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-aio-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	Mel Gorman <mgorman-l3A5Bk7waGM@public.gmane.org>,
	Volker Lendecke
	<Volker.Lendecke-3ekOc4rQMZmzQB+pC5nmwQ@public.gmane.org>,
	Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Theodore Ts'o <tytso-3s7WtUTddSA@public.gmane.org>,
	Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Michael Kerrisk
	<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ceph-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	fuse-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ocfs2-devel-N0ozoZBvEnrZJqsBc5GL+g@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org
Subject: Re: [PATCH v5 7/7] add a flag for per-operation O_DSYNC semantics
Date: Fri, 7 Nov 2014 06:22:48 +0200	[thread overview]
Message-ID: <BF30FAEC-D4D3-4079-9ECD-2743747279BD@cam.ac.uk> (raw)
In-Reply-To: <x49r3xf28qn.fsf-RRHT56Q3PSP4kTEheFKJxxDDeQx5vsVwAInAS/Ez/D0@public.gmane.org>

Hi Jeff,

> On 7 Nov 2014, at 01:46, Jeff Moyer <jmoyer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> 
> Milosz Tanski <milosz-B5zB6C1i6pkAvxtiuMwx3w@public.gmane.org> writes:
> 
>> -		if (type == READ && (flags & RWF_NONBLOCK))
>> -			return -EAGAIN;
>> +		if (type == READ) {
>> +			if (flags & RWF_NONBLOCK)
>> +				return -EAGAIN;
>> +		} else {
>> +			if (flags & RWF_DSYNC)
>> +				return -EINVAL;
>> +		}
> 
> 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.

Best regards,

	Anton

> I won't lose sleep over it, though.
> 
> Reviewed-by: Jeff Moyer <jmoyer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
University of Cambridge Information Services, Roger Needham Building
7 JJ Thomson Avenue, Cambridge, CB3 0RB, UK

WARNING: multiple messages have this Message-ID (diff)
From: Anton Altaparmakov <aia21@cam.ac.uk>
To: Jeff Moyer <jmoyer-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Milosz Tanski <milosz-B5zB6C1i6pkAvxtiuMwx3w@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>,
	Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-aio-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	Mel Gorman <mgorman-l3A5Bk7waGM@public.gmane.org>,
	Volker Lendecke
	<Volker.Lendecke-3ekOc4rQMZmzQB+pC5nmwQ@public.gmane.org>,
	Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Theodore Ts'o <tytso-3s7WtUTddSA@public.gmane.org>,
	Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Michael Kerrisk
	<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ceph-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	fuse-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	ocfs2-devel-N0ozoZBvEnrZJqsBc5GL+g@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org
Subject: [Ocfs2-devel] [PATCH v5 7/7] add a flag for per-operation O_DSYNC semantics
Date: Fri, 7 Nov 2014 06:22:48 +0200	[thread overview]
Message-ID: <BF30FAEC-D4D3-4079-9ECD-2743747279BD@cam.ac.uk> (raw)
In-Reply-To: <x49r3xf28qn.fsf@segfault.boston.devel.redhat.com>

Hi Jeff,

> On 7 Nov 2014, at 01:46, Jeff Moyer <jmoyer@redhat.com> wrote:
> 
> Milosz Tanski <milosz@adfin.com> writes:
> 
>> -		if (type == READ && (flags & RWF_NONBLOCK))
>> -			return -EAGAIN;
>> +		if (type == READ) {
>> +			if (flags & RWF_NONBLOCK)
>> +				return -EAGAIN;
>> +		} else {
>> +			if (flags & RWF_DSYNC)
>> +				return -EINVAL;
>> +		}
> 
> 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.

Best regards,

	Anton

> I won't lose sleep over it, though.
> 
> Reviewed-by: Jeff Moyer <jmoyer@redhat.com>

-- 
Anton Altaparmakov <aia21@cam.ac.uk> (replace at with @)
University of Cambridge Information Services, Roger Needham Building
7 JJ Thomson Avenue, Cambridge, CB3 0RB, UK

WARNING: multiple messages have this Message-ID (diff)
From: Anton Altaparmakov <aia21@cam.ac.uk>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: Milosz Tanski <milosz@adfin.com>,
	linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Christoph Hellwig <hch@infradead.org>,
	linux-fsdevel@vger.kernel.org, linux-aio@kvack.org,
	Mel Gorman <mgorman@suse.de>,
	Volker Lendecke <Volker.Lendecke@sernet.de>,
	Tejun Heo <tj@kernel.org>, Theodore Ts'o <tytso@mit.edu>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-api@vger.kernel.org,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	linux-arch@vger.kernel.org, ceph-devel@vger.kernel.org,
	fuse-devel@lists.sourceforge.net, linux-nfs@vger.kernel.org,
	ocfs2-devel@oss.oracle.com, linux-mm@kvack.org
Subject: Re: [PATCH v5 7/7] add a flag for per-operation O_DSYNC semantics
Date: Fri, 7 Nov 2014 06:22:48 +0200	[thread overview]
Message-ID: <BF30FAEC-D4D3-4079-9ECD-2743747279BD@cam.ac.uk> (raw)
In-Reply-To: <x49r3xf28qn.fsf@segfault.boston.devel.redhat.com>

Hi Jeff,

> On 7 Nov 2014, at 01:46, Jeff Moyer <jmoyer@redhat.com> wrote:
> 
> Milosz Tanski <milosz@adfin.com> writes:
> 
>> -		if (type == READ && (flags & RWF_NONBLOCK))
>> -			return -EAGAIN;
>> +		if (type == READ) {
>> +			if (flags & RWF_NONBLOCK)
>> +				return -EAGAIN;
>> +		} else {
>> +			if (flags & RWF_DSYNC)
>> +				return -EINVAL;
>> +		}
> 
> 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.

Best regards,

	Anton

> I won't lose sleep over it, though.
> 
> Reviewed-by: Jeff Moyer <jmoyer@redhat.com>

-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
University of Cambridge Information Services, Roger Needham Building
7 JJ Thomson Avenue, Cambridge, CB3 0RB, UK

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2014-11-07  4:23 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-05 21:14 [PATCH v5 0/7] vfs: Non-blockling buffered fs read (page cache only) Milosz Tanski
2014-11-05 21:14 ` [PATCH v5 1/7] vfs: Prepare for adding a new preadv/pwritev with user flags Milosz Tanski
2014-11-05 21:14   ` Milosz Tanski
2014-11-05 21:14 ` [PATCH v5 2/7] vfs: Define new syscalls preadv2,pwritev2 Milosz Tanski
2014-11-05 21:14   ` Milosz Tanski
2014-11-05 21:14   ` Milosz Tanski
2014-11-06 23:25   ` Jeff Moyer
2014-11-06 23:25     ` Jeff Moyer
2014-11-07 16:28     ` Milosz Tanski
2014-11-07 16:28       ` Milosz Tanski
2014-11-05 21:14 ` [PATCH v5 3/7] x86: wire up preadv2 and pwritev2 Milosz Tanski
2014-11-05 21:14   ` Milosz Tanski
2014-11-05 21:14 ` [PATCH v5 4/7] vfs: RWF_NONBLOCK flag for preadv2 Milosz Tanski
2014-11-05 21:14   ` Milosz Tanski
2014-11-05 21:14   ` [Ocfs2-devel] " Milosz Tanski
2014-11-05 21:14   ` Milosz Tanski
2014-11-10 16:07   ` Sage Weil
2014-11-10 16:07     ` Sage Weil
2014-11-10 16:07     ` [Ocfs2-devel] " Sage Weil
2014-11-10 16:07     ` Sage Weil
2014-11-05 21:14 ` [PATCH v5 5/7] xfs: add RWF_NONBLOCK support Milosz Tanski
2014-11-05 21:14   ` Milosz Tanski
2014-11-05 21:14 ` [PATCH v5 6/7] fs: pass iocb to generic_write_sync Milosz Tanski
2014-11-05 21:14   ` [Cluster-devel] " Milosz Tanski
2014-11-05 21:14   ` Milosz Tanski
2014-11-06 10:18   ` [Cluster-devel] " Steven Whitehouse
2014-11-06 10:18     ` Steven Whitehouse
2014-11-06 10:18     ` Steven Whitehouse
2014-11-06 10:52   ` [Linux-NTFS-Dev] " Anton Altaparmakov
2014-11-06 10:52     ` [Cluster-devel] " Anton Altaparmakov
2014-11-06 10:52     ` Anton Altaparmakov
2014-11-06 16:14     ` Milosz Tanski
2014-11-06 16:14       ` [Cluster-devel] " Milosz Tanski
2014-11-06 16:14       ` Milosz Tanski
2014-11-06 12:04   ` Jan Kara
2014-11-06 12:04     ` [Cluster-devel] " Jan Kara
2014-11-06 12:04     ` Jan Kara
2014-11-05 21:14 ` [PATCH v5 7/7] fs: add a flag for per-operation O_DSYNC semantics Milosz Tanski
2014-11-05 21:14   ` Milosz Tanski
2014-11-05 21:14   ` [Ocfs2-devel] " Milosz Tanski
2014-11-05 21:14   ` Milosz Tanski
2014-11-06 23:46   ` Jeff Moyer
2014-11-06 23:46     ` [Ocfs2-devel] " Jeff Moyer
2014-11-06 23:46     ` Jeff Moyer
2014-11-07  4:22     ` Anton Altaparmakov [this message]
2014-11-07  4:22       ` [PATCH v5 7/7] " Anton Altaparmakov
2014-11-07  4:22       ` [Ocfs2-devel] " Anton Altaparmakov
2014-11-07  4:22       ` Anton Altaparmakov
2014-11-07  5:52       ` [fuse-devel] " Anand Avati
2014-11-07  5:52         ` [Ocfs2-devel] " Anand Avati
2014-11-07  6:43         ` Anton Altaparmakov
2014-11-07  6:43           ` Anton Altaparmakov
2014-11-07  6:43           ` [Ocfs2-devel] " Anton Altaparmakov
2014-11-07 14:21           ` Roger Willcocks
2014-11-07 14:21             ` Roger Willcocks
2014-11-07 14:21             ` [Ocfs2-devel] " Roger Willcocks
2014-11-07 14:21             ` Roger Willcocks
2014-11-07 14:21             ` Roger Willcocks
2014-11-07 19:58             ` Milosz Tanski
2014-11-07 19:58               ` [Ocfs2-devel] " Milosz Tanski
2014-11-07 19:58               ` Milosz Tanski
2014-11-10 16:07   ` [PATCH v5 7/7] fs: " Sage Weil
2014-11-10 16:07     ` [Ocfs2-devel] " Sage Weil
2014-11-10 16:07     ` Sage Weil
2014-11-06  7:56 ` [PATCH v5 0/7] vfs: Non-blockling buffered fs read (page cache only) Christoph Hellwig
2014-11-06  7:56   ` Christoph Hellwig
2014-11-06 15:46   ` Milosz Tanski
2014-11-06 15:46     ` Milosz Tanski
2014-11-06 15:44 ` [PATCH v2 1/2] Add preadv2/pwritev2 documentation Milosz Tanski
2014-11-06 15:44   ` Milosz Tanski
2014-11-06 15:44   ` [PATCH v2 2/2] RWF_ODSYNC flag for pwritev2 Milosz Tanski
2014-11-06 15:44     ` Milosz Tanski
2014-11-06 16:16 ` [PATCH v5 0/7] vfs: Non-blockling buffered fs read (page cache only) Milosz Tanski
2014-11-06 16:16   ` Milosz Tanski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BF30FAEC-D4D3-4079-9ECD-2743747279BD@cam.ac.uk \
    --to=aia21@cam.ac.uk \
    --cc=Volker.Lendecke@sernet.de \
    --cc=ceph-devel@vger.kernel.org \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=jmoyer@redhat.com \
    --cc=linux-aio@kvack.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=milosz@adfin.com \
    --cc=mtk.manpages@gmail.com \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=tj@kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.