From: Joel Becker <Joel.Becker@oracle.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Fasheh <mfasheh@suse.com>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
ocfs2-devel@oss.oracle.com
Subject: Re: [GIT PULL] ocfs2 changes for 2.6.32
Date: Tue, 15 Sep 2009 21:40:48 -0700 [thread overview]
Message-ID: <20090916044047.GA30453@mail.oracle.com> (raw)
In-Reply-To: <alpine.LFD.2.01.0909152116180.4950@localhost.localdomain>
On Tue, Sep 15, 2009 at 09:20:47PM -0700, Linus Torvalds wrote:
> On Tue, 15 Sep 2009, Joel Becker wrote:
> >
> > Perhaps ->copyfile takes the following flags:
> >
> > #define ALLOW_COW_SHARED 0x0001
> > #define REQUIRE_COW_SHARED 0x0002
> > #define REQUIRE_BASIC_ATTRS 0x0004
> > #define REQUIRE_FULL_ATTRS 0x0008
> > #define REQUIRE_ATOMIC 0x0010
> > #define SNAPSHOT (REQUIRE_COW_SHARED |
> > REQUIRE_BASIC_ATTRS |
> > REQUIRE_ATOMIC)
> > #define SNAPSHOT_PRESERVE (SNAPSHOT | REQUIRE_FULL_ATTRS)
> >
> > Thus, sys_reflink/sys_snapfile(oldpath, newpath, 0) becomes:
> > ...
>
> Yes. The above all sounds sane to me.
Ok. Where do you see the exposure level? What I mean is, I
just defined a vfs op that handles these things, but accessed it via two
syscalls, sys_snapfile() and sys_copyfile(). We could also just provide
one system call and allow userspace to use these flags itself, creating
snapfile(3) and copyfile(3) in libc, hiding the details (kind of like
clone being hidden by pthreads, though ignoring that pthreads has
"issues"). Or we could explicitly make this the public API and expect
something like cp(1) to directly use the flags. Thoughts?
> I still worry that especially the non-atomic case will want some kind of
> partial-copy updates (think graphical file managers that want to show the
> progress of the copy), and that (think EINTR and continuing) makes me
> think "that could get really complex really quickly", but that's something
> that the NFS/SMB people would have to pipe up on. I'm pretty sure the NFS
> spec has some kind "partial completion notification" model, I dunno about
> SMB.
I'm really wary of combining a ranged interface with this one.
Not only does it make no sense for snapshots, but I think it falls down
in any "create a new inode" scheme entirely.
btrfs has an ioctl that basically says "link up range x->y of
file 1 to file 2". Chris is using the underlying machinery to implement
reflink, but I think the concept actually would work nicely as a splice
flag. If you have two existing files, not creating one, you can just
ask splice to do efficient things with a SPLICE_F_EFFICIENT_COPY for
yoru CIFS COPY-style thing or SPLICE_F_COW_COPY for btrfs- and
ocfs2-style data sharing.
Joel
--
"Nothing is wrong with California that a rise in the ocean level
wouldn't cure."
- Ross MacDonald
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127
next prev parent reply other threads:[~2009-09-16 4:42 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-11 20:04 [GIT PULL] ocfs2 changes for 2.6.32 Joel Becker
2009-09-14 21:32 ` Linus Torvalds
2009-09-14 22:14 ` Joel Becker
2009-09-14 23:27 ` Linus Torvalds
2009-09-15 0:04 ` Joel Becker
2009-09-15 0:31 ` Linus Torvalds
2009-09-15 0:54 ` Joel Becker
2009-09-15 2:01 ` Linus Torvalds
2009-09-15 4:05 ` Arjan van de Ven
2009-09-15 4:35 ` Joel Becker
2009-09-15 4:06 ` Joel Becker
2009-09-15 16:30 ` Linus Torvalds
2009-09-15 21:45 ` Joel Becker
2009-09-16 4:20 ` Linus Torvalds
2009-09-16 4:40 ` Joel Becker [this message]
2009-09-17 16:29 ` Linus Torvalds
2009-09-17 16:38 ` Arjan van de Ven
2009-09-17 20:16 ` Linus Torvalds
2009-09-17 18:40 ` Roland Dreier
2009-09-17 20:17 ` Linus Torvalds
2009-09-17 20:34 ` Joel Becker
2009-09-18 0:29 ` Linus Torvalds
2009-09-17 20:42 ` Roland Dreier
2009-09-17 20:55 ` Linus Torvalds
2009-09-18 1:43 ` [Ocfs2-devel] " Joel Becker
2009-09-18 13:34 ` Pádraig Brady
2009-09-18 18:37 ` Joel Becker
2009-09-18 17:23 ` Peter W. Morreale
2009-09-18 18:39 ` Joel Becker
2009-09-15 6:44 ` Miklos Szeredi
2009-09-23 11:02 ` [GIT PULL] ocfs2 changes for 2.6.32 (take 2, no syscall) Joel Becker
-- strict thread matches above, loose matches on Subject: below --
2009-09-22 0:51 [GIT PULL] ocfs2 changes for 2.6.32 George Spelvin
2009-09-22 3:28 George Spelvin
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=20090916044047.GA30453@mail.oracle.com \
--to=joel.becker@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mfasheh@suse.com \
--cc=ocfs2-devel@oss.oracle.com \
--cc=torvalds@linux-foundation.org \
/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