Re: [RFC PATCH] vfs: add permute operation

2013-05-30 Thread J. R. Okajima
Linus Torvalds: > On Thu, May 30, 2013 at 5:45 PM, Miklos Szeredi wrote: > > > > The third name is because of the replace-empty-directory wart in the > > rename(2) definition. With overlay/union that can become > > > > 1) check if destination directory is empty: upper directory contains a > >

Re: [RFC PATCH] vfs: add permute operation

2013-05-30 Thread Miklos Szeredi
On Thu, May 30, 2013 at 11:11 AM, Linus Torvalds wrote: > On Thu, May 30, 2013 at 5:45 PM, Miklos Szeredi wrote: >> 1) check if destination directory is empty: upper directory contains a >> whiteout for each lower directory entry and nothing else >> 2) if empty then remove whiteouts in destin

Re: [RFC PATCH] vfs: add permute operation

2013-05-30 Thread Linus Torvalds
On Thu, May 30, 2013 at 5:45 PM, Miklos Szeredi wrote: > > The third name is because of the replace-empty-directory wart in the > rename(2) definition. With overlay/union that can become > > 1) check if destination directory is empty: upper directory contains a > whiteout for each lower directo

Re: [RFC PATCH] vfs: add permute operation

2013-05-29 Thread Zach Brown
> >> +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? > > AFAICS, I cannot make the compare function transitive, e.g.:

Re: [RFC PATCH] vfs: add permute operation

2013-05-29 Thread Miklos Szeredi
On Tue, May 28, 2013 at 7:36 PM, Zach Brown wrote: > 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 spe

Re: [RFC PATCH] vfs: add permute operation

2013-05-28 Thread Zach Brown
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

[RFC PATCH] vfs: add permute operation

2013-05-27 Thread Miklos Szeredi
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. The current implementation allows two or three objects to be permuted. More than three would complicate it too much without a