lkml.org 
[lkml]   [2013]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] vfs: add permute operation
Some quick thoughts:

> Permute the location of files. E.g. 'permute(A, B, C)' is equivalent to A->B,
> B->C and C->A. This is essentially a series of renames done as a single atomic
> operation.

Hmm. Can we choose a more specific name than 'permute'? To me,
->permute() tells me just as much about the operation as
->do_something(). {multi,bulk,mass}_rename()? renamev()?

Maybe it's just me.

> to be done as an atomic operation. We could add whiteout support to filesystem
> ops to perform the creation or removal of whiteouts atomically, but it would
> complicate many filesystem ops needlessly.
>
> Alternatively we can add a generic permute operation and add whiteout support to
> the VFS which utilizes this to perform the operations atomically.

I certainly like the sound of this.

> +static void sort_parents3(struct dentry **p)
> +void sort_parents(struct dentry **p, unsigned *nump)

Yikes, that's a bunch of fiddly code. Is it *really* worth all that to
avoid calling the generic sort helpers?

> + if (WARN_ON(num > PERMUTE_MAX) ||
> + WARN_ON(num < 2))
> + return -EINVAL;

And in other places this is a BUG? Why not, like the syscall, limit the
arguments to three if we're serious about that limitation?

- z


\
 
 \ /
  Last update: 2013-05-28 20:21    [W:0.120 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site