/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
* Copyright (c) 2004 Valery Hromov
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Elements of this file were originally from the FreeBSD "biosboot"
* bootloader file "disk.c" dated 4/12/95.
*
* The license and header comments from that file are included here.
*/
/*
* Mach Operating System
* Copyright (c) 1992, 1991 Carnegie Mellon University
* All Rights Reserved.
*
* Permission to use, copy, modify and distribute this software and its
* documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
* ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie Mellon
* the rights to redistribute these changes.
*
* from: Mach, Revision 2.2 92/04/04 11:35:49 rpd
* $Id: fsys_ufs2.c,v 1.2 2004/06/19 12:17:52 okuji Exp $
*/
#ifdef FSYS_UFS2
#include "shared.h"
#include "filesys.h"
#include "ufs2.h"
/* used for filesystem map blocks */
static int mapblock;
static int mapblock_offset;
static int mapblock_bsize;
static int type;
/* pointer to superblock */
int
ufs2_mount (void)
{
int retval = 0;
int i;
sblockloc = -1;
type = 0;
{
for (i = 0; sblock_try[i] != -1; ++i)
{
{
(SUPERBLOCK->fs_sblockloc == sblockloc ||
(SUPERBLOCK->fs_old_flags & FS_FLAGS_UPDATED) == 0)*/)
{
type = 2;
}
else
{
continue;
}
retval = 1;
sblockloc = sblock_try[i];
break;
}
}
}
mapblock = -1;
mapblock_offset = -1;
return retval;
}
static grub_int64_t
{
if (file_block < NDADDR)
/* If the blockmap loaded does not include FILE_BLOCK,
load a new blockmap. */
{
{
bsize = MAPBUF_LEN;
}
else
{
offset = 0;
}
{
mapblock = -1;
mapblock_bsize = -1;
mapblock_offset = -1;
return -1;
}
}
- mapblock_offset]);
}
int
{
{
break;
}
if (errnum)
ret = 0;
return ret;
}
int
{
/* main loop to find destination inode */
loop:
/* load current inode (defaults to the root inode) */
sizeof (struct ufs2_dinode), (char *) INODE_UFS2))
return 0; /* XXX what return value? */
/* if we have a real file (and we're not just printing possibilities),
then this is where we want to exit */
{
{
return 0;
}
/* incomplete implementation requires this! */
return 1;
}
while (*dirname == '/')
dirname++;
{
return 0;
}
*rest = 0;
loc = 0;
/* loop for reading a the entries in a directory */
do
{
{
if (print_possibilities < 0)
return 1;
return 0;
}
{
(char *) FSYS_BUF))
{
return 0;
}
}
#ifndef STAGE1_5
{
if (print_possibilities > 0)
}
#endif /* STAGE1_5 */
}
/* only get here if we have a matching directory entry */
/* go back to main loop at top of function */
goto loop;
}
int
{
/* XXX: I don't know if this is really correct. Someone who is
familiar with BSD should check for this. */
if (needed_sectors > 14)
return 0;
*start_sector = 1;
#if 1
/* FIXME: Disable the embedding in FFS until someone checks if
the code above is correct. */
return 0;
#else
return 1;
#endif
}
#endif /* FSYS_UFS2 */