All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@redhat.com>
To: jim owens <owens6336@gmail.com>
Cc: Josef Bacik <josef@redhat.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>,
	Chris Mason <chris.mason@oracle.com>
Subject: Re: [PATCH V2] Btrfs: Full direct I/O and AIO read implementation.
Date: Tue, 16 Feb 2010 14:39:59 -0500	[thread overview]
Message-ID: <20100216193958.GD17106@localhost.localdomain> (raw)
In-Reply-To: <4B7AF1C0.6030904@gmail.com>

On Tue, Feb 16, 2010 at 02:28:00PM -0500, jim owens wrote:
> Josef Bacik wrote:
>> On Wed, Feb 10, 2010 at 01:53:50PM -0500, jim owens wrote:
>>> +
>>> +static int btrfs_dio_hole_read(struct btrfs_diocb *diocb, u64 hole_len)
>>> +{
>>> +	int err = 0;
>>> +	diocb->umc.todo = hole_len;
>>> +	while (diocb->umc.todo) {
>>> +		struct bio_vec uv;
>>> +		char *out;
>>> +
>>> +		err = btrfs_dio_get_user_bvec(&uv, &diocb->umc);
>>> +		if (err)
>>> +			goto fail;
>>> +		diocb->start += uv.bv_len;
>>> +		out = kmap_atomic(uv.bv_page, KM_USER0);
>>> +		memset(out + uv.bv_offset, 0, uv.bv_len);
>>> +		kunmap_atomic(out, KM_USER0);
>>> +
>>
>> /me hands jim a zero_user_page()
>>
>>> +		btrfs_dio_done_with_out(&uv, NULL);
>>> +	}
>
> As promised... why I'm keeping my code :)
>
> cscope says there is no zero_user_page() so I think
> you mean the same one I looked at zero_user(), which
> calls the far more complicated zero_user_segments().
>
> I did not use it for 3 reasons:
>
> 1) More generated code (but maybe gcc reduces it).
>
> 2) My btrfs_dio_done_with_out() must do (so repeat) the
> flush_dcache_page which is not a noop on every arch.
>
> 3) Everywhere else in btrfs does the same as my code.
>

Hmm I swore it was zero_user_page but now I can't find it.  Yeah the extra
flush_dcace_page is reason enough to not use it, seems reasonable enough to me.
Thanks,

Josef

  reply	other threads:[~2010-02-16 19:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-10 18:53 [PATCH V2] Btrfs: Full direct I/O and AIO read implementation jim owens
2010-02-12 19:28 ` Josef Bacik
2010-02-14  1:30   ` jim owens
2010-02-15 16:42     ` Chris Mason
2010-02-15 19:18       ` jim owens
2010-02-16 16:01         ` Chris Mason
2010-02-16 17:09           ` jim owens
2010-02-15 21:58       ` Christoph Hellwig
2010-02-15 22:26         ` jim owens
2010-02-15 22:32           ` Christoph Hellwig
2010-02-15 22:40             ` jim owens
2010-02-16 15:49               ` Chris Mason
2010-02-15 22:01     ` rk
2010-02-15 22:31       ` jim owens
2010-02-16 19:28   ` jim owens
2010-02-16 19:39     ` Josef Bacik [this message]
2010-03-03 18:54       ` jim owens

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=20100216193958.GD17106@localhost.localdomain \
    --to=josef@redhat.com \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=owens6336@gmail.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 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.