mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
cgroup: export fhandle info for a cgroup
Add an API to export cgroup fhandle info. We don't export a full 'struct file_handle', there are unrequired info. Sepcifically, cgroup is always a directory, so we don't need a 'FILEID_INO32_GEN_PARENT' type fhandle, we only need export the inode number and generation number just like what generic_fh_to_dentry does. And we can avoid the overhead of getting an inode too, since kernfs_node_id (ino and generation) has all the info required. Acked-by: Tejun Heo <[email protected]> Signed-off-by: Shaohua Li <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
1 parent
aa81882534
commit
121508df44
1 file changed
+8
@@ -609,6 +609,10 @@ static inline void cgroup_kthread_ready(void)
|
||||
current->no_cgroup_migration = 0;
|
||||
}
|
||||
|
||||
static inline union kernfs_node_id *cgroup_get_kernfs_id(struct cgroup *cgrp)
|
||||
{
|
||||
return &cgrp->kn->id;
|
||||
}
|
||||
#else /* !CONFIG_CGROUPS */
|
||||
|
||||
struct cgroup_subsys_state;
|
||||
@@ -631,6 +635,10 @@ static inline int cgroup_init_early(void) { return 0; }
|
||||
static inline int cgroup_init(void) { return 0; }
|
||||
static inline void cgroup_init_kthreadd(void) {}
|
||||
static inline void cgroup_kthread_ready(void) {}
|
||||
static inline union kernfs_node_id *cgroup_get_kernfs_id(struct cgroup *cgrp)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline bool task_under_cgroup_hierarchy(struct task_struct *task,
|
||||
struct cgroup *ancestor)
|
||||
|
||||
Reference in new issue
Block a user