Re: What's the "prepare_discard_fn" supposed to do?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx                              Intel Corporation

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux