Re: [PATCH 2/3] shmem: Introduce /sys/fs/tmpfs support

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

 



Amir Goldstein <amir73il@xxxxxxxxx> writes:

>> +static int shmem_register_sysfs(struct super_block *sb)
>> +{
>> +       int err;
>> +       struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
>> +       __kernel_fsid_t fsid = uuid_to_fsid(sb->s_uuid.b);
>> +
>> +       init_completion(&sbinfo->s_kobj_unregister);
>> +       err = kobject_init_and_add(&sbinfo->s_kobj, &tmpfs_sb_ktype, shmem_root,
>> +                                  "%x%x", fsid.val[0], fsid.val[1]);
>
> uuid (and fsid) try to be unique across tmpfs instances from different times.
> You don't need that.
> I think you'd rather use s_dev (minor number) which is unique among all tmpfs
> instances at a given time and also much easier from user scripts to read from
> (e.g. stat or /proc/self/mountinfo).
>
> That's btw the same number is used as an entry in /sys/fs/fuse/connections
> (fusectl pseudo fs).

Hi Amir, thanks for the review.

Sounds good.  I will follow up with a new version that uses
MINOR(sb->s_dev).

Thank you,


-- 
Gabriel Krisman Bertazi




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux