xref: /openbmc/u-boot/include/reiserfs.h (revision 419adbfb)
1 /*
2  *  Copyright 2000-2002 by Hans Reiser, licensing governed by reiserfs/README
3  *
4  *  GRUB  --  GRand Unified Bootloader
5  *  Copyright (C) 2000, 2001  Free Software Foundation, Inc.
6  *
7  *  (C) Copyright 2003 Sysgo Real-Time Solutions, AG <www.elinos.com>
8  *  Pavel Bartusek <pba@sysgo.de>
9  *
10  *  This program is free software; you can redistribute it and/or modify
11  *  it under the terms of the GNU General Public License as published by
12  *  the Free Software Foundation; either version 2 of the License, or
13  *  (at your option) any later version.
14  *
15  *  This program is distributed in the hope that it will be useful,
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *  GNU General Public License for more details.
19  *
20  *  You should have received a copy of the GNU General Public License
21  *  along with this program; if not, write to the Free Software
22  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  */
24 
25 /* An implementation for the ReiserFS filesystem ported from GRUB.
26  * Some parts of this code (mainly the structures and defines) are
27  * from the original reiser fs code, as found in the linux kernel.
28  */
29 
30 
31 #define SECTOR_SIZE		0x200
32 #define SECTOR_BITS		9
33 
34 /* Error codes */
35 typedef enum
36 {
37   ERR_NONE = 0,
38   ERR_BAD_FILENAME,
39   ERR_BAD_FILETYPE,
40   ERR_BAD_GZIP_DATA,
41   ERR_BAD_GZIP_HEADER,
42   ERR_BAD_PART_TABLE,
43   ERR_BAD_VERSION,
44   ERR_BELOW_1MB,
45   ERR_BOOT_COMMAND,
46   ERR_BOOT_FAILURE,
47   ERR_BOOT_FEATURES,
48   ERR_DEV_FORMAT,
49   ERR_DEV_VALUES,
50   ERR_EXEC_FORMAT,
51   ERR_FILELENGTH,
52   ERR_FILE_NOT_FOUND,
53   ERR_FSYS_CORRUPT,
54   ERR_FSYS_MOUNT,
55   ERR_GEOM,
56   ERR_NEED_LX_KERNEL,
57   ERR_NEED_MB_KERNEL,
58   ERR_NO_DISK,
59   ERR_NO_PART,
60   ERR_NUMBER_PARSING,
61   ERR_OUTSIDE_PART,
62   ERR_READ,
63   ERR_SYMLINK_LOOP,
64   ERR_UNRECOGNIZED,
65   ERR_WONT_FIT,
66   ERR_WRITE,
67   ERR_BAD_ARGUMENT,
68   ERR_UNALIGNED,
69   ERR_PRIVILEGED,
70   ERR_DEV_NEED_INIT,
71   ERR_NO_DISK_SPACE,
72   ERR_NUMBER_OVERFLOW,
73 
74   MAX_ERR_NUM
75 } reiserfs_error_t;
76 
77 
78 extern int reiserfs_set_blk_dev(block_dev_desc_t *rbdd, int part);
79 extern int reiserfs_ls (char *dirname);
80 extern int reiserfs_open (char *filename);
81 extern int reiserfs_read (char *buf, unsigned len);
82 extern int reiserfs_mount (unsigned part_length);
83