~ubuntu-branches/ubuntu/karmic/linux-ports/karmic

« back to all changes in this revision

Viewing changes to ubuntu/unionfs/unionfs_macros.h

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich, Luke Yelavich, Michael Casadevall, Tim Gardner, Upstream Kernel Changes
  • Date: 2009-05-06 18:18:55 UTC
  • Revision ID: james.westby@ubuntu.com-20090506181855-t00baeevpnvd9o7a
Tags: 2.6.30-1.1
[ Luke Yelavich ]
* initial release for karmic
* SAUCE: rebase-ports - adjust for the karmic ports kernel
* SAUCE: rebase-ports - also remove abi dirs/files on rebase
* Update configs after rebase against mainline Jaunty tree
* [Config] Disable CONFIG_BLK_DEV_UB and CONFIG_USB_LIBUSUAL as per
  mainline jaunty
* forward-port patch to drbd for powerpc compilation
* [Config] disable CONFIG_LENOVO_SL_LAPTOP for i386 due to FTBFS
* add .o files found in arch/powerpc/lib to all powerpc kernel header
  packages
* [Config] enable CONFIG_DRM_I915_KMS for i386 as per karmic mainline

[ Michael Casadevall ]

* Disable kgdb on sparc64
* [sparc] [Config] Disable GPIO LEDS
* [ia64] Rename -ia64-generic to -ia64 in line with other architectures
* Correct kernel image path for sparc builds
* [hppa] Fix HPPA config files to build modules for all udebian

Rebase on top of karmic mainline 2.6.30-1.1

[ Tim Gardner ]

* [Config] armel: disable staging drivers, fixes FTBS
* [Config] armel imx51: Disable CONFIG_MTD_NAND_MXC, fixes FTBS

[ Upstream Kernel Changes ]

* mpt2sas: Change reset_type enum to avoid namespace collision.
  Submitted upstream.

* Initial release after rebasing against v2.6.30-rc3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (c) 2003-2006 Erez Zadok
3
 
 * Copyright (c) 2003-2006 Charles P. Wright
4
 
 * Copyright (c) 2005-2006 Josef Sipek
5
 
 * Copyright (c) 2005      Arun M. Krishnakumar
6
 
 * Copyright (c) 2005-2006 David P. Quigley
7
 
 * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
8
 
 * Copyright (c) 2003      Puja Gupta
9
 
 * Copyright (c) 2003      Harikesavan Krishnan
10
 
 * Copyright (c) 2003-2006 Stony Brook University
11
 
 * Copyright (c) 2003-2006 The Research Foundation of State University of New York
12
 
 *
13
 
 * For specific licensing information, see the COPYING file distributed with
14
 
 * this package.
15
 
 *
16
 
 * This Copyright notice must be kept intact and distributed with all sources.
17
 
 */
18
 
/*
19
 
 *  $Id: unionfs_macros.h,v 1.13 2006/06/01 03:11:03 jsipek Exp $
20
 
 */
21
 
 
22
 
#ifndef __UNIONFS_H_
23
 
#error This file should only be included from unionfs.h!
24
 
#endif
25
 
 
26
 
/* Inode to private data */
27
 
static inline struct unionfs_inode_info *itopd(const struct inode *inode)
28
 
{
29
 
        return
30
 
            &(container_of(inode, struct unionfs_inode_container, vfs_inode)->
31
 
              info);
32
 
}
33
 
 
34
 
#define itohi_ptr(ino) (itopd(ino)->uii_inode)
35
 
#define ibstart(ino) (itopd(ino)->b_start)
36
 
#define ibend(ino) (itopd(ino)->b_end)
37
 
 
38
 
/* Superblock to private data */
39
 
#define stopd(super) ((struct unionfs_sb_info *)(super)->s_fs_info)
40
 
#define stopd_lhs(super) ((super)->s_fs_info)
41
 
#define sbstart(sb) 0
42
 
#define sbend(sb) stopd(sb)->b_end
43
 
#define sbmax(sb) (stopd(sb)->b_end + 1)
44
 
 
45
 
/* File to private Data */
46
 
#define ftopd(file) ((struct unionfs_file_info *)((file)->private_data))
47
 
#define ftopd_lhs(file) ((file)->private_data)
48
 
#define ftohf_ptr(file)  (ftopd(file)->ufi_file)
49
 
#define fbstart(file) (ftopd(file)->b_start)
50
 
#define fbend(file) (ftopd(file)->b_end)
51
 
 
52
 
/* File to hidden file. */
53
 
static inline struct file *ftohf(struct file *f)
54
 
{
55
 
        return ftopd(f)->ufi_file[fbstart(f)];
56
 
}
57
 
 
58
 
static inline struct file *ftohf_index(const struct file *f, int index)
59
 
{
60
 
        return ftopd(f)->ufi_file[index];
61
 
}
62
 
 
63
 
static inline void set_ftohf_index(struct file *f, int index, struct file *val)
64
 
{
65
 
        ftopd(f)->ufi_file[index] = val;
66
 
}
67
 
 
68
 
static inline void set_ftohf(struct file *f, struct file *val)
69
 
{
70
 
        ftopd(f)->ufi_file[fbstart(f)] = val;
71
 
}
72
 
 
73
 
/* Inode to hidden inode. */
74
 
static inline struct inode *itohi(const struct inode *i)
75
 
{
76
 
        return itopd(i)->uii_inode[ibstart(i)];
77
 
}
78
 
 
79
 
static inline struct inode *itohi_index(const struct inode *i, int index)
80
 
{
81
 
        return itopd(i)->uii_inode[index];
82
 
}
83
 
 
84
 
static inline void set_itohi_index(struct inode *i, int index,
85
 
                                   struct inode *val)
86
 
{
87
 
        itopd(i)->uii_inode[index] = val;
88
 
}
89
 
 
90
 
static inline void set_itohi(struct inode *i, struct inode *val)
91
 
{
92
 
        itopd(i)->uii_inode[ibstart(i)] = val;
93
 
}
94
 
 
95
 
/* Superblock to hidden superblock. */
96
 
static inline struct super_block *stohs(const struct super_block *o)
97
 
{
98
 
        return stopd(o)->usi_data[sbstart(o)].sb;
99
 
}
100
 
 
101
 
static inline struct super_block *stohs_index(const struct super_block *o, int index)
102
 
{
103
 
        return stopd(o)->usi_data[index].sb;
104
 
}
105
 
 
106
 
static inline void set_stohs_index(struct super_block *o, int index,
107
 
                                   struct super_block *val)
108
 
{
109
 
        stopd(o)->usi_data[index].sb = val;
110
 
}
111
 
 
112
 
static inline void set_stohs(struct super_block *o, struct super_block *val)
113
 
{
114
 
        stopd(o)->usi_data[sbstart(o)].sb = val;
115
 
}
116
 
 
117
 
/* Super to hidden mount. */
118
 
static inline struct vfsmount *stohiddenmnt_index(struct super_block *o,
119
 
                                                  int index)
120
 
{
121
 
        return stopd(o)->usi_data[index].hidden_mnt;
122
 
}
123
 
 
124
 
static inline void set_stohiddenmnt_index(struct super_block *o, int index,
125
 
                                          struct vfsmount *val)
126
 
{
127
 
        stopd(o)->usi_data[index].hidden_mnt = val;
128
 
}
129
 
 
130
 
/* Branch count macros. */
131
 
static inline int branch_count(struct super_block *o, int index)
132
 
{
133
 
        return atomic_read(&stopd(o)->usi_data[index].sbcount);
134
 
}
135
 
 
136
 
static inline void set_branch_count(struct super_block *o, int index, int val)
137
 
{
138
 
        atomic_set(&stopd(o)->usi_data[index].sbcount, val);
139
 
}
140
 
 
141
 
static inline void branchget(struct super_block *o, int index)
142
 
{
143
 
        atomic_inc(&stopd(o)->usi_data[index].sbcount);
144
 
}
145
 
 
146
 
static inline void branchput(struct super_block *o, int index)
147
 
{
148
 
        atomic_dec(&stopd(o)->usi_data[index].sbcount);
149
 
}
150
 
 
151
 
/* Dentry macros */
152
 
static inline struct unionfs_dentry_info *dtopd(const struct dentry *dent)
153
 
{
154
 
        return (struct unionfs_dentry_info *)dent->d_fsdata;
155
 
}
156
 
 
157
 
#define dtopd_lhs(dent) ((dent)->d_fsdata)
158
 
#define dtopd_nocheck(dent) dtopd(dent)
159
 
#define dbstart(dent) (dtopd(dent)->udi_bstart)
160
 
#define set_dbstart(dent, val) do { dtopd(dent)->udi_bstart = val; } while(0)
161
 
#define dbend(dent) (dtopd(dent)->udi_bend)
162
 
#define set_dbend(dent, val) do { dtopd(dent)->udi_bend = val; } while(0)
163
 
#define dbopaque(dent) (dtopd(dent)->udi_bopaque)
164
 
#define set_dbopaque(dent, val) do { dtopd(dent)->udi_bopaque = val; } while (0)
165
 
 
166
 
static inline void set_dtohd_index(struct dentry *dent, int index,
167
 
                                   struct dentry *val)
168
 
{
169
 
        dtopd(dent)->udi_dentry[index] = val;
170
 
}
171
 
 
172
 
static inline struct dentry *dtohd_index(const struct dentry *dent, int index)
173
 
{
174
 
        return dtopd(dent)->udi_dentry[index];
175
 
}
176
 
 
177
 
static inline struct dentry *dtohd(const struct dentry *dent)
178
 
{
179
 
        return dtopd(dent)->udi_dentry[dbstart(dent)];
180
 
}
181
 
 
182
 
#define set_dtohd_index_nocheck(dent, index, val) set_dtohd_index(dent, index, val)
183
 
#define dtohd_index_nocheck(dent, index) dtohd_index(dent, index)
184
 
 
185
 
#define dtohd_ptr(dent) (dtopd_nocheck(dent)->udi_dentry)
186
 
 
187
 
/* Macros for locking a dentry. */
188
 
#define lock_dentry(d) down(&dtopd(d)->udi_sem)
189
 
#define unlock_dentry(d) up(&dtopd(d)->udi_sem)
190
 
#define verify_locked(d)
191
 
 
192
 
/*
193
 
 *
194
 
 * vim:shiftwidth=8
195
 
 * vim:tabstop=8
196
 
 *
197
 
 * For Emacs:
198
 
 * Local variables:
199
 
 * c-basic-offset: 8
200
 
 * c-comment-only-line-offset: 0
201
 
 * c-offsets-alist: ((statement-block-intro . +) (knr-argdecl-intro . 0)
202
 
 *              (substatement-open . 0) (label . 0) (statement-cont . +))
203
 
 * indent-tabs-mode: t
204
 
 * tab-width: 8
205
 
 * End:
206
 
 */