1N/A/*
1N/A * Mach Operating System
1N/A * Copyright (c) 1991,1990 Carnegie Mellon University
1N/A * All Rights Reserved.
1N/A *
1N/A * Permission to use, copy, modify and distribute this software and its
1N/A * documentation is hereby granted, provided that both the copyright
1N/A * notice and this permission notice appear in all copies of the
1N/A * software, derivative works or modified versions, and any portions
1N/A * thereof, and that both notices appear in supporting documentation.
1N/A *
1N/A * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
1N/A * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
1N/A * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
1N/A *
1N/A * Carnegie Mellon requests users of this software to return to
1N/A *
1N/A * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
1N/A * School of Computer Science
1N/A * Carnegie Mellon University
1N/A * Pittsburgh PA 15213-3890
1N/A *
1N/A * any improvements or extensions that they make and grant Carnegie Mellon
1N/A * the rights to redistribute these changes.
1N/A */
1N/A/*
1N/A * Copyright (c) 1982, 1989 The Regents of the University of California.
1N/A * All rights reserved.
1N/A *
1N/A * Redistribution and use in source and binary forms are permitted
1N/A * provided that the above copyright notice and this paragraph are
1N/A * duplicated in all such forms and that any documentation,
1N/A * advertising materials, and other materials related to such
1N/A * distribution and use acknowledge that the software was developed
1N/A * by the University of California, Berkeley. The name of the
1N/A * University may not be used to endorse or promote products derived
1N/A * from this software without specific prior written permission.
1N/A * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1N/A * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1N/A * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1N/A *
1N/A * @(#)inode.h 7.5 (Berkeley) 7/3/89
1N/A */
1N/A
1N/A#ifndef _BOOT_UFS_DISK_INODE_H_
1N/A#define _BOOT_UFS_DISK_INODE_H_
1N/A
1N/A/*
1N/A * The I node is the focus of all file activity in the BSD Fast File System.
1N/A * There is a unique inode allocated for each active file,
1N/A * each current directory, each mounted-on file, text file, and the root.
1N/A * An inode is 'named' by its dev/inumber pair. (iget/iget.c)
1N/A * Data in icommon is read in from permanent inode on volume.
1N/A */
1N/A
1N/A#define FFS_NDADDR 12 /* direct addresses in inode */
1N/A#define FFS_NIADDR 3 /* indirect addresses in inode */
1N/A
1N/A#define FFS_MAX_FASTLINK_SIZE ((FFS_NDADDR + FFS_NIADDR) \
1N/A * sizeof (mach_daddr_t))
1N/A
1N/Astruct icommon
1N/A {
1N/A u_short ic_mode; /* 0: mode and type of file */
1N/A short ic_nlink; /* 2: number of links to file */
1N/A mach_uid_t ic_uid; /* 4: owner's user id */
1N/A mach_gid_t ic_gid; /* 6: owner's group id */
1N/A quad ic_size; /* 8: number of bytes in file */
1N/A mach_time_t ic_atime; /* 16: time last accessed */
1N/A int ic_atspare;
1N/A mach_time_t ic_mtime; /* 24: time last modified */
1N/A int ic_mtspare;
1N/A mach_time_t ic_ctime; /* 32: last time inode changed */
1N/A int ic_ctspare;
1N/A union
1N/A {
1N/A struct
1N/A {
1N/A mach_daddr_t Mb_db[FFS_NDADDR]; /* 40: disk block addresses */
1N/A mach_daddr_t Mb_ib[FFS_NIADDR]; /* 88: indirect blocks */
1N/A }
1N/A ic_Mb;
1N/A char ic_Msymlink[FFS_MAX_FASTLINK_SIZE];
1N/A /* 40: symbolic link name */
1N/A }
1N/A ic_Mun;
1N/A#define ic_db ic_Mun.ic_Mb.Mb_db
1N/A#define ic_ib ic_Mun.ic_Mb.Mb_ib
1N/A#define ic_symlink ic_Mun.ic_Msymlink
1N/A int ic_flags; /* 100: status, currently unused */
1N/A int ic_blocks; /* 104: blocks actually held */
1N/A int ic_gen; /* 108: generation number */
1N/A int ic_spare[4]; /* 112: reserved, currently unused */
1N/A };
1N/A
1N/A/*
1N/A * Same structure, but on disk.
1N/A */
1N/Astruct dinode
1N/A {
1N/A union
1N/A {
1N/A struct icommon di_com;
1N/A char di_char[128];
1N/A }
1N/A di_un;
1N/A };
1N/A#define di_ic di_un.di_com
1N/A
1N/A#endif /* _BOOT_UFS_DISK_INODE_H_ */