~ubuntu-branches/ubuntu/edgy/xfsprogs/edgy

« back to all changes in this revision

Viewing changes to include/xfs_da_btree.h

  • Committer: Bazaar Package Importer
  • Author(s): Nathan Scott
  • Date: 2004-07-28 21:11:38 UTC
  • Revision ID: james.westby@ubuntu.com-20040728211138-0v4pdnunnp7na5lm
Tags: 2.6.20-1
* New upstream release.
* Fix xfs_io segfault on non-XFS files.  (closes: #260470)
* Fix packaging botch, deleted files included.  (closes: #260491)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
3
 
 * 
 
2
 * Copyright (c) 2000, 2002 Silicon Graphics, Inc.  All Rights Reserved.
 
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify it
5
5
 * under the terms of version 2 of the GNU General Public License as
6
6
 * published by the Free Software Foundation.
7
 
 * 
 
7
 *
8
8
 * This program is distributed in the hope that it would be useful, but
9
9
 * WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 
 * 
 
11
 *
12
12
 * Further, this software is distributed without any warranty that it is
13
13
 * free of the rightful claim of any third person regarding infringement
14
14
 * or the like.  Any license provided herein, whether implied or
15
15
 * otherwise, applies only to this software file.  Patent licenses, if
16
16
 * any, provided herein do not apply to combinations of this program with
17
17
 * other software, or any other product whatsoever.
18
 
 * 
 
18
 *
19
19
 * You should have received a copy of the GNU General Public License along
20
20
 * with this program; if not, write the Free Software Foundation, Inc., 59
21
21
 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
22
 
 * 
 
22
 *
23
23
 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24
24
 * Mountain View, CA  94043, or:
25
 
 * 
26
 
 * http://www.sgi.com 
27
 
 * 
28
 
 * For further information regarding this notice, see: 
29
 
 * 
 
25
 *
 
26
 * http://www.sgi.com
 
27
 *
 
28
 * For further information regarding this notice, see:
 
29
 *
30
30
 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
31
31
 */
32
32
#ifndef __XFS_DA_BTREE_H__
90
90
typedef struct xfs_da_node_hdr xfs_da_node_hdr_t;
91
91
typedef struct xfs_da_node_entry xfs_da_node_entry_t;
92
92
 
93
 
#define XFS_DA_NODE_ENTSIZE_BYNAME      /* space a name uses */ \
94
 
        (sizeof(xfs_da_node_entry_t))
95
 
#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_NODE_ENTRIES)
96
 
int xfs_da_node_entries(struct xfs_mount *mp);
97
 
#define XFS_DA_NODE_ENTRIES(mp)         xfs_da_node_entries(mp)
98
 
#else
99
 
#define XFS_DA_NODE_ENTRIES(mp)         ((mp)->m_da_node_ents)
100
 
#endif
101
 
 
102
 
#define XFS_DA_MAXHASH  ((xfs_dahash_t)-1) /* largest valid hash value */
 
93
#define XFS_DA_MAXHASH  ((xfs_dahash_t)-1) /* largest valid hash value */
103
94
 
104
95
/*
105
96
 * Macros used by directory code to interface to the filesystem.
194
185
        int             index;          /* index of attr of interest in blk */
195
186
        xfs_dablk_t     rmtblkno;       /* remote attr value starting blkno */
196
187
        int             rmtblkcnt;      /* remote attr value block count */
197
 
        int             rename;         /* T/F: this is an atomic rename op */
198
188
        xfs_dablk_t     blkno2;         /* blkno of 2nd attr leaf of interest */
199
189
        int             index2;         /* index of 2nd attr in blk */
200
190
        xfs_dablk_t     rmtblkno2;      /* remote attr value starting blkno */
201
191
        int             rmtblkcnt2;     /* remote attr value block count */
202
 
        int             justcheck;      /* check for ok with no space */
203
 
        int             addname;        /* T/F: this is an add operation */
204
 
        int             oknoent;        /* T/F: ok to return ENOENT, else die */
 
192
        unsigned char   justcheck;      /* T/F: check for ok with no space */
 
193
        unsigned char   rename;         /* T/F: this is an atomic rename op */
 
194
        unsigned char   addname;        /* T/F: this is an add operation */
 
195
        unsigned char   oknoent;        /* T/F: ok to return ENOENT, else die */
205
196
} xfs_da_args_t;
206
197
 
207
198
/*
208
199
 * Structure to describe buffer(s) for a block.
209
 
 * This is needed in the directory version 2 format case, when 
 
200
 * This is needed in the directory version 2 format case, when
210
201
 * multiple non-contiguous fsblocks might be needed to cover one
211
202
 * logical directory block.
212
203
 * If the buffer count is 1 then the data pointer points to the
221
212
        inst_t          *ra;            /* return address of caller to make */
222
213
        struct xfs_dabuf *next;         /* next in global chain */
223
214
        struct xfs_dabuf *prev;         /* previous in global chain */
224
 
        dev_t           dev;            /* device for buffer */
225
 
        xfs_daddr_t             blkno;          /* daddr first in bps[0] */
 
215
        struct xfs_buftarg *target;     /* device for buffer */
 
216
        xfs_daddr_t     blkno;          /* daddr first in bps[0] */
226
217
#endif
227
218
        struct xfs_buf  *bps[1];        /* actually nbuf of these */
228
219
} xfs_dabuf_t;
243
234
typedef struct xfs_da_state_blk {
244
235
        xfs_dabuf_t     *bp;            /* buffer containing block */
245
236
        xfs_dablk_t     blkno;          /* filesystem blkno of buffer */
246
 
        xfs_daddr_t             disk_blkno;     /* on-disk blkno (in BBs) of buffer */
 
237
        xfs_daddr_t     disk_blkno;     /* on-disk blkno (in BBs) of buffer */
247
238
        int             index;          /* relevant index into block */
248
239
        xfs_dahash_t    hashval;        /* last hash value in block */
249
240
        int             magic;          /* blk's magic number, ie: blk type */
257
248
typedef struct xfs_da_state {
258
249
        xfs_da_args_t           *args;          /* filename arguments */
259
250
        struct xfs_mount        *mp;            /* filesystem mount point */
260
 
        int                     blocksize;      /* logical block size */
261
 
        int                     inleaf;         /* insert into 1->lf, 0->splf */
 
251
        unsigned int            blocksize;      /* logical block size */
 
252
        unsigned int            node_ents;      /* how many entries in danode */
262
253
        xfs_da_state_path_t     path;           /* search/split paths */
263
254
        xfs_da_state_path_t     altpath;        /* alternate path for join */
264
 
        int                     extravalid;     /* T/F: extrablk is in use */
265
 
        int                     extraafter;     /* T/F: extrablk is after new */
 
255
        unsigned char           inleaf;         /* insert into 1->lf, 0->splf */
 
256
        unsigned char           extravalid;     /* T/F: extrablk is in use */
 
257
        unsigned char           extraafter;     /* T/F: extrablk is after new */
266
258
        xfs_da_state_blk_t      extrablk;       /* for double-splits on leafs */
267
259
                                                /* for dirv2 extrablk is data */
268
260
} xfs_da_state_t;
275
267
                (uint)(XFS_DA_LOGOFF(BASE, ADDR)), \
276
268
                (uint)(XFS_DA_LOGOFF(BASE, ADDR)+(SIZE)-1)
277
269
 
 
270
 
 
271
#ifdef __KERNEL__
278
272
/*========================================================================
279
273
 * Function prototypes for the kernel.
280
274
 *========================================================================*/
335
329
void xfs_da_binval(struct xfs_trans *tp, xfs_dabuf_t *dabuf);
336
330
xfs_daddr_t xfs_da_blkno(xfs_dabuf_t *dabuf);
337
331
 
338
 
extern struct xfs_zone *xfs_da_state_zone;
 
332
extern struct kmem_zone *xfs_da_state_zone;
 
333
#endif  /* __KERNEL__ */
339
334
 
340
335
#endif  /* __XFS_DA_BTREE_H__ */