lkml.org 
[lkml]   [2018]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 0/7] Enable UFS provisioning via Linux
Date
On Tue, 2018-06-12 at 12:42 -0700, Evan Green wrote:
> What I _want_ to do is basically create N sysfs groups, where each
> group points to the same array of attributes. Then in the show/store
> methods, look up which group I'm in and use that as an index. But the
> show/store functions only pass the attributes themselves, and there
> seems to be no way for me to get the parent node.

The first argument that is passed to sysfs show and store methods is
a kobject pointer. Have you considered to access kobject.parent from
inside the show/store methods? From fs/sysfs/file.c:

if (ops->show) {
count = ops->show(kobj, of->kn->priv, buf);
if (count < 0)
return count;
}

Bart.



\
 
 \ /
  Last update: 2018-06-12 22:12    [W:1.059 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site