lkml.org 
[lkml]   [2013]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] drivers: base: dynamic memory block creation
On 08/14/2013 02:37 PM, Cody P Schafer wrote:
> Also, I'd expect userspace tools might use readdir() to find out what
> memory blocks a system has (unless they just stat("memory0"),
> stat("memory1")...). I don't think filesystem tricks (at least within
> sysfs) are going to let this magically be solved without breaking the
> userspace API.

sysfs files are probably a bit too tied to kobjects to make this work
easily in practice. It would probably need to be a new filesystem, imnho.

But, there's nothing to keep you from creating dentries for all of the
memory blocks if someone _does_ a readdir(). It'll suck, of course, but
it's at least compatible with what's there. You could also 'chmod -x'
it to make it more obvious that folks shouldn't be poking around in
there, although it won't keep them from ls'ing. If you're concerned
about resource consumption, we could also just make the directory
unreadable to everyone but root.


\
 
 \ /
  Last update: 2013-08-15 00:21    [W:0.068 / U:1.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site