~ubuntu-branches/ubuntu/vivid/aufs/vivid

« back to all changes in this revision

Viewing changes to fs/aufs25/sysaufs.h

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2008-05-06 18:35:50 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080506183550-0b6c974kkgc46oeh
Tags: 0+20080506-1
* New upstream release, supports Kernel 2.6.25 (Closes: #479717)
* Fix building with older Kernels (Closes: #475042)
* Update the patches 01, 04 and 07 to also patch fs/aufs25

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2007-2008 Junjiro Okajima
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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
 
17
 */
 
18
 
 
19
/*
 
20
 * sysfs interface and lifetime management
 
21
 *
 
22
 * $Id: sysaufs.h,v 1.5 2008/05/04 23:51:26 sfjro Exp $
 
23
 */
 
24
 
 
25
#ifndef __SYSAUFS_H__
 
26
#define __SYSAUFS_H__
 
27
 
 
28
#ifdef __KERNEL__
 
29
 
 
30
#include <linux/fs.h>
 
31
#include <linux/sysfs.h>
 
32
#include "module.h"
 
33
#include "super.h"
 
34
 
 
35
/* entries under sysfs per super block */
 
36
enum {
 
37
        SysaufsSb_XINO,
 
38
        SysaufsSb_MNTPNT1,
 
39
#if 0
 
40
        SysaufsSb_PLINK,
 
41
        SysaufsSb_files,
 
42
#endif
 
43
        SysaufsSb_Last
 
44
};
 
45
 
 
46
#define SysaufsSb_PREFIX        "sbi_"  /* followed by %p */
 
47
 
 
48
struct au_sbi_attr {
 
49
        struct attribute attr;
 
50
        int (*show)(struct seq_file *seq, struct super_block *sb);
 
51
};
 
52
 
 
53
/* ---------------------------------------------------------------------- */
 
54
 
 
55
/* sysaufs.c */
 
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);
 
62
 
 
63
/* ---------------------------------------------------------------------- */
 
64
 
 
65
static inline void au_sbilist_lock(void)
 
66
{
 
67
        mutex_lock(&au_sbilist_mtx);
 
68
}
 
69
 
 
70
static inline void au_sbilist_unlock(void)
 
71
{
 
72
        mutex_unlock(&au_sbilist_mtx);
 
73
}
 
74
 
 
75
static inline void au_sbilist_del(struct au_sbinfo *sbinfo)
 
76
{
 
77
        list_del(&sbinfo->si_list);
 
78
}
 
79
 
 
80
static inline void au_sbilist_add(struct au_sbinfo *sbinfo)
 
81
{
 
82
        /* the order in this list is important */
 
83
        list_add_tail(&sbinfo->si_list, &au_sbilist);
 
84
}
 
85
 
 
86
/* ---------------------------------------------------------------------- */
 
87
 
 
88
struct au_branch;
 
89
#ifdef CONFIG_SYSFS
 
90
/* sysfs.c */
 
91
extern struct attribute_group *au_attr_group;
 
92
extern struct kobj_type *au_ktype;
 
93
 
 
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,
 
97
                         char *buf);
 
98
 
 
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);
 
102
 
 
103
#define sysaufs_brs_init()      do {} while (0)
 
104
 
 
105
#else
 
106
#define au_attr_group   NULL
 
107
#define au_ktype        NULL
 
108
 
 
109
static inline
 
110
int sysaufs_sbi_xino(struct seq_file *seq, struct super_block *sb)
 
111
{
 
112
        return 0;
 
113
}
 
114
 
 
115
static inline
 
116
int sysaufs_sbi_mntpnt1(struct seq_file *seq, struct super_block *sb)
 
117
{
 
118
        return 0;
 
119
}
 
120
 
 
121
static inline
 
122
ssize_t sysaufs_sbi_show(struct kobject *kobj, struct attribute *attr,
 
123
                         char *buf)
 
124
{
 
125
        return 0;
 
126
}
 
127
 
 
128
static inline void sysaufs_br_init(struct au_branch *br)
 
129
{
 
130
        /* empty */
 
131
}
 
132
 
 
133
static inline void sysaufs_brs_add(struct super_block *sb, aufs_bindex_t bindex)
 
134
{
 
135
        /* nothing */
 
136
}
 
137
 
 
138
static inline void sysaufs_brs_del(struct super_block *sb, aufs_bindex_t bindex)
 
139
{
 
140
        /* nothing */
 
141
}
 
142
 
 
143
static inline void sysaufs_brs_init(void)
 
144
{
 
145
        sysaufs_brs = 0;
 
146
}
 
147
#endif /* CONFIG_SYSFS */
 
148
 
 
149
#endif /* __KERNEL__ */
 
150
#endif /* __SYSAUFS_H__ */