Re: a question about clone_mnt in namespace.c

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

 



On Wed, Jun 20, 2012 at 10:54:00AM +0800, yushang wrote:
> Hi dear all,
> I have a question about the mnt_master logic in clone_mnt , look at
> following lines:
> ...
> } else if (!(flag & CL_PRIVATE)) {
>   if ((flag & CL_MAKE_SHARED) || IS_MNT_SHARED(old))
> 	list_add(&mnt->mnt_share, &old->mnt_share);
>   if (IS_MNT_SLAVE(old))
> 	list_add(&mnt->mnt_slave, &old->mnt_slave);
>     mnt->mnt_master = old->mnt_master;
> }
> ...
> I think the following lines are equivalent, right ? or I've missed
> something ? many thanks!
> ...
> } else if (!(flag & CL_PRIVATE)) {
>   if ((flag & CL_MAKE_SHARED) || IS_MNT_SHARED(old))
> 	list_add(&mnt->mnt_share, &old->mnt_share);
>   if (IS_MNT_SLAVE(old)) {
> 	list_add(&mnt->mnt_slave, &old->mnt_slave);
>         mnt->mnt_master = old->mnt_master;
>   }
> }

Yes; we are guaranteed that mnt->master is NULL after alloc_vfsmnt(),
so that would be an equivalent transformation.  Matter of taste,
mostly - performance win is negligible and IMO your variant is
slightly less explicit.
--
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