Accessing allocated space in a debugfs file

Greg KH greg at kroah.com
Fri Oct 2 07:35:11 EDT 2020


On Fri, Oct 02, 2020 at 04:59:24PM +0530, ymdatta wrote:
> On 30/09/20 11:19 pm, Greg KH wrote:
> > On Wed, Sep 30, 2020 at 10:32:05PM +0530, ymdatta wrote:
> 
> >>
> >> I want to write in this file, how should i be accessing the space created
> >> from previous function call.
> > 
> > That's not what "size" means here.  "size" just sets the value that you
> > see if you look at the directory for that debugfs file (or stat() it).
> > 
> 
> Didn't realize this. Why do we need this then? What does this 'size' help
> in achieving (or) where is this used?

People like to have pretty values visable in userspace for looking at
files before opening them :)

Right now there are only a handful of users of that "option", compared
with the thousands of "normal" debugfs files.  Look at the callers of
that function for why it might make sense for that option being used
here.

good luck!

greg k-h



More information about the Kernelnewbies mailing list