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