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

« back to all changes in this revision

Viewing changes to libhandle/jdm.c

  • Committer: Bazaar Package Importer
  • Author(s): Nathan Scott
  • Date: 2005-11-16 16:32:35 UTC
  • Revision ID: james.westby@ubuntu.com-20051116163235-synnef6xjj18ny42
Tags: 2.7.7-1
* New upstream release.
* Add support for (optional) ATTR2 format extension (closes: #336350)
* Allow gcc -pedantic option for C++ <xfs.h> users (closes: #249429)
* Fix segv in xfs_db frag command (closes: #338207)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (c) 1995, 2001-2002 Silicon Graphics, Inc.  All Rights Reserved.
 
2
 * Copyright (c) 1995, 2001-2002, 2005 Silicon Graphics, Inc.
 
3
 * All Rights Reserved.
3
4
 *
4
 
 * This program is free software; you can redistribute it and/or modify it
5
 
 * under the terms of version 2.1 of the GNU Lesser General Public License
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU Lesser General Public License
6
7
 * as published by the Free Software Foundation.
7
8
 *
8
 
 * This program is distributed in the hope that it would be useful, but
9
 
 * WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 
 *
12
 
 * Further, this software is distributed without any warranty that it is
13
 
 * free of the rightful claim of any third person regarding infringement
14
 
 * or the like.  Any license provided herein, whether implied or
15
 
 * otherwise, applies only to this software file.  Patent licenses, if
16
 
 * any, provided herein do not apply to combinations of this program with
17
 
 * other software, or any other product whatsoever.
18
 
 *
19
 
 * You should have received a copy of the GNU Lesser General Public
20
 
 * License along with this program; if not, write the Free Software
21
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
22
 
 * USA.
23
 
 *
24
 
 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
25
 
 * Mountain View, CA  94043, or:
26
 
 *
27
 
 * http://www.sgi.com
28
 
 *
29
 
 * For further information regarding this notice, see:
30
 
 *
31
 
 * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
 
9
 * This program is distributed in the hope that it would 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 Lesser General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Lesser General Public License
 
15
 * along with this program; if not, write the Free Software Foundation,
 
16
 * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
32
17
 */
33
18
 
34
 
#include <xfs/libxfs.h>
35
 
 
36
 
/* attributes.h (purposefully) unavailable to xfsprogs, make do */
37
 
struct attrlist_cursor { __u32 opaque[4]; };
38
 
 
 
19
#include <xfs/xfs.h>
39
20
#include <xfs/handle.h>
40
21
#include <xfs/jdm.h>
 
22
#include <xfs/parent.h>
41
23
 
42
24
/* internal fshandle - typecast to a void for external use */
43
25
#define FSHANDLE_SZ             8
190
172
                        bufp, bufsz, flags, cursor);
191
173
        return rval;
192
174
}
 
175
 
 
176
int
 
177
jdm_getparents( jdm_fshandle_t *fshp,
 
178
                xfs_bstat_t *statp,
 
179
                parent_t *bufp, size_t bufsz,
 
180
                parent_cursor_t *cursor,
 
181
                unsigned int *count, unsigned int *more)
 
182
{
 
183
#if !defined(__sgi__)
 
184
        errno = EOPNOTSUPP;
 
185
        return -1;
 
186
#else
 
187
        register fshandle_t *fshandlep = ( fshandle_t * )fshp;
 
188
        filehandle_t filehandle;
 
189
 
 
190
        jdm_fill_filehandle( &filehandle, fshandlep, statp );
 
191
        return getparents_by_handle (( void * )&filehandle,
 
192
                        sizeof( filehandle ),
 
193
                        bufp, bufsz, cursor, count, more);
 
194
#endif
 
195
}
 
196
 
 
197
int
 
198
jdm_getparentpaths( jdm_fshandle_t *fshp,
 
199
                xfs_bstat_t *statp,
 
200
                parent_t *bufp, size_t bufsz,
 
201
                parent_cursor_t *cursor,
 
202
                unsigned int *count, unsigned int *more)
 
203
{
 
204
#if !defined(__sgi__)
 
205
        errno = EOPNOTSUPP;
 
206
        return -1;
 
207
#else
 
208
        register fshandle_t *fshandlep = ( fshandle_t * )fshp;
 
209
        filehandle_t filehandle;
 
210
 
 
211
        jdm_fill_filehandle( &filehandle, fshandlep, statp );
 
212
        return getparentpaths_by_handle (( void * )&filehandle,
 
213
                        sizeof( filehandle ),
 
214
                        bufp, bufsz, cursor, count, more);
 
215
#endif
 
216
}