Re: [RFC PATCH] vfs: add permute operation

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

 



On Tue, May 28, 2013 at 7:36 PM, Zach Brown <zab@xxxxxxxxxx> 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 specific name than 'permute'?  To me,
> ->permute() tells me just as much about the operation as
> ->do_something().  {multi,bulk,mass}_rename()?  renamev()?

It's not just plain muti-rename, but a cyclic one.  Maybe cyclic_rename()?

>> +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.:  A is
descendant of C but B is unrelated.  Then what should cmp(A, B) and
cmp(B, C) return?

>
>> +     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?

I could be more consistent with the BUGs.  Doing it with 3 args is not
necessarily good, since then we can't do loops and the chance of a
copy-paste error is increased.

Thanks,
Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux