199767f8919635c4928607450d9e0abb932109ceToomas Soome * Copyright (c) 1999,2000 Jonathan Lemon <jlemon@freebsd.org>
199767f8919635c4928607450d9e0abb932109ceToomas Soome * All rights reserved.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Redistribution and use in source and binary forms, with or without
199767f8919635c4928607450d9e0abb932109ceToomas Soome * modification, are permitted provided that the following conditions
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 1. Redistributions of source code must retain the above copyright
199767f8919635c4928607450d9e0abb932109ceToomas Soome * notice, this list of conditions and the following disclaimer.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 2. Redistributions in binary form must reproduce the above copyright
199767f8919635c4928607450d9e0abb932109ceToomas Soome * notice, this list of conditions and the following disclaimer in the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * documentation and/or other materials provided with the distribution.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
199767f8919635c4928607450d9e0abb932109ceToomas Soome * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
199767f8919635c4928607450d9e0abb932109ceToomas Soome * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
199767f8919635c4928607450d9e0abb932109ceToomas Soome * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
199767f8919635c4928607450d9e0abb932109ceToomas Soome * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
199767f8919635c4928607450d9e0abb932109ceToomas Soome * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
199767f8919635c4928607450d9e0abb932109ceToomas Soome * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
199767f8919635c4928607450d9e0abb932109ceToomas Soome * SUCH DAMAGE.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Copyright (c) 1993
199767f8919635c4928607450d9e0abb932109ceToomas Soome * The Regents of the University of California. All rights reserved.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * This code is derived from software contributed to Berkeley by
199767f8919635c4928607450d9e0abb932109ceToomas Soome * The Mach Operating System project at Carnegie-Mellon University.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Redistribution and use in source and binary forms, with or without
199767f8919635c4928607450d9e0abb932109ceToomas Soome * modification, are permitted provided that the following conditions
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 1. Redistributions of source code must retain the above copyright
199767f8919635c4928607450d9e0abb932109ceToomas Soome * notice, this list of conditions and the following disclaimer.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 2. Redistributions in binary form must reproduce the above copyright
199767f8919635c4928607450d9e0abb932109ceToomas Soome * notice, this list of conditions and the following disclaimer in the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * documentation and/or other materials provided with the distribution.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 3. All advertising materials mentioning features or use of this software
199767f8919635c4928607450d9e0abb932109ceToomas Soome * must display the following acknowledgement:
199767f8919635c4928607450d9e0abb932109ceToomas Soome * This product includes software developed by the University of
199767f8919635c4928607450d9e0abb932109ceToomas Soome * California, Berkeley and its contributors.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 4. Neither the name of the University nor the names of its contributors
199767f8919635c4928607450d9e0abb932109ceToomas Soome * may be used to endorse or promote products derived from this software
199767f8919635c4928607450d9e0abb932109ceToomas Soome * without specific prior written permission.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
199767f8919635c4928607450d9e0abb932109ceToomas Soome * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
199767f8919635c4928607450d9e0abb932109ceToomas Soome * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
199767f8919635c4928607450d9e0abb932109ceToomas Soome * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
199767f8919635c4928607450d9e0abb932109ceToomas Soome * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
199767f8919635c4928607450d9e0abb932109ceToomas Soome * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
199767f8919635c4928607450d9e0abb932109ceToomas Soome * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
199767f8919635c4928607450d9e0abb932109ceToomas Soome * SUCH DAMAGE.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Copyright (c) 1990, 1991 Carnegie Mellon University
199767f8919635c4928607450d9e0abb932109ceToomas Soome * All Rights Reserved.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Author: David Golub
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Permission to use, copy, modify and distribute this software and its
199767f8919635c4928607450d9e0abb932109ceToomas Soome * documentation is hereby granted, provided that both the copyright
199767f8919635c4928607450d9e0abb932109ceToomas Soome * notice and this permission notice appear in all copies of the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * software, derivative works or modified versions, and any portions
199767f8919635c4928607450d9e0abb932109ceToomas Soome * thereof, and that both notices appear in supporting documentation.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
199767f8919635c4928607450d9e0abb932109ceToomas Soome * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
199767f8919635c4928607450d9e0abb932109ceToomas Soome * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Carnegie Mellon requests users of this software to return to
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
199767f8919635c4928607450d9e0abb932109ceToomas Soome * School of Computer Science
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Carnegie Mellon University
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Pittsburgh PA 15213-3890
199767f8919635c4928607450d9e0abb932109ceToomas Soome * any improvements or extensions that they make and grant Carnegie the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * rights to redistribute these changes.
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int ext2fs_open(const char *path, struct open_file *f);
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int ext2fs_read(struct open_file *f, void *buf,
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic off_t ext2fs_seek(struct open_file *f, off_t offset, int where);
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int ext2fs_stat(struct open_file *f, struct stat *sb);
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int ext2fs_readdir(struct open_file *f, struct dirent *d);
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int dtmap[] = { DT_UNKNOWN, DT_REG, DT_DIR, DT_CHR,
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define EXTFTODT(x) (x) > sizeof(dtmap) / sizeof(dtmap[0]) ? \
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define EXT2_SBLOCK (1024 / DEV_BSIZE) /* block offset of superblock */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define EXT2_REV0 0 /* original revision of ext2 */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define EXT2_MINBSHIFT 10 /* mininum block shift */
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define EXT2_MINFSHIFT 10 /* mininum frag shift */
199767f8919635c4928607450d9e0abb932109ceToomas Soome * file system block to disk address
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define fsb_to_db(fs, blk) ((blk) << (fs)->fs_fsbtodb)
199767f8919635c4928607450d9e0abb932109ceToomas Soome * inode to block group offset
199767f8919635c4928607450d9e0abb932109ceToomas Soome * inode to block group
199767f8919635c4928607450d9e0abb932109ceToomas Soome * inode to disk address
199767f8919635c4928607450d9e0abb932109ceToomas Soome * inode to block offset
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ino_to_bgo(fs, ino) (((ino) - 1) % (fs)->fs_ipg)
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ino_to_bg(fs, ino) (((ino) - 1) / (fs)->fs_ipg)
199767f8919635c4928607450d9e0abb932109ceToomas Soome fsb_to_db(fs, ((bg)[ino_to_bg(fs, ino)].bg_inotbl + \
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define ino_to_bo(fs, ino) (ino_to_bgo(fs, ino) % (fs)->fs_ipb)
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define smalllblktosize(fs, blk) /* blk * bsize */ \
199767f8919635c4928607450d9e0abb932109ceToomas Soome#define fragroundup(fs, size) /* roundup(size, fsize) */ \
199767f8919635c4928607450d9e0abb932109ceToomas Soome (((lbn) >= NDADDR || (dip)->di_size >= smalllblktosize(fs, (lbn) + 1)) \
199767f8919635c4928607450d9e0abb932109ceToomas Soome : (fragroundup(fs, blkoff(fs, (dip)->di_size))))
199767f8919635c4928607450d9e0abb932109ceToomas Soome * superblock describing ext2fs
199767f8919635c4928607450d9e0abb932109ceToomas Soome u_int32_t fd_resblk; /* # of reserved blocks */
199767f8919635c4928607450d9e0abb932109ceToomas Soome u_int32_t fd_chkintvl; /* maximum check interval */
199767f8919635c4928607450d9e0abb932109ceToomas Soome u_int16_t fd_uid; /* uid for reserved blocks */
199767f8919635c4928607450d9e0abb932109ceToomas Soome u_int16_t fd_gid; /* gid for reserved blocks */
199767f8919635c4928607450d9e0abb932109ceToomas Soome u_int32_t fd_firstino; /* first non-reserved inode */
199767f8919635c4928607450d9e0abb932109ceToomas Soome u_int16_t fd_nblkgrp; /* block group # of superblock */
199767f8919635c4928607450d9e0abb932109ceToomas Soome u_int32_t fd_fcompat; /* compatible features */
199767f8919635c4928607450d9e0abb932109ceToomas Soome u_int32_t fd_fincompat; /* incompatible features */
199767f8919635c4928607450d9e0abb932109ceToomas Soome u_int32_t fd_frocompat; /* read-only compatibilties */
199767f8919635c4928607450d9e0abb932109ceToomas Soome u_int8_t fd_nblkpa; /* # of blocks to preallocate */
199767f8919635c4928607450d9e0abb932109ceToomas Soome u_int8_t fd_ndblkpa; /* # of dir blocks to preallocate */
199767f8919635c4928607450d9e0abb932109ceToomas Soome int fc_firstino; /* first non-reserved inode */
199767f8919635c4928607450d9e0abb932109ceToomas Soome char fs_pad[EXT2_SBSIZE - sizeof(struct ext2fs_disk)];
199767f8919635c4928607450d9e0abb932109ceToomas Soome u_int16_t d_reclen; /* directory entry length */
199767f8919635c4928607450d9e0abb932109ceToomas Soome struct ext2fs *f_fs; /* pointer to super-block */
199767f8919635c4928607450d9e0abb932109ceToomas Soome struct ext2blkgrp *f_bg; /* pointer to blkgrp map */
199767f8919635c4928607450d9e0abb932109ceToomas Soome struct ext2dinode f_di; /* copy of on-disk inode */
199767f8919635c4928607450d9e0abb932109ceToomas Soome int f_nindir[NIADDR]; /* number of blocks mapped by
199767f8919635c4928607450d9e0abb932109ceToomas Soome indirect block at level i */
199767f8919635c4928607450d9e0abb932109ceToomas Soome char *f_blk[NIADDR]; /* buffer for indirect block
199767f8919635c4928607450d9e0abb932109ceToomas Soome at level i */
199767f8919635c4928607450d9e0abb932109ceToomas Soome daddr_t f_blkno[NIADDR]; /* disk address of block in
199767f8919635c4928607450d9e0abb932109ceToomas Soome daddr_t f_buf_blkno; /* block number of data block */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* forward decls */
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int read_inode(ino_t inumber, struct open_file *f);
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int block_map(struct open_file *f, daddr_t file_block,
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int buf_read_file(struct open_file *f, char **buf_p,
199767f8919635c4928607450d9e0abb932109ceToomas Soomestatic int search_directory(char *name, struct open_file *f,
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Open a file.
199767f8919635c4928607450d9e0abb932109ceToomas Soomeext2fs_open(const char *upath, struct open_file *f)
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* allocate file system specific data structure */
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* allocate space and read super block */
199767f8919635c4928607450d9e0abb932109ceToomas Soome error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
199767f8919635c4928607450d9e0abb932109ceToomas Soome EXT2_SBLOCK, EXT2_SBSIZE, (char *)fs, &buf_size);
199767f8919635c4928607450d9e0abb932109ceToomas Soome if (buf_size != EXT2_SBSIZE || fs->fs_magic != EXT2_MAGIC) {
199767f8919635c4928607450d9e0abb932109ceToomas Soome * compute in-core values for the superblock
199767f8919635c4928607450d9e0abb932109ceToomas Soome fs->fs_bshift = EXT2_MINBSHIFT + fs->fs_fd.fd_bsize;
199767f8919635c4928607450d9e0abb932109ceToomas Soome fs->fs_fshift = EXT2_MINFSHIFT + fs->fs_fd.fd_fsize;
199767f8919635c4928607450d9e0abb932109ceToomas Soome fs->fs_fsbtodb = (fs->fs_bsize / DEV_BSIZE) - 1;
199767f8919635c4928607450d9e0abb932109ceToomas Soome * we have to load in the "group descriptors" here
199767f8919635c4928607450d9e0abb932109ceToomas Soome groups = howmany(fs->fs_blocks - fs->fs_firstblk, fs->fs_bpg);
199767f8919635c4928607450d9e0abb932109ceToomas Soome bg_per_blk = fs->fs_bsize / sizeof(struct ext2blkgrp);
199767f8919635c4928607450d9e0abb932109ceToomas Soome error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
199767f8919635c4928607450d9e0abb932109ceToomas Soome * validation of values? (blocksize, descriptors, etc?)
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Calculate indirect block levels.
199767f8919635c4928607450d9e0abb932109ceToomas Soome for (i = 0; i < NIADDR; i++) {
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Remove extra separators
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Check that current node is a directory.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Get next component of path name.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Look up component in current directory.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Save directory inumber in case we find a
199767f8919635c4928607450d9e0abb932109ceToomas Soome * symbolic link.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Open next component.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Check for symbolic link.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Read file for symbolic link
199767f8919635c4928607450d9e0abb932109ceToomas Soome * If relative pathname, restart at parent directory.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * If absolute pathname, restart at root.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Found terminal component.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Read a new inode into a file structure.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Read inode and save it.
199767f8919635c4928607450d9e0abb932109ceToomas Soome error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
199767f8919635c4928607450d9e0abb932109ceToomas Soome ino_to_db(fs, fp->f_bg, inumber), fs->fs_bsize, buf, &rsize);
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* clear out old buffers */
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Given an offset in a file, find the disk block number that
199767f8919635c4928607450d9e0abb932109ceToomas Soome * contains that block.
199767f8919635c4928607450d9e0abb932109ceToomas Soomeblock_map(struct open_file *f, daddr_t file_block, daddr_t *disk_block_p)
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Index structure of an inode:
199767f8919635c4928607450d9e0abb932109ceToomas Soome * di_db[0..NDADDR-1] hold block numbers for blocks
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 0..NDADDR-1
199767f8919635c4928607450d9e0abb932109ceToomas Soome * di_ib[0] index block 0 is the single indirect block
199767f8919635c4928607450d9e0abb932109ceToomas Soome * holds block numbers for blocks
199767f8919635c4928607450d9e0abb932109ceToomas Soome * NDADDR .. NDADDR + NINDIR(fs)-1
199767f8919635c4928607450d9e0abb932109ceToomas Soome * di_ib[1] index block 1 is the double indirect block
199767f8919635c4928607450d9e0abb932109ceToomas Soome * holds block numbers for INDEX blocks for blocks
199767f8919635c4928607450d9e0abb932109ceToomas Soome * NDADDR + NINDIR(fs) ..
199767f8919635c4928607450d9e0abb932109ceToomas Soome * NDADDR + NINDIR(fs) + NINDIR(fs)**2 - 1
199767f8919635c4928607450d9e0abb932109ceToomas Soome * di_ib[2] index block 2 is the triple indirect block
199767f8919635c4928607450d9e0abb932109ceToomas Soome * holds block numbers for double-indirect
199767f8919635c4928607450d9e0abb932109ceToomas Soome * blocks for blocks
199767f8919635c4928607450d9e0abb932109ceToomas Soome * NDADDR + NINDIR(fs) + NINDIR(fs)**2 ..
199767f8919635c4928607450d9e0abb932109ceToomas Soome * NDADDR + NINDIR(fs) + NINDIR(fs)**2
199767f8919635c4928607450d9e0abb932109ceToomas Soome * + NINDIR(fs)**3 - 1
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* Direct block. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome * nindir[0] = NINDIR
199767f8919635c4928607450d9e0abb932109ceToomas Soome * nindir[1] = NINDIR**2
199767f8919635c4928607450d9e0abb932109ceToomas Soome * nindir[2] = NINDIR**3
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* Block number too high */
199767f8919635c4928607450d9e0abb932109ceToomas Soome error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
199767f8919635c4928607450d9e0abb932109ceToomas Soome fsb_to_db(fp->f_fs, ind_block_num), fs->fs_bsize,
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Read a portion of a file into an internal buffer. Return
199767f8919635c4928607450d9e0abb932109ceToomas Soome * the location in the buffer and the amount in the buffer.
199767f8919635c4928607450d9e0abb932109ceToomas Soomebuf_read_file(struct open_file *f, char **buf_p, size_t *size_p)
199767f8919635c4928607450d9e0abb932109ceToomas Soome block_size = dblksize(fs, &fp->f_di, file_block);
199767f8919635c4928607450d9e0abb932109ceToomas Soome error = (f->f_dev->dv_strategy)(f->f_devdata, F_READ,
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Return address of byte in buffer corresponding to
199767f8919635c4928607450d9e0abb932109ceToomas Soome * offset, and size of remainder of buffer after that
199767f8919635c4928607450d9e0abb932109ceToomas Soome * But truncate buffer at end of file.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Search a directory for a name and return its
199767f8919635c4928607450d9e0abb932109ceToomas Soomesearch_directory(char *name, struct open_file *f, ino_t *inumber_p)
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* found entry */
199767f8919635c4928607450d9e0abb932109ceToomas Soome dp = (struct ext2dirent *)((char *)dp + dp->d_reclen);
199767f8919635c4928607450d9e0abb932109ceToomas Soome f->f_fsdata = (void *)0;
199767f8919635c4928607450d9e0abb932109ceToomas Soomeext2fs_read(struct open_file *f, void *addr, size_t size, size_t *resid)
199767f8919635c4928607450d9e0abb932109ceToomas Soome while (size != 0) {
199767f8919635c4928607450d9e0abb932109ceToomas Soomeext2fs_seek(struct open_file *f, off_t offset, int where)
199767f8919635c4928607450d9e0abb932109ceToomas Soome return (-1);
199767f8919635c4928607450d9e0abb932109ceToomas Soomeext2fs_stat(struct open_file *f, struct stat *sb)
199767f8919635c4928607450d9e0abb932109ceToomas Soome /* only important stuff */
199767f8919635c4928607450d9e0abb932109ceToomas Soomeext2fs_readdir(struct open_file *f, struct dirent *d)
199767f8919635c4928607450d9e0abb932109ceToomas Soome * assume that a directory entry will not be split across blocks