Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\cgroup\cgroup-v1.c Create Date:2022-07-28 11:13:11
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:group_rename - Only allow simple rename of directories in place.

Proto:static int cgroup1_rename(struct kernfs_node *kn, struct kernfs_node *new_parent, const char *new_name_str)

Type:int

Parameter:

TypeParameterName
struct kernfs_node *kn
struct kernfs_node *new_parent
const char *new_name_str
821  cgrp = priv
824  If kernfs_type(kn) != KERNFS_DIR Then Return -ENOTDIR
826  If * Use kernfs_get_parent() and kernfs_name/path() instead of * accessing the following two fields directly. If the node is * never moved to a different parent, it is safe to access the * parent directly. != new_parent Then Return -EIO
834  kernfs_break_active_protection(new_parent)
835  kernfs_break_active_protection(kn)
837  mutex_lock( & cgroup_mutex is the master lock)
839  ret = kernfs_rename(kn, new_parent, new_name_str)
840  If Not ret Then cgroup_path() takes a spin lock(rename, cgrp)
843  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
845  kernfs_unbreak_active_protection(kn)
846  kernfs_unbreak_active_protection(new_parent)
847  Return ret