[Devel] Re: [PATCH 20/25] sysfs: Rename Support multiple superblocks
Tejun Heo
htejun at gmail.com
Wed Aug 8 08:50:56 PDT 2007
Eric W. Biederman wrote:
> Welcome. I will see what I can do with respect to cleaning up
> the names.
>
> As for the return value of sysfs_get_dentry that is tricky. In particular
> I have three specific cases the code needs to deal with.
>
> - We got the dentry.
> - We did not get the dentry because for this super block there never
> ever will be a dentry.
> - Some kind of error occurred in attempting to get the dentry.
>
> Not getting a dentry because it is impossible I am currently handling
> with a NULL return. I can equally use a specific error code to mean
> that as well. It doesn't much matter. So I guess the hunk in
> question could read:
>
>>> + list_for_each_entry(sb, &sysfs_fs_type.fs_supers, s_instances) {
>>> + dentry = sysfs_get_dentry(sb, sd);
>>> + if (dentry == ERR_PTR(-ENOENT))
>>> + continue;
>
> As long as we handle that class of error differently I really don't
> care.
Yeah, I think using -ENOENT is better; otherwise, my little head feels
like exploding. :-) More importantly, sysfs_get_dentry() seems like it
would deference ERR_PTR() value. No?
--
tejun
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list