2007-09-20 17:31:38 +09:00
|
|
|
/*
|
|
|
|
* fs/sysfs/sysfs.h - sysfs internal header file
|
|
|
|
*
|
|
|
|
* Copyright (c) 2001-3 Patrick Mochel
|
|
|
|
* Copyright (c) 2007 SUSE Linux Products GmbH
|
|
|
|
* Copyright (c) 2007 Tejun Heo <teheo@suse.de>
|
|
|
|
*
|
|
|
|
* This file is released under the GPLv2.
|
|
|
|
*/
|
|
|
|
|
2013-11-28 14:54:31 -05:00
|
|
|
#ifndef __SYSFS_INTERNAL_H
|
|
|
|
#define __SYSFS_INTERNAL_H
|
2009-09-09 14:25:37 -04:00
|
|
|
|
2013-11-28 14:54:31 -05:00
|
|
|
#include "../kernfs/kernfs-internal.h"
|
|
|
|
#include <linux/sysfs.h>
|
2007-06-14 04:27:24 +09:00
|
|
|
|
2007-09-20 16:05:10 +09:00
|
|
|
/*
|
|
|
|
* mount.c
|
|
|
|
*/
|
2010-05-03 16:23:15 -05:00
|
|
|
|
|
|
|
/*
|
2013-11-23 18:01:46 -05:00
|
|
|
* Each sb is associated with one namespace tag, currently the network
|
|
|
|
* namespace of the task which mounted this sysfs instance. If multiple
|
|
|
|
* tags become necessary, make the following an array and compare
|
|
|
|
* sysfs_dirent tag against every entry.
|
2010-05-03 16:23:15 -05:00
|
|
|
*/
|
2010-03-30 11:31:24 -07:00
|
|
|
struct sysfs_super_info {
|
2013-11-23 18:01:46 -05:00
|
|
|
void *ns;
|
2010-03-30 11:31:24 -07:00
|
|
|
};
|
|
|
|
#define sysfs_info(SB) ((struct sysfs_super_info *)(SB->s_fs_info))
|
2007-06-14 04:27:25 +09:00
|
|
|
extern struct sysfs_dirent sysfs_root;
|
2006-12-06 20:33:20 -08:00
|
|
|
extern struct kmem_cache *sysfs_dir_cachep;
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2007-09-20 16:05:10 +09:00
|
|
|
/*
|
|
|
|
* dir.c
|
|
|
|
*/
|
2007-06-14 04:27:23 +09:00
|
|
|
extern struct mutex sysfs_mutex;
|
2013-10-30 10:28:36 -04:00
|
|
|
extern spinlock_t sysfs_symlink_target_lock;
|
2012-06-07 20:51:39 -04:00
|
|
|
extern const struct dentry_operations sysfs_dentry_ops;
|
2007-09-20 16:05:10 +09:00
|
|
|
|
2006-03-28 01:56:42 -08:00
|
|
|
extern const struct file_operations sysfs_dir_operations;
|
2007-02-12 00:55:40 -08:00
|
|
|
extern const struct inode_operations sysfs_dir_inode_operations;
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-02-11 15:18:38 -08:00
|
|
|
struct sysfs_dirent *sysfs_get_active(struct sysfs_dirent *sd);
|
|
|
|
void sysfs_put_active(struct sysfs_dirent *sd);
|
2013-09-18 17:15:35 -04:00
|
|
|
void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt);
|
2013-10-24 11:49:11 -04:00
|
|
|
void sysfs_warn_dup(struct sysfs_dirent *parent, const char *name);
|
2013-09-18 17:15:35 -04:00
|
|
|
int sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd,
|
|
|
|
struct sysfs_dirent *parent_sd);
|
2007-09-20 16:05:10 +09:00
|
|
|
void sysfs_addrm_finish(struct sysfs_addrm_cxt *acxt);
|
|
|
|
|
|
|
|
struct sysfs_dirent *sysfs_new_dirent(const char *name, umode_t mode, int type);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* file.c
|
|
|
|
*/
|
2013-11-28 14:54:19 -05:00
|
|
|
extern const struct file_operations kernfs_file_operations;
|
2007-09-20 16:05:10 +09:00
|
|
|
|
|
|
|
int sysfs_add_file(struct sysfs_dirent *dir_sd,
|
2013-11-28 14:54:23 -05:00
|
|
|
const struct attribute *attr, bool is_bin);
|
2007-09-20 16:05:10 +09:00
|
|
|
|
2013-09-11 22:29:04 -04:00
|
|
|
int sysfs_add_file_mode_ns(struct sysfs_dirent *dir_sd,
|
2013-11-28 14:54:23 -05:00
|
|
|
const struct attribute *attr, bool is_bin,
|
2013-09-11 22:29:04 -04:00
|
|
|
umode_t amode, const void *ns);
|
2013-10-01 17:42:07 -04:00
|
|
|
void sysfs_unmap_bin_file(struct sysfs_dirent *sd);
|
|
|
|
|
2007-09-20 16:05:10 +09:00
|
|
|
/*
|
|
|
|
* symlink.c
|
|
|
|
*/
|
|
|
|
extern const struct inode_operations sysfs_symlink_inode_operations;
|
2013-01-25 21:51:13 +01:00
|
|
|
int sysfs_create_link_sd(struct sysfs_dirent *sd, struct kobject *target,
|
|
|
|
const char *name);
|
2013-11-28 14:54:31 -05:00
|
|
|
|
|
|
|
#endif /* __SYSFS_INTERNAL_H */
|