Re: [PATCH] overlay: hardlink all whiteout files into a single whiteout

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

 



On Thu, Jan 25, 2018 at 12:17 PM, Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
> On Thu, Jan 25, 2018 at 10:58 AM, Hou Tao <houtao1@xxxxxxxxxx> wrote:
>> Now each whiteout file will be assigned a new inode. To reduce the
>> overhead of allocating and freeing inodes in upper fs, creating a
>> whiteout file under workbasedir and hardlink all whiteout files into it.
>>
>> The effect is obvious: under my VM, the time used for removing the
>> linux kernel source tree will be reduced from 17s to 10s.
>>
>> Got the idea from autofs.
>
> Yep, this was talked about, then forgotten.  Thanks for bringing it up.
>
> The implementation is a little more difficult though, because there's
> a limit to how many hard links to a single file are allowed.
>
> So it should be something like:
>
> - try hard linking "singleton", if succeeds then fine
> - else unlink old singleton from workdir, create new one and use that one
(only in case link error is EMLINK)
- else if error is EXDEV then upper probably has a project id different
than the singleton, so fall back to no hardlink

>
> If it's possible to get a filesystem as upper that doesn't support
> hard links at all, then that also needs to be taken care of, to fall
> back to non-hard linked whiteouts.

Chengguang's patch for project id already does a test link on
mount, so that is a good starting point. if link fails and NOT because
of EXDEV, then index also cannot be used...

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



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux