From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 19 Feb 2018 08:00:34 -0800 From: Matthew Wilcox To: Nikolay Borisov Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Subject: Re: [PATCH] fs: Improve comment of inode_dio_begin Message-ID: <20180219160034.GC24352@bombadil.infradead.org> References: <1519053629-14114-1-git-send-email-nborisov@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1519053629-14114-1-git-send-email-nborisov@suse.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: On Mon, Feb 19, 2018 at 05:20:29PM +0200, Nikolay Borisov wrote: > +++ 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) > { Thanks for the patch! It'd be nice if it used the kernel-doc annotations for Context: to document the locking requirements. Also, I find the wording a little confusing. How does the following look? * Mark the inode as having direct I/O in progress. This causes callers * of inode_dio_wait() to block until the I/O has completed. * * Context: Process context. Caller should hold a lock that callers of * inode_dio_wait() also hold (usually inode_lock, but this depends on * the filesystem).