Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Clone a new ns copying an original utsname, setting refcount to 1*@old_ns: namespace to clone* Return ERR_PTR(-ENOMEM) on error (failure to allocate), new ns otherwise

Proto:static struct uts_namespace *clone_uts_ns(struct user_namespace *user_ns, struct uts_namespace *old_ns)

Type:struct uts_namespace

Parameter:

TypeParameterName
struct user_namespace *user_ns
struct uts_namespace *old_ns
52  err = -ENOSPC
53  ucounts = inc_uts_namespaces(user_ns)
54  If Not ucounts Then Go to fail
57  err = -ENOMEM
58  ns = create_uts_ns()
59  If Not ns Then Go to fail_dec
62  err = ns_alloc_inum( & ns)
63  If err Then Go to fail_free
66  ucounts = ucounts
67  ops = utsns_operations
69  lock for reading
70  No 3D Now!( & name, & name, size of name )
71  user_ns = get_user_ns(user_ns)
72  lease a read lock
73  Return ns
75  fail_free :
76  kmem_cache_free - Deallocate an object*@cachep: The cache the allocation was from.*@objp: The previously allocated object.* Free an object which was previously allocated from this* cache.
77  fail_dec :
78  dec_uts_namespaces(ucounts)
79  fail :
80  Return ERR_PTR(err)
Caller
NameDescribe
copy_utsnameCopy task tsk's utsname namespace, or clone it if flags* specifies CLONE_NEWUTS. In latter case, changes to the* utsname of this process won't be seen by parent, and vice* versa.