[overlay] what's the purpose for setting RENAME_EXCHANGE when dest is WHITEOUT dev

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

 



Hi,
  I read the source code of overlay fs, it's amazing, but a few
confusion for the rename2 function.

  Here is the code:
799     if (overwrite) {

800         if (old_opaque) {
801             if (new->d_inode || !new_opaque) {
802                 /* Whiteout source */
803                 flags |= RENAME_WHITEOUT;
804             } else {
805                 /* Switch whiteouts */
806                 flags |= RENAME_EXCHANGE;
807             }
808         } else if (is_dir && !new->d_inode && new_opaque) {
809             flags |= RENAME_EXCHANGE;
                  ^^^^^^^^^^Is necessary to use RENAME_EXCHANGE? why
not let vfs_rename to remove the new(dest) entry?
810             cleanup_whiteout = true;
811         }
812     }

  Thanks,
  George.Wang
--
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