Re: [RFC PATCH] debugfs - yet another in-kernel file system

From: Josh Boyer
Date: Fri Dec 10 2004 - 11:29:02 EST


On Fri, 2004-12-10 at 09:30, Greg KH wrote:
> >
> > Writing 'Y', 'y', or '1' is allowed, but only 'Y' is ever returned by
> > the read function (similar for the "false" case). That can be confusing
> > to a program if it writes '1', and then checks to see if the value it
> > wrote took and it gets back 'Y'. Maybe only allow what you are going to
> > return for bool values in the write case?
>
> No, this is the exact same way (and pretty much the same code) as the
> module param stuff is in sysfs today. Just trying to be consistant
> here.

Ok. Consistency is a good thing.

>
> > > +#define DEBUG_MAGIC 0x64626720
> >
> > #define DEBUGFS_MAGIC
>
> Hm, ok, sure. That doesn't really matter.

No, not really. Just a nit.

>
> > > +static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, struct dentry *parent, u32 *value)
> > > +{ return EFF_PTR(-ENODEV); }
> >
> > Could these just return NULL perhaps? Would be more like procfs then,
> > which is what I'd assume most drivers will be converting from.
>
> No, see my previous response as to why this would be a bad thing to do.
> We should all learn from the mistakes made in the past and try not to
> repeat them.

Yep, agreed.

josh

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/