lkml.org 
[lkml]   [2018]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] fs: Improve comment of inode_dio_begin
Date
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
\
 
 \ /
  Last update: 2018-02-19 16:21    [W:1.509 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site