linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: viro@zeniv.linux.org.uk
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	axboe@fb.com, Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH] fs: Improve comment of inode_dio_begin
Date: Mon, 19 Feb 2018 17:20:29 +0200	[thread overview]
Message-ID: <1519053629-14114-1-git-send-email-nborisov@suse.com> (raw)

Firstly, the description of the function was a direct copy/paste of
inode_dio_end and as such made no sense. So rewrite it to correctly
state this is used before starting an io. Also document the locking
requirements, since currently one has to look at the definition of
inode_dio_wait to see the requirement of a lock being held while
bumping i_dio_count.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 include/linux/fs.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 511fbaabf624..90ac851930ae 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -3015,8 +3015,10 @@ void inode_dio_wait(struct inode *inode);
  * inode_dio_begin - signal start of a direct I/O requests
  * @inode: inode the direct I/O happens on
  *
- * This is called once we've finished processing a direct I/O request,
- * and is used to wake up callers waiting for direct I/O to be quiesced.
+ * This is called before we begin processing a direct I/O request,
+ * and is used to quiesce callers of inode_dio_wait. It must be
+ * called under a lock that serialising getting a reference to
+ * ->i_dio_count (usually the inode_lock)
  */
 static inline void inode_dio_begin(struct inode *inode)
 {
-- 
2.7.4

             reply	other threads:[~2018-02-19 15:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-19 15:20 Nikolay Borisov [this message]
2018-02-19 16:00 ` [PATCH] fs: Improve comment of inode_dio_begin Matthew Wilcox

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=1519053629-14114-1-git-send-email-nborisov@suse.com \
    --to=nborisov@suse.com \
    --cc=axboe@fb.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).