blob: 0050cc0c0236de8a13166dd100076651e95c0cad [file] [log] [blame]
Greg Kroah-Hartman619daee2018-01-22 16:18:13 +01001/* SPDX-License-Identifier: GPL-2.0 */
Tejun Heo6d66f5c2007-09-20 17:31:38 +09002/*
3 * fs/sysfs/sysfs.h - sysfs internal header file
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>
Tejun Heo6d66f5c2007-09-20 17:31:38 +09008 */
9
Tejun Heoae6621b2013-11-28 14:54:31 -050010#ifndef __SYSFS_INTERNAL_H
11#define __SYSFS_INTERNAL_H
David P. Quigleyddd29ec2009-09-09 14:25:37 -040012
Tejun Heoae6621b2013-11-28 14:54:31 -050013#include <linux/sysfs.h>
Tejun Heofb6896d2007-06-14 04:27:24 +090014
Tejun Heo59f69012007-09-20 16:05:10 +090015/*
16 * mount.c
17 */
Tejun Heo324a56e2013-12-11 14:11:53 -050018extern struct kernfs_node *sysfs_root_kn;
Linus Torvalds1da177e2005-04-16 15:20:36 -070019
Tejun Heo59f69012007-09-20 16:05:10 +090020/*
21 * dir.c
22 */
Tejun Heo0cae60f2013-10-30 10:28:36 -040023extern spinlock_t sysfs_symlink_target_lock;
Tejun Heo59f69012007-09-20 16:05:10 +090024
Tejun Heo324a56e2013-12-11 14:11:53 -050025void sysfs_warn_dup(struct kernfs_node *parent, const char *name);
Tejun Heo59f69012007-09-20 16:05:10 +090026
Tejun Heo59f69012007-09-20 16:05:10 +090027/*
Tejun Heo59f69012007-09-20 16:05:10 +090028 * file.c
29 */
Tejun Heo324a56e2013-12-11 14:11:53 -050030int sysfs_add_file_mode_ns(struct kernfs_node *parent,
Tejun Heoa7dc66d2013-11-28 14:54:23 -050031 const struct attribute *attr, bool is_bin,
Dmitry Torokhov5f818802018-07-20 21:56:48 +000032 umode_t amode, kuid_t uid, kgid_t gid,
33 const void *ns);
Tejun Heo73d97142013-10-01 17:42:07 -040034
Tejun Heo59f69012007-09-20 16:05:10 +090035/*
Tejun Heo59f69012007-09-20 16:05:10 +090036 * symlink.c
37 */
Tejun Heo324a56e2013-12-11 14:11:53 -050038int sysfs_create_link_sd(struct kernfs_node *kn, struct kobject *target,
Rafael J. Wysocki0bb8f3d2013-01-25 21:51:13 +010039 const char *name);
Tejun Heoae6621b2013-11-28 14:54:31 -050040
41#endif /* __SYSFS_INTERNAL_H */