Re: dd PATCH: add conv=direct

From: Andy Isaacson
Date: Wed Apr 07 2004 - 14:27:02 EST


On Wed, Apr 07, 2004 at 11:18:41AM -0700, Andrew Morton wrote:
> Andy Isaacson <adi@xxxxxxxxxxxxx> wrote:
> > > While you're there, please add an fsync-before-closing option.
> >
> > Easy enough. How does this look? Note that C_TWOBUFS ensures the
> > output buffer is getpagesize()-aligned.
>
> Looks nice and simple. You'll need an ext2 filesystem to test it under 2.4.

I tested against a block device. Easier to just "swapoff /dev/hda2"
than to find space to make a new filesystem.

> Be aware that it's rather a challenge to actually get the O_DIRECT #define
> in scope under some glibc versions. I think you need to define _GNU_SOURCE
> or something like that.

Yeah, I had to -D_GNU_SOURCE to build standalone, but coreutils'
makefile seems to do OK.

Would there be any reason to allow O_DIRECT on the read side?

-andy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/