bug-coreutils
[Top][All Lists]
Advanced

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

Re: Add concurrent I/O support to gnu dd


From: Matt Harden
Subject: Re: Add concurrent I/O support to gnu dd
Date: Sun, 21 Dec 2008 22:19:52 -0600
User-agent: Mutt/1.5.16 (2007-06-09)

On Sat, Dec 20, 2008 at 09:55:55AM +0100, Jim Meyering wrote:
> "Matt Harden" <address@hidden> wrote:
> > I'd like to suggest adding the ability to dd(1) to open the file in
> > concurrent I/O mode.  This applies only to AIX systems and the JFS2
> > filesystem.  I had a need to do this and was able to do it easily thanks
> > to the design of coreutils.  As a sysadmin sometimes you have to open a
> > file in CIO mode because if any other program has the file open already
> > in CIO mode, the OS will not allow it to be opened in "normal" mode.
> > Also when using CIO mode, I/O that is not block-aligned is very slow.
> > This makes dd a good utility for copying data to/from files in CIO mode.
> >
> > Anyway, here are some simple patches to coreutils and gnulib that give this
> > capability to dd.
> 
> Thanks for the contribution.
> This is small enough, and your first, so you don't need
> a copyright assignment.  However, if you don't mind doing
> a little more work, it would accelerate the acceptance of this
> change:
> 
>     write an entry in NEWS, under "New features" (note that they're
>     alphabetized on tool name)
> 
>     don't say that O_CIO is AIX/JFS2-specific:
>     a quick search suggests HP-UX also honors it, and it can be
>     useful on VxFS, e.g.,
>       
> https://vias.symantec.com/docportal/sf/5.0/hpux/html/fs_ref/pr_ch_fsio_fs5.html

I didn't know that.  It appears to be a more recent development outside of AIX.
> 
>     also, see the contribution guidelines in HACKING for the recommended
>     use of "git format-patch" to prepare a change set.  i.e., write a
>     commit log entry that mentions each affected file, using the same
>     format as other log entries.

OK.

> > diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
> > index fd7520e..dea7449 100644
> > --- a/lib/fcntl.in.h
> > +++ b/lib/fcntl.in.h
> > @@ -70,6 +70,10 @@ extern void _gl_register_fd (int fd, const char 
> > *filename);
> >
> >  /* Fix up the O_* macros.  */
> >
> > +#ifndef O_CIO
> > +# define O_CIO 0
> > +#endif
> 
> I'd rather not make this change to gnulib's fcntl.in.h
> right now, since it would make code that tests for the existence
> of O_CIO using "#ifndef O_CIO" mistakenly determine that
> it's supported.
> So please move that change into dd.c.

You have the exact same situation with O_DIRECT, O_DSYNC, O_NDELAY,
and the rest right now.  I'm sure you're well aware of that however,
so I've gone ahead and done what you asked.

Also I noticed I had left O_CIO out of the section that chooses a unique
value for O_FULLBLOCK so I added it there as well.

Patch in git format-patch format attached.

Thanks,
Matt

Attachment: add_dd_cio_support.patch
Description: add_dd_cio_support.patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]