1N/A * GRUB -- GRand Unified Bootloader 1N/A * Copyright (C) 2006 Free Software Foundation, Inc. 1N/A * This program is free software; you can redistribute it and/or modify 1N/A * it under the terms of the GNU General Public License as published by 1N/A * the Free Software Foundation; either version 2 of the License, or 1N/A * (at your option) any later version. 1N/A * This program is distributed in the hope that it will be useful, 1N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 1N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1N/A * GNU General Public License for more details. 1N/A * You should have received a copy of the GNU General Public License 1N/A * along with this program; if not, write to the Free Software 1N/A * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 1N/A * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 1N/A * Use is subject to license terms. 1N/A/* These are the pools of buffers, etc. */ 1N/A/* read superblock and check fs magic */ 1N/A * searching for a file, if successful, inode will be loaded in INODE 1N/A * The entry point should really be named ufs_open(char *pathname). 1N/A * For now, keep it consistent with the rest of fsys modules. 1N/A /* skip leading slashes */ 1N/A /* parse for next path component */ 1N/A /* return 1 only if inode exists and is a regular file */ 1N/A * This is the high-level read function. 1N/A /* we are in a file hole, just zero the buf */ 1N/A/* read inode and place content in INODE */ 1N/A /* get block and byte offset into the block */ 1N/A * Performs fileblock mapping. Convert file block no. to disk block no. 1N/A * Returns 0 when block doesn't exist and <0 when block isn't initialized 1N/A * (i.e belongs to a hole in the file). 1N/A /* blocks 0..UFS_NDADDR are direct blocks */ 1N/A /* determine how many levels of indirection. */ 1N/A /* fetch the first indirect block */ 1N/A /* fetch through the indirect blocks */ 1N/A/* search directory content for name, return inode number */ 1N/A /* offset into block */ 1N/A if (
off == 0) {
/* need to read in a new block */ 1N/A /* get logical block number */ 1N/A /* resolve indrect blocks */ 1N/A#
endif /* FSYS_UFS */