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

« back to all changes in this revision

Viewing changes to fs/aufs/sysaufs.h

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2007-12-15 23:32:51 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20071215233251-2vgs2lmg8mai5d9e
Tags: 0+20071211-1ubuntu1
* Merge from debian unstable (LP: #175705), remaining changes:
  - Fix for Ubuntu Kernels (updated)
* patches/01_vserver.dpatch: Removed
* patches/06_ubuntu.dpatch: Added (update of ubuntu patch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
17
 */
18
18
 
19
 
/* $Id: sysaufs.h,v 1.4 2007/06/04 02:17:35 sfjro Exp $ */
 
19
/* $Id: sysaufs.h,v 1.12 2007/11/26 01:34:33 sfjro Exp $ */
20
20
 
21
21
#ifndef __SYSAUFS_H__
22
22
#define __SYSAUFS_H__
24
24
#ifdef __KERNEL__
25
25
 
26
26
#include <linux/seq_file.h>
27
 
#include <linux/sysfs.h>
28
27
#include <linux/version.h>
29
28
 
30
 
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
31
 
typedef struct kset au_subsys_t;
32
 
#define au_subsys_to_kset(subsys) (subsys)
33
 
#else
34
 
typedef struct subsystem au_subsys_t;
35
 
#define au_subsys_to_kset(subsys) ((subsys).kset)
 
29
/* ---------------------------------------------------------------------- */
 
30
 
 
31
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
 
32
static inline struct kset *subsys_get(struct kset *s)
 
33
{
 
34
        return kset_get(s);
 
35
}
 
36
 
 
37
static inline void subsys_put(struct kset *s)
 
38
{
 
39
        kset_put(s);
 
40
}
36
41
#endif
37
42
 
38
43
/* ---------------------------------------------------------------------- */
40
45
/* arguments for an entry under sysfs */
41
46
struct sysaufs_args {
42
47
        int index;
43
 
        struct mutex *mtx;
 
48
        struct mutex *mtx; /* template for sysaufs_read */
44
49
        struct super_block *sb;
45
50
};
46
51
 
50
55
/* an entry under sysfs */
51
56
struct sysaufs_entry {
52
57
        struct bin_attribute attr;
53
 
        int allocated;  /* zero minus means pages */
 
58
        int allocated;  /* zero and minus means pages, otherwise bytes */
54
59
        int err;
55
60
        sysaufs_op *ops;
56
61
};
58
63
/* ---------------------------------------------------------------------- */
59
64
 
60
65
struct aufs_sbinfo;
 
66
typedef void (*each_sb_cb_t)(struct super_block *sb);
 
67
 
61
68
#ifdef CONFIG_AUFS_SYSAUFS
62
69
void sysaufs_add(struct aufs_sbinfo *sbinfo);
63
70
void sysaufs_del(struct aufs_sbinfo *sbinfo);
64
71
int __init sysaufs_init(void);
65
72
void sysaufs_fin(void);
66
73
void sysaufs_notify_remount(void);
 
74
 
 
75
void au_each_sb(each_sb_cb_t cb, int do_lock);
 
76
 
67
77
#else
 
78
 
68
79
static inline void sysaufs_add(struct aufs_sbinfo *sbinfo)
69
80
{
70
81
        /* nothing */
74
85
{
75
86
        /* nothing */
76
87
}
 
88
 
77
89
#define sysaufs_init()                  0
78
 
#define sysaufs_fin()                   do{}while(0)
79
 
#define sysaufs_notify_remount()        do{}while(0)
 
90
#define sysaufs_fin()                   do {} while (0)
 
91
#define sysaufs_notify_remount()        do {} while (0)
 
92
 
 
93
static inline void au_each_sb(each_sb_cb_t cb, int do_lock)
 
94
{
 
95
        /* empty */
 
96
}
80
97
#endif /* CONFIG_AUFS_SYSAUFS */
81
98
 
82
99
#endif /* __KERNEL__ */