From: David Woodhouse <dwmw2@infradead.org>
To: Chris Worley <worleys@gmail.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: What's the "prepare_discard_fn" supposed to do?
Date: Thu, 02 Oct 2008 14:52:04 +0100 [thread overview]
Message-ID: <1222955524.3518.400.camel@macbook.infradead.org> (raw)
In-Reply-To: <f3177b9e0810020645x66fdc70aicd44cdeb69b2fb77@mail.gmail.com>
On Thu, 2008-10-02 at 07:45 -0600, Chris Worley wrote:
> In perusing the "discard-2.6" kernel at infradead.org (great job... I
> have a device I'm testing it on, and it's working), I'm unclear on
> what I'm supposed to do in the prepare_discard_fn function.
>
> It looks like, if it exists, the the discard bio gets passed to the
> normal handler. Otherwise, it seems to have no duties. I'm guessing
> it's for whatever initialization is needed for the device... but
> checking to be sure.
It's intended to prepare the command which will be sent to the device,
much like the prepare_flush_fn does. See sd_prepare_flush() in
drivers/scsi/sd.c for an example (all the devices we've hooked up for
discard in Linux so far are virtual ones, so they don't make good
examples). I do have a real ATA drive with TRIM protocol support on its
way to me though, so I'll be looking at that some time soon.
--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation
next prev parent reply other threads:[~2008-10-02 13:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-02 13:45 What's the "prepare_discard_fn" supposed to do? Chris Worley
2008-10-02 13:52 ` David Woodhouse [this message]
2008-10-03 6:48 ` Artem Bityutskiy
2008-10-03 6:53 ` David Woodhouse
2008-10-10 12:58 ` 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=1222955524.3518.400.camel@macbook.infradead.org \
--to=dwmw2@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=worleys@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 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).