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

« back to all changes in this revision

Viewing changes to include/xfs_dir2_sf.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-2001 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_DIR2_SF_H__
39
39
 * fit into the literal area of the inode.
40
40
 */
41
41
 
42
 
struct dirent;
43
42
struct uio;
44
43
struct xfs_dabuf;
45
44
struct xfs_da_args;
63
62
#define XFS_DIR2_SF_GET_INO8_ARCH(di,arch)      \
64
63
        (xfs_ino_t)(DIRINO_GET_ARCH(&di,arch))
65
64
#define XFS_DIR2_SF_GET_INO8(di)                \
66
 
        XFS_DIR2_SF_GET_INO8_ARCH(di,ARCH_NOCONVERT)
 
65
        XFS_DIR2_SF_GET_INO8_ARCH(di,ARCH_NOCONVERT)
67
66
 
68
67
/*
69
68
 * Inode number stored as 4 8-bit values.
93
92
 * be calculated on the fly.
94
93
 *
95
94
 * Entries are packed toward the top as tightly as possible.  The header
96
 
 * and the elements must be bcopy()'d out into a work area to get correct
 
95
 * and the elements must be memcpy'd out into a work area to get correct
97
96
 * alignment for the inode number fields.
98
97
 */
99
98
typedef struct xfs_dir2_sf_hdr {
133
132
#endif
134
133
 
135
134
#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_GET_INUMBER)
136
 
xfs_intino_t xfs_dir2_sf_get_inumber_arch(xfs_dir2_sf_t *sfp, xfs_dir2_inou_t *from, 
137
 
                                            xfs_arch_t arch);
 
135
xfs_intino_t xfs_dir2_sf_get_inumber_arch(xfs_dir2_sf_t *sfp, xfs_dir2_inou_t *from,
 
136
                                            xfs_arch_t arch);
138
137
#define XFS_DIR2_SF_GET_INUMBER_ARCH(sfp, from, arch)   \
139
138
        xfs_dir2_sf_get_inumber_arch(sfp, from, arch)
140
139
 
147
146
 
148
147
#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_PUT_INUMBER)
149
148
void xfs_dir2_sf_put_inumber_arch(xfs_dir2_sf_t *sfp, xfs_ino_t *from,
150
 
                                     xfs_dir2_inou_t *to, xfs_arch_t arch);
 
149
                                     xfs_dir2_inou_t *to, xfs_arch_t arch);
151
150
#define XFS_DIR2_SF_PUT_INUMBER_ARCH(sfp,from,to,arch)  \
152
151
        xfs_dir2_sf_put_inumber_arch(sfp,from,to,arch)
153
152
#else
154
153
#define XFS_DIR2_SF_PUT_INUMBER_ARCH(sfp,from,to,arch)  \
155
154
        if ((sfp)->hdr.i8count == 0) { \
156
 
            DIRINO4_COPY_ARCH(from,to,arch); \
157
 
        } else { \
158
 
            DIRINO_COPY_ARCH(from,to,arch); \
159
 
        }
 
155
            DIRINO4_COPY_ARCH(from,to,arch); \
 
156
        } else { \
 
157
            DIRINO_COPY_ARCH(from,to,arch); \
 
158
        }
160
159
#endif
161
160
 
162
161
#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_GET_OFFSET)
163
 
xfs_dir2_data_aoff_t xfs_dir2_sf_get_offset_arch(xfs_dir2_sf_entry_t *sfep, 
164
 
                                                    xfs_arch_t arch);
 
162
xfs_dir2_data_aoff_t xfs_dir2_sf_get_offset_arch(xfs_dir2_sf_entry_t *sfep,
 
163
                                                    xfs_arch_t arch);
165
164
xfs_dir2_data_aoff_t xfs_dir2_sf_get_offset(xfs_dir2_sf_entry_t *sfep);
166
165
#define XFS_DIR2_SF_GET_OFFSET_ARCH(sfep,arch)  \
167
 
        xfs_dir2_sf_get_offset_arch(sfep,arch)
 
166
        xfs_dir2_sf_get_offset_arch(sfep,arch)
168
167
#else
169
168
#define XFS_DIR2_SF_GET_OFFSET_ARCH(sfep,arch)  \
170
 
        INT_GET_UNALIGNED_16_ARCH(&(sfep)->offset.i,arch)
 
169
        INT_GET_UNALIGNED_16_ARCH(&(sfep)->offset.i,arch)
171
170
#endif
172
171
 
173
172
#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_PUT_OFFSET)
174
173
void xfs_dir2_sf_put_offset_arch(xfs_dir2_sf_entry_t *sfep,
175
 
                                    xfs_dir2_data_aoff_t off, xfs_arch_t arch);
 
174
                                    xfs_dir2_data_aoff_t off, xfs_arch_t arch);
176
175
#define XFS_DIR2_SF_PUT_OFFSET_ARCH(sfep,off,arch) \
177
 
        xfs_dir2_sf_put_offset_arch(sfep,off,arch)
 
176
        xfs_dir2_sf_put_offset_arch(sfep,off,arch)
178
177
#else
179
178
#define XFS_DIR2_SF_PUT_OFFSET_ARCH(sfep,off,arch)      \
180
 
        INT_SET_UNALIGNED_16_ARCH(&(sfep)->offset.i,off,arch)
 
179
        INT_SET_UNALIGNED_16_ARCH(&(sfep)->offset.i,off,arch)
181
180
#endif
182
181
 
183
182
#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR2_SF_ENTSIZE_BYNAME)