On Tue, 2006-05-23 at 13:23 +1200, Sam Vilain wrote:
>
> + /* map the filename to the pointer. perhaps it would be
> better
> + to put struct offset pointers in table->data ? */
> + switch (filp->f_dentry->d_name.name[3]) {
> + case 'y': /* ostYpe */
> + which = uts_ns->name.sysname;
> + break;
> + case 't': /* hosTname */
> + which = uts_ns->name.nodename;
> + break;
> + case 'e': /* osrElease */
> + which = uts_ns->name.release;
> + break;
> + case 's': /* verSion */
> + which = uts_ns->name.version;
> + break;
> + case 'x': /* XXX - unreachable */
> + which = uts_ns->name.machine;
> + break;
> + case 'a': /* domAinname */
> + which = uts_ns->name.domainname;
> + break;
> + default:
> + printk("procfs: impossible uts part '%s'",
> + (char*)filp->f_dentry->d_name.name);
> + r = -EINVAL;
> + goto out;
> + }
Why not just switch on the ->ctl_name from the table? Wouldn't that be
easier?
-- Dave
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]