linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <chao@kernel.org>
To: "gaoxiang (P)" <gaoxiang25@huawei.com>,
	"jaegeuk@kernel.org" <jaegeuk@kernel.org>,
	"Yuchao (T)" <yuchao0@huawei.com>
Cc: "linux-f2fs-devel@lists.sourceforge.net"
	<linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [PATCH] f2fs: allow readpages with NULL file pointer
Date: Thu, 21 Sep 2017 22:33:00 +0800	[thread overview]
Message-ID: <ce60dc40-d2b5-1d89-b050-3314dded93c1@kernel.org> (raw)
In-Reply-To: <9047C53C18267742AB12E43B65C7F9F70BBE4BD7@dggemi505-mbs.china.huawei.com>

On 2017/9/21 13:00, gaoxiang (P) wrote:
> Keep in line with the other Linux file system implementations
> since page_cache_sync_readahead supports NULL file pointer,
> and thus we can readahead data by f2fs itself without file opening
> (something like the btrfs behavior).

Let's keep what it is until there is an example doing readahead passing @file
with NULL.

Thanks,

> 
> Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
> ---
>  fs/f2fs/data.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 95f30f0..afa12f1 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -1333,9 +1333,11 @@ static int f2fs_read_data_pages(struct file *file,
>  			struct address_space *mapping,
>  			struct list_head *pages, unsigned nr_pages)
>  {
> -	struct inode *inode = file->f_mapping->host;
> +	struct inode *inode = mapping->host;
>  	struct page *page = list_last_entry(pages, struct page, lru);
>  
> +	if (likely(file != NULL))
> +		BUG_ON(file->f_mapping != mapping);
>  	trace_f2fs_readpages(inode, page, nr_pages);
>  
>  	/* If the file has inline data, skip readpages */
> 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

  reply	other threads:[~2017-09-21 14:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21  5:00 [PATCH] f2fs: allow readpages with NULL file pointer gaoxiang (P)
2017-09-21 14:33 ` Chao Yu [this message]
2017-09-22  1:54   ` gaoxiang (P)
2017-09-23 12:49     ` Chao Yu
  -- strict thread matches above, loose matches on Subject: below --
2017-09-23 17:42 Hsiang Kao via Linux-f2fs-devel

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=ce60dc40-d2b5-1d89-b050-3314dded93c1@kernel.org \
    --to=chao@kernel.org \
    --cc=gaoxiang25@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=yuchao0@huawei.com \
    /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).