dir.c (552c69b36ebd966186573b9c7a286b390935cce1) dir.c (488dee96bb62f0b3d9e678cf42574034d5b033a5)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * fs/sysfs/dir.c - sysfs core and dir operation implementation
4 *
5 * Copyright (c) 2001-3 Patrick Mochel
6 * Copyright (c) 2007 SUSE Linux Products GmbH
7 * Copyright (c) 2007 Tejun Heo <teheo@suse.de>
8 *

--- 38 unchanged lines hidden (view full) ---

47 parent = kobj->parent->sd;
48 else
49 parent = sysfs_root_kn;
50
51 if (!parent)
52 return -ENOENT;
53
54 kn = kernfs_create_dir_ns(parent, kobject_name(kobj),
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * fs/sysfs/dir.c - sysfs core and dir operation implementation
4 *
5 * Copyright (c) 2001-3 Patrick Mochel
6 * Copyright (c) 2007 SUSE Linux Products GmbH
7 * Copyright (c) 2007 Tejun Heo <teheo@suse.de>
8 *

--- 38 unchanged lines hidden (view full) ---

47 parent = kobj->parent->sd;
48 else
49 parent = sysfs_root_kn;
50
51 if (!parent)
52 return -ENOENT;
53
54 kn = kernfs_create_dir_ns(parent, kobject_name(kobj),
55 S_IRWXU | S_IRUGO | S_IXUGO, kobj, ns);
55 S_IRWXU | S_IRUGO | S_IXUGO,
56 GLOBAL_ROOT_UID, GLOBAL_ROOT_GID,
57 kobj, ns);
56 if (IS_ERR(kn)) {
57 if (PTR_ERR(kn) == -EEXIST)
58 sysfs_warn_dup(parent, kobject_name(kobj));
59 return PTR_ERR(kn);
60 }
61
62 kobj->sd = kn;
63 return 0;

--- 93 unchanged lines hidden ---
58 if (IS_ERR(kn)) {
59 if (PTR_ERR(kn) == -EEXIST)
60 sysfs_warn_dup(parent, kobject_name(kobj));
61 return PTR_ERR(kn);
62 }
63
64 kobj->sd = kn;
65 return 0;

--- 93 unchanged lines hidden ---