]>
git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - fs/aufs/sysaufs.h
2 * Copyright (C) 2005-2017 Junjiro R. 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, see <http://www.gnu.org/licenses/>.
19 * sysfs interface and mount lifetime management
27 #include <linux/sysfs.h>
33 struct sysaufs_si_attr
{
34 struct attribute attr
;
35 int (*show
)(struct seq_file
*seq
, struct super_block
*sb
);
38 /* ---------------------------------------------------------------------- */
41 extern unsigned long sysaufs_si_mask
;
42 extern struct kset
*sysaufs_kset
;
43 extern struct attribute
*sysaufs_si_attrs
[];
44 int sysaufs_si_init(struct au_sbinfo
*sbinfo
);
45 int __init
sysaufs_init(void);
46 void sysaufs_fin(void);
48 /* ---------------------------------------------------------------------- */
50 /* some people doesn't like to show a pointer in kernel */
51 static inline unsigned long sysaufs_si_id(struct au_sbinfo
*sbinfo
)
53 return sysaufs_si_mask
^ (unsigned long)sbinfo
;
56 #define SysaufsSiNamePrefix "si_"
57 #define SysaufsSiNameLen (sizeof(SysaufsSiNamePrefix) + 16)
58 static inline void sysaufs_name(struct au_sbinfo
*sbinfo
, char *name
)
60 snprintf(name
, SysaufsSiNameLen
, SysaufsSiNamePrefix
"%lx",
61 sysaufs_si_id(sbinfo
));
67 extern struct attribute_group
*sysaufs_attr_group
;
69 int sysaufs_si_xi_path(struct seq_file
*seq
, struct super_block
*sb
);
70 ssize_t
sysaufs_si_show(struct kobject
*kobj
, struct attribute
*attr
,
72 long au_brinfo_ioctl(struct file
*file
, unsigned long arg
);
74 long au_brinfo_compat_ioctl(struct file
*file
, unsigned long arg
);
77 void sysaufs_br_init(struct au_branch
*br
);
78 void sysaufs_brs_add(struct super_block
*sb
, aufs_bindex_t bindex
);
79 void sysaufs_brs_del(struct super_block
*sb
, aufs_bindex_t bindex
);
81 #define sysaufs_brs_init() do {} while (0)
84 #define sysaufs_attr_group NULL
86 AuStubInt0(sysaufs_si_xi_path
, struct seq_file
*seq
, struct super_block
*sb
)
87 AuStub(ssize_t
, sysaufs_si_show
, return 0, struct kobject
*kobj
,
88 struct attribute
*attr
, char *buf
)
89 AuStubVoid(sysaufs_br_init
, struct au_branch
*br
)
90 AuStubVoid(sysaufs_brs_add
, struct super_block
*sb
, aufs_bindex_t bindex
)
91 AuStubVoid(sysaufs_brs_del
, struct super_block
*sb
, aufs_bindex_t bindex
)
93 static inline void sysaufs_brs_init(void)
98 #endif /* CONFIG_SYSFS */
100 #endif /* __KERNEL__ */
101 #endif /* __SYSAUFS_H__ */