2
* Copyright (C) 2007-2008 Junjiro Okajima
4
* This program, aufs is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20
* sysfs interface and lifetime management
22
* $Id: sysaufs.h,v 1.5 2008/05/04 23:51:26 sfjro Exp $
31
#include <linux/sysfs.h>
35
/* entries under sysfs per super block */
46
#define SysaufsSb_PREFIX "sbi_" /* followed by %p */
49
struct attribute attr;
50
int (*show)(struct seq_file *seq, struct super_block *sb);
53
/* ---------------------------------------------------------------------- */
56
extern struct mutex au_sbilist_mtx;
57
extern struct list_head au_sbilist;
58
extern struct attribute *au_sbi_attrs[];
59
int sysaufs_si_init(struct au_sbinfo *sbinfo);
60
int __init sysaufs_init(void);
61
void sysaufs_fin(void);
63
/* ---------------------------------------------------------------------- */
65
static inline void au_sbilist_lock(void)
67
mutex_lock(&au_sbilist_mtx);
70
static inline void au_sbilist_unlock(void)
72
mutex_unlock(&au_sbilist_mtx);
75
static inline void au_sbilist_del(struct au_sbinfo *sbinfo)
77
list_del(&sbinfo->si_list);
80
static inline void au_sbilist_add(struct au_sbinfo *sbinfo)
82
/* the order in this list is important */
83
list_add_tail(&sbinfo->si_list, &au_sbilist);
86
/* ---------------------------------------------------------------------- */
91
extern struct attribute_group *au_attr_group;
92
extern struct kobj_type *au_ktype;
94
int sysaufs_sbi_xino(struct seq_file *seq, struct super_block *sb);
95
int sysaufs_sbi_mntpnt1(struct seq_file *seq, struct super_block *sb);
96
ssize_t sysaufs_sbi_show(struct kobject *kobj, struct attribute *attr,
99
void sysaufs_br_init(struct au_branch *br);
100
void sysaufs_brs_add(struct super_block *sb, aufs_bindex_t bindex);
101
void sysaufs_brs_del(struct super_block *sb, aufs_bindex_t bindex);
103
#define sysaufs_brs_init() do {} while (0)
106
#define au_attr_group NULL
107
#define au_ktype NULL
110
int sysaufs_sbi_xino(struct seq_file *seq, struct super_block *sb)
116
int sysaufs_sbi_mntpnt1(struct seq_file *seq, struct super_block *sb)
122
ssize_t sysaufs_sbi_show(struct kobject *kobj, struct attribute *attr,
128
static inline void sysaufs_br_init(struct au_branch *br)
133
static inline void sysaufs_brs_add(struct super_block *sb, aufs_bindex_t bindex)
138
static inline void sysaufs_brs_del(struct super_block *sb, aufs_bindex_t bindex)
143
static inline void sysaufs_brs_init(void)
147
#endif /* CONFIG_SYSFS */
149
#endif /* __KERNEL__ */
150
#endif /* __SYSAUFS_H__ */