mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 06:32:08 +00:00
kernfs: add exportfs operations
Now we have the facilities to implement exportfs operations. The idea is cgroup can export the fhandle info to userspace, then userspace uses fhandle to find the cgroup name. Another example is userspace can get fhandle for a cgroup and BPF uses the fhandle to filter info for the cgroup. Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
c53cd490b1
commit
aa81882534
3 changed files with 70 additions and 1 deletions
|
@ -69,6 +69,12 @@ enum kernfs_root_flag {
|
|||
* following flag enables that behavior.
|
||||
*/
|
||||
KERNFS_ROOT_EXTRA_OPEN_PERM_CHECK = 0x0002,
|
||||
|
||||
/*
|
||||
* The filesystem supports exportfs operation, so userspace can use
|
||||
* fhandle to access nodes of the fs.
|
||||
*/
|
||||
KERNFS_ROOT_SUPPORT_EXPORTOP = 0x0004,
|
||||
};
|
||||
|
||||
/* type-specific structures for kernfs_node union members */
|
||||
|
@ -98,6 +104,12 @@ struct kernfs_elem_attr {
|
|||
/* represent a kernfs node */
|
||||
union kernfs_node_id {
|
||||
struct {
|
||||
/*
|
||||
* blktrace will export this struct as a simplified 'struct
|
||||
* fid' (which is a big data struction), so userspace can use
|
||||
* it to find kernfs node. The layout must match the first two
|
||||
* fields of 'struct fid' exactly.
|
||||
*/
|
||||
u32 ino;
|
||||
u32 generation;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue