diff -uNr linux.orig/include/asm-i386/posix_types.h linux/include/asm-i386/posix_types.h --- linux.orig/include/asm-i386/posix_types.h Tue Dec 9 02:58:04 1997 +++ linux/include/asm-i386/posix_types.h Sat Nov 7 00:21:23 1998 @@ -14,8 +14,8 @@ typedef long __kernel_off_t; typedef int __kernel_pid_t; typedef unsigned short __kernel_ipc_pid_t; -typedef unsigned short __kernel_uid_t; -typedef unsigned short __kernel_gid_t; +typedef unsigned int __kernel_uid_t; +typedef unsigned int __kernel_gid_t; typedef unsigned int __kernel_size_t; typedef int __kernel_ssize_t; typedef int __kernel_ptrdiff_t; @@ -24,6 +24,9 @@ typedef long __kernel_clock_t; typedef int __kernel_daddr_t; typedef char * __kernel_caddr_t; + +typedef unsigned short __kernel_old_uid_t; +typedef unsigned short __kernel_old_gid_t; #ifdef __GNUC__ typedef long long __kernel_loff_t; diff -uNr linux.orig/include/asm-i386/stat.h linux/include/asm-i386/stat.h --- linux.orig/include/asm-i386/stat.h Mon Sep 30 10:42:31 1996 +++ linux/include/asm-i386/stat.h Sat Nov 7 00:12:44 1998 @@ -21,8 +21,8 @@ unsigned long st_ino; unsigned short st_mode; unsigned short st_nlink; - unsigned short st_uid; - unsigned short st_gid; + unsigned int st_uid; + unsigned int st_gid; unsigned short st_rdev; unsigned short __pad2; unsigned long st_size; diff -uNr linux.orig/include/asm-i386/unistd.h linux/include/asm-i386/unistd.h --- linux.orig/include/asm-i386/unistd.h Mon Dec 1 14:16:19 1997 +++ linux/include/asm-i386/unistd.h Sat Nov 7 00:19:19 1998 @@ -21,15 +21,15 @@ #define __NR_time 13 #define __NR_mknod 14 #define __NR_chmod 15 -#define __NR_chown 16 +#define __NR_chown16 16 #define __NR_break 17 #define __NR_oldstat 18 #define __NR_lseek 19 #define __NR_getpid 20 #define __NR_mount 21 #define __NR_umount 22 -#define __NR_setuid 23 -#define __NR_getuid 24 +#define __NR_setuid16 23 +#define __NR_getuid16 24 #define __NR_stime 25 #define __NR_ptrace 26 #define __NR_alarm 27 @@ -51,11 +51,11 @@ #define __NR_times 43 #define __NR_prof 44 #define __NR_brk 45 -#define __NR_setgid 46 -#define __NR_getgid 47 +#define __NR_setgid16 46 +#define __NR_getgid16 47 #define __NR_signal 48 -#define __NR_geteuid 49 -#define __NR_getegid 50 +#define __NR_geteuid16 49 +#define __NR_getegid16 50 #define __NR_acct 51 #define __NR_phys 52 #define __NR_lock 53 @@ -75,8 +75,8 @@ #define __NR_sigaction 67 #define __NR_sgetmask 68 #define __NR_ssetmask 69 -#define __NR_setreuid 70 -#define __NR_setregid 71 +#define __NR_setreuid16 70 +#define __NR_setregid16 71 #define __NR_sigsuspend 72 #define __NR_sigpending 73 #define __NR_sethostname 74 @@ -85,8 +85,8 @@ #define __NR_getrusage 77 #define __NR_gettimeofday 78 #define __NR_settimeofday 79 -#define __NR_getgroups 80 -#define __NR_setgroups 81 +#define __NR_getgroups16 80 +#define __NR_setgroups16 81 #define __NR_select 82 #define __NR_symlink 83 #define __NR_oldlstat 84 @@ -100,7 +100,7 @@ #define __NR_truncate 92 #define __NR_ftruncate 93 #define __NR_fchmod 94 -#define __NR_fchown 95 +#define __NR_fchown16 95 #define __NR_getpriority 96 #define __NR_setpriority 97 #define __NR_profil 98 @@ -111,9 +111,9 @@ #define __NR_syslog 103 #define __NR_setitimer 104 #define __NR_getitimer 105 -#define __NR_stat 106 -#define __NR_lstat 107 -#define __NR_fstat 108 +#define __NR_stat16 106 +#define __NR_lstat16 107 +#define __NR_fstat16 108 #define __NR_olduname 109 #define __NR_iopl 110 #define __NR_vhangup 111 @@ -136,15 +136,15 @@ #define __NR_init_module 128 #define __NR_delete_module 129 #define __NR_get_kernel_syms 130 -#define __NR_quotactl 131 +#define __NR_quotactl16 131 #define __NR_getpgid 132 #define __NR_fchdir 133 #define __NR_bdflush 134 #define __NR_sysfs 135 #define __NR_personality 136 #define __NR_afs_syscall 137 /* Syscall for Andrew File System */ -#define __NR_setfsuid 138 -#define __NR_setfsgid 139 +#define __NR_setfsuid16 138 +#define __NR_setfsgid16 139 #define __NR__llseek 140 #define __NR_getdents 141 #define __NR__newselect 142 @@ -187,6 +187,39 @@ #define __NR_rt_sigsuspend 179 #define __NR_pread 180 #define __NR_pwrite 181 + +/* new 32 bit UID calls */ + +/* the kernel symbols all refer to 32 bit calls. the syscall numbers are +unchanged for 16 bit calls, introducing these new numbers for the 32 bit +calls. that way, all old code calls the 16 bit functions, but kernel +modules, glibc, anything important, will use the 32 bit calls. +as it should be. */ + +/* chris wing wingc@umich.edu */ + +/* moved these way down, because linux 2.1 has a lot of syscalls + where these used to be. */ + +#define __NR_chown 200 +#define __NR_setuid 201 +#define __NR_getuid 202 +#define __NR_setgid 203 +#define __NR_getgid 204 +#define __NR_geteuid 205 +#define __NR_getegid 206 +#define __NR_setreuid 207 +#define __NR_setregid 208 +#define __NR_getgroups 209 +#define __NR_setgroups 210 +#define __NR_fchown 211 +#define __NR_stat 212 +#define __NR_lstat 213 +#define __NR_fstat 214 +#define __NR_quotactl 215 +#define __NR_setfsuid 216 +#define __NR_setfsgid 217 + /* user-visible error numbers are in the range -1 - -122: see */ diff -uNr linux.orig/include/linux/ext32_fs.h linux/include/linux/ext32_fs.h --- linux.orig/include/linux/ext32_fs.h Wed Dec 31 19:00:00 1969 +++ linux/include/linux/ext32_fs.h Sat Nov 7 00:21:50 1998 @@ -0,0 +1,540 @@ +/* + * linux/include/linux/ext32_fs.h + * + * Copyright (C) 1992, 1993, 1994, 1995 + * Remy Card (card@masi.ibp.fr) + * Laboratoire MASI - Institut Blaise Pascal + * Universite Pierre et Marie Curie (Paris VI) + * + * from + * + * linux/include/linux/minix_fs.h + * + * Copyright (C) 1991, 1992 Linus Torvalds + */ + +#ifndef _LINUX_EXT32_FS_H +#define _LINUX_EXT32_FS_H + +#include + +/* + * The second extended filesystem constants/structures + */ + +/* + * Define EXT32FS_DEBUG to produce debug messages + */ +#undef EXT32FS_DEBUG + +/* + * Define EXT32_PREALLOCATE to preallocate data blocks for expanding files + */ +#define EXT32_PREALLOCATE + +/* + * The second extended file system version + */ +#define EXT32FS_DATE "95/08/09" +#define EXT32FS_VERSION "0.5b" + +/* + * Debug code + */ +#ifdef EXT32FS_DEBUG +# define ext32_debug(f, a...) { \ + printk ("EXT32-fs DEBUG (%s, %d): %s:", \ + __FILE__, __LINE__, __FUNCTION__); \ + printk (f, ## a); \ + } +#else +# define ext32_debug(f, a...) /**/ +#endif + +/* + * Special inodes numbers + */ +#define EXT32_BAD_INO 1 /* Bad blocks inode */ +#define EXT32_ROOT_INO 2 /* Root inode */ +#define EXT32_ACL_IDX_INO 3 /* ACL inode */ +#define EXT32_ACL_DATA_INO 4 /* ACL inode */ +#define EXT32_BOOT_LOADER_INO 5 /* Boot loader inode */ +#define EXT32_UNDEL_DIR_INO 6 /* Undelete directory inode */ + +/* First non-reserved inode for old ext32 filesystems */ +#define EXT32_GOOD_OLD_FIRST_INO 11 + +/* + * The second extended file system magic number + */ +#define EXT32_SUPER_MAGIC 0xEF53 + +/* + * Maximal count of links to a file + */ +#define EXT32_LINK_MAX 32000 + +/* + * Macro-instructions used to manage several block sizes + */ +#define EXT32_MIN_BLOCK_SIZE 1024 +#define EXT32_MAX_BLOCK_SIZE 4096 +#define EXT32_MIN_BLOCK_LOG_SIZE 10 +#ifdef __KERNEL__ +# define EXT32_BLOCK_SIZE(s) ((s)->s_blocksize) +#else +# define EXT32_BLOCK_SIZE(s) (EXT32_MIN_BLOCK_SIZE << (s)->s_log_block_size) +#endif +#define EXT32_ACLE_PER_BLOCK(s) (EXT32_BLOCK_SIZE(s) / sizeof (struct ext32_acl_entry)) +#define EXT32_ADDR_PER_BLOCK(s) (EXT32_BLOCK_SIZE(s) / sizeof (__u32)) +#ifdef __KERNEL__ +# define EXT32_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits) +#else +# define EXT32_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10) +#endif +#ifdef __KERNEL__ +#define EXT32_ADDR_PER_BLOCK_BITS(s) ((s)->u.ext32_sb.s_addr_per_block_bits) +#define EXT32_INODE_SIZE(s) ((s)->u.ext32_sb.s_inode_size) +#define EXT32_FIRST_INO(s) ((s)->u.ext32_sb.s_first_ino) +#else +#define EXT32_INODE_SIZE(s) (((s)->s_rev_level == EXT32_GOOD_OLD_REV) ? \ + EXT32_GOOD_OLD_INODE_SIZE : \ + (s)->s_inode_size) +#define EXT32_FIRST_INO(s) (((s)->s_rev_level == EXT32_GOOD_OLD_REV) ? \ + EXT32_GOOD_OLD_FIRST_INO : \ + (s)->s_first_ino) +#endif + +/* + * Macro-instructions used to manage fragments + */ +#define EXT32_MIN_FRAG_SIZE 1024 +#define EXT32_MAX_FRAG_SIZE 4096 +#define EXT32_MIN_FRAG_LOG_SIZE 10 +#ifdef __KERNEL__ +# define EXT32_FRAG_SIZE(s) ((s)->u.ext32_sb.s_frag_size) +# define EXT32_FRAGS_PER_BLOCK(s) ((s)->u.ext32_sb.s_frags_per_block) +#else +# define EXT32_FRAG_SIZE(s) (EXT32_MIN_FRAG_SIZE << (s)->s_log_frag_size) +# define EXT32_FRAGS_PER_BLOCK(s) (EXT32_BLOCK_SIZE(s) / EXT32_FRAG_SIZE(s)) +#endif + +/* + * ACL structures + */ +struct ext32_acl_header /* Header of Access Control Lists */ +{ + __u32 aclh_size; + __u32 aclh_file_count; + __u32 aclh_acle_count; + __u32 aclh_first_acle; +}; + +struct ext32_acl_entry /* Access Control List Entry */ +{ + __u32 acle_size; + __u16 acle_perms; /* Access permissions */ + __u16 acle_type; /* Type of entry */ + __u16 acle_tag; /* User or group identity */ + __u16 acle_pad1; + __u32 acle_next; /* Pointer on next entry for the */ + /* same inode or on next free entry */ +}; + +/* + * Structure of a blocks group descriptor + */ +struct ext32_group_desc +{ + __u32 bg_block_bitmap; /* Blocks bitmap block */ + __u32 bg_inode_bitmap; /* Inodes bitmap block */ + __u32 bg_inode_table; /* Inodes table block */ + __u16 bg_free_blocks_count; /* Free blocks count */ + __u16 bg_free_inodes_count; /* Free inodes count */ + __u16 bg_used_dirs_count; /* Directories count */ + __u16 bg_pad; + __u32 bg_reserved[3]; +}; + +/* + * Macro-instructions used to manage group descriptors + */ +#ifdef __KERNEL__ +# define EXT32_BLOCKS_PER_GROUP(s) ((s)->u.ext32_sb.s_blocks_per_group) +# define EXT32_DESC_PER_BLOCK(s) ((s)->u.ext32_sb.s_desc_per_block) +# define EXT32_INODES_PER_GROUP(s) ((s)->u.ext32_sb.s_inodes_per_group) +# define EXT32_DESC_PER_BLOCK_BITS(s) ((s)->u.ext32_sb.s_desc_per_block_bits) +#else +# define EXT32_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group) +# define EXT32_DESC_PER_BLOCK(s) (EXT32_BLOCK_SIZE(s) / sizeof (struct ext32_group_desc)) +# define EXT32_INODES_PER_GROUP(s) ((s)->s_inodes_per_group) +#endif + +/* + * Constants relative to the data blocks + */ +#define EXT32_NDIR_BLOCKS 12 +#define EXT32_IND_BLOCK EXT32_NDIR_BLOCKS +#define EXT32_DIND_BLOCK (EXT32_IND_BLOCK + 1) +#define EXT32_TIND_BLOCK (EXT32_DIND_BLOCK + 1) +#define EXT32_N_BLOCKS (EXT32_TIND_BLOCK + 1) + +/* + * Inode flags + */ +#define EXT32_SECRM_FL 0x00000001 /* Secure deletion */ +#define EXT32_UNRM_FL 0x00000002 /* Undelete */ +#define EXT32_COMPR_FL 0x00000004 /* Compress file */ +#define EXT32_SYNC_FL 0x00000008 /* Synchronous updates */ +#define EXT32_IMMUTABLE_FL 0x00000010 /* Immutable file */ +#define EXT32_APPEND_FL 0x00000020 /* writes to file may only append */ +#define EXT32_NODUMP_FL 0x00000040 /* do not dump file */ +#define EXT32_NOATIME_FL 0x00000080 /* do not update atime */ +#define EXT32_RESERVED_FL 0x80000000 /* reserved for ext32 lib */ + +/* + * ioctl commands + */ +#define EXT32_IOC_GETFLAGS _IOR('f', 1, long) +#define EXT32_IOC_SETFLAGS _IOW('f', 2, long) +#define EXT32_IOC_GETVERSION _IOR('v', 1, long) +#define EXT32_IOC_SETVERSION _IOW('v', 2, long) + +/* + * Structure of an inode on the disk + */ +struct ext32_inode { + __u16 i_mode; /* File mode */ + __u16 i_uid; /* Owner Uid */ + __u32 i_size; /* Size in bytes */ + __u32 i_atime; /* Access time */ + __u32 i_ctime; /* Creation time */ + __u32 i_mtime; /* Modification time */ + __u32 i_dtime; /* Deletion Time */ + __u16 i_gid; /* Group Id */ + __u16 i_links_count; /* Links count */ + __u32 i_blocks; /* Blocks count */ + __u32 i_flags; /* File flags */ + union { + struct { + __u32 l_i_reserved1; + } linux1; + struct { + __u32 h_i_translator; + } hurd1; + struct { + __u32 m_i_reserved1; + } masix1; + } osd1; /* OS dependent 1 */ + __u32 i_block[EXT32_N_BLOCKS];/* Pointers to blocks */ + __u32 i_version; /* File version (for NFS) */ + __u32 i_file_acl; /* File ACL */ + __u32 i_dir_acl; /* Directory ACL */ + __u32 i_faddr; /* Fragment address */ + union { + struct { + __u8 l_i_frag; /* Fragment number */ + __u8 l_i_fsize; /* Fragment size */ + __u16 i_pad1; + __u32 l_i_reserved2[2]; + } linux2; + struct { + __u8 h_i_frag; /* Fragment number */ + __u8 h_i_fsize; /* Fragment size */ + __u16 h_i_mode_high; + __u16 h_i_uid_high; + __u16 h_i_gid_high; + __u32 h_i_author; + } hurd2; + struct { + __u8 m_i_frag; /* Fragment number */ + __u8 m_i_fsize; /* Fragment size */ + __u16 m_pad1; + __u32 m_i_reserved2[2]; + } masix2; + } osd2; /* OS dependent 2 */ +}; + +#if defined(__KERNEL__) || defined(__linux__) +#define i_reserved1 osd1.linux1.l_i_reserved1 +#define i_frag osd2.linux2.l_i_frag +#define i_fsize osd2.linux2.l_i_fsize +#define i_reserved2 osd2.linux2.l_i_reserved2 +#endif + +#ifdef __hurd__ +#define i_translator osd1.hurd1.h_i_translator +#define i_frag osd2.hurd2.h_i_frag; +#define i_fsize osd2.hurd2.h_i_fsize; +#define i_uid_high osd2.hurd2.h_i_uid_high +#define i_gid_high osd2.hurd2.h_i_gid_high +#define i_author osd2.hurd2.h_i_author +#endif + +#ifdef __masix__ +#define i_reserved1 osd1.masix1.m_i_reserved1 +#define i_frag osd2.masix2.m_i_frag +#define i_fsize osd2.masix2.m_i_fsize +#define i_reserved2 osd2.masix2.m_i_reserved2 +#endif + +/* + * File system states + */ +#define EXT32_VALID_FS 0x0001 /* Unmounted cleanly */ +#define EXT32_ERROR_FS 0x0002 /* Errors detected */ + +/* + * Mount flags + */ +#define EXT32_MOUNT_CHECK_NORMAL 0x0001 /* Do some more checks */ +#define EXT32_MOUNT_CHECK_STRICT 0x0002 /* Do again more checks */ +#define EXT32_MOUNT_CHECK (EXT32_MOUNT_CHECK_NORMAL | \ + EXT32_MOUNT_CHECK_STRICT) +#define EXT32_MOUNT_GRPID 0x0004 /* Create files with directory's group */ +#define EXT32_MOUNT_DEBUG 0x0008 /* Some debugging messages */ +#define EXT32_MOUNT_ERRORS_CONT 0x0010 /* Continue on errors */ +#define EXT32_MOUNT_ERRORS_RO 0x0020 /* Remount fs ro on errors */ +#define EXT32_MOUNT_ERRORS_PANIC 0x0040 /* Panic on errors */ +#define EXT32_MOUNT_MINIX_DF 0x0080 /* Mimics the Minix statfs */ +#define EXT32_MOUNT_NO_ATIME 0x0100 /* Don't update the atime */ + +/* oooh. hey, you're defining things in the global namespace which are + used only by the ext2 driver. + that's not nice.... will have to add 32 to everything now +*/ + +#define ext32_clear_opt(o, opt) o &= ~EXT32_MOUNT_##opt +#define ext32_set_opt(o, opt) o |= EXT32_MOUNT_##opt +#define ext32_test_opt(sb, opt) ((sb)->u.ext32_sb.s_mount_opt & \ + EXT32_MOUNT_##opt) +/* + * Maximal mount counts between two filesystem checks + */ +#define EXT32_DFL_MAX_MNT_COUNT 20 /* Allow 20 mounts */ +#define EXT32_DFL_CHECKINTERVAL 0 /* Don't use interval check */ + +/* + * Behaviour when detecting errors + */ +#define EXT32_ERRORS_CONTINUE 1 /* Continue execution */ +#define EXT32_ERRORS_RO 2 /* Remount fs read-only */ +#define EXT32_ERRORS_PANIC 3 /* Panic */ +#define EXT32_ERRORS_DEFAULT EXT32_ERRORS_CONTINUE + +/* + * Structure of the super block + */ +struct ext32_super_block { + __u32 s_inodes_count; /* Inodes count */ + __u32 s_blocks_count; /* Blocks count */ + __u32 s_r_blocks_count; /* Reserved blocks count */ + __u32 s_free_blocks_count; /* Free blocks count */ + __u32 s_free_inodes_count; /* Free inodes count */ + __u32 s_first_data_block; /* First Data Block */ + __u32 s_log_block_size; /* Block size */ + __s32 s_log_frag_size; /* Fragment size */ + __u32 s_blocks_per_group; /* # Blocks per group */ + __u32 s_frags_per_group; /* # Fragments per group */ + __u32 s_inodes_per_group; /* # Inodes per group */ + __u32 s_mtime; /* Mount time */ + __u32 s_wtime; /* Write time */ + __u16 s_mnt_count; /* Mount count */ + __s16 s_max_mnt_count; /* Maximal mount count */ + __u16 s_magic; /* Magic signature */ + __u16 s_state; /* File system state */ + __u16 s_errors; /* Behaviour when detecting errors */ + __u16 s_minor_rev_level; /* minor revision level */ + __u32 s_lastcheck; /* time of last check */ + __u32 s_checkinterval; /* max. time between checks */ + __u32 s_creator_os; /* OS */ + __u32 s_rev_level; /* Revision level */ + __u16 s_def_resuid; /* Default uid for reserved blocks */ + __u16 s_def_resgid; /* Default gid for reserved blocks */ + /* + * These fields are for EXT32_DYNAMIC_REV superblocks only. + * + * Note: the difference between the compatible feature set and + * the incompatible feature set is that if there is a bit set + * in the incompatible feature set that the kernel doesn't + * know about, it should refuse to mount the filesystem. + * + * e2fsck's requirements are more strict; if it doesn't know + * about a feature in either the compatible or incompatible + * feature set, it must abort and not try to meddle with + * things it doesn't understand... + */ + __u32 s_first_ino; /* First non-reserved inode */ + __u16 s_inode_size; /* size of inode structure */ + __u16 s_block_group_nr; /* block group # of this superblock */ + __u32 s_feature_compat; /* compatible feature set */ + __u32 s_feature_incompat; /* incompatible feature set */ + __u32 s_feature_ro_compat; /* readonly-compatible feature set */ + __u32 s_reserved[230]; /* Padding to the end of the block */ +}; + +/* + * Codes for operating systems + */ +#define EXT32_OS_LINUX 0 +#define EXT32_OS_HURD 1 +#define EXT32_OS_MASIX 2 +#define EXT32_OS_FREEBSD 3 +#define EXT32_OS_LITES 4 + +/* + * Revision levels + */ +#define EXT32_GOOD_OLD_REV 0 /* The good old (original) format */ +#define EXT32_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */ + +#define EXT32_CURRENT_REV EXT32_GOOD_OLD_REV +#define EXT32_MAX_SUPP_REV EXT32_DYNAMIC_REV + +#define EXT32_GOOD_OLD_INODE_SIZE 128 + +/* + * Default values for user and/or group using reserved blocks + */ +#define EXT32_DEF_RESUID 0 +#define EXT32_DEF_RESGID 0 + +/* + * Structure of a directory entry + */ +#define EXT32_NAME_LEN 255 + +struct ext32_dir_entry { + __u32 inode; /* Inode number */ + __u16 rec_len; /* Directory entry length */ + __u16 name_len; /* Name length */ + char name[EXT32_NAME_LEN]; /* File name */ +}; + +/* + * EXT32_DIR_PAD defines the directory entries boundaries + * + * NOTE: It must be a multiple of 4 + */ +#define EXT32_DIR_PAD 4 +#define EXT32_DIR_ROUND (EXT32_DIR_PAD - 1) +#define EXT32_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT32_DIR_ROUND) & \ + ~EXT32_DIR_ROUND) + +/* + * Feature set definitions --- none are defined as of now + */ +#define EXT32_FEATURE_COMPAT_SUPP 0 +#define EXT32_FEATURE_INCOMPAT_SUPP 0 +#define EXT32_FEATURE_RO_COMPAT_SUPP 0 + +#ifdef __KERNEL__ +/* + * Function prototypes + */ + +/* + * Ok, these declarations are also in but none of the + * ext32 source programs needs to include it so they are duplicated here. + */ +# define NORET_TYPE /**/ +# define ATTRIB_NORET __attribute__((noreturn)) +# define NORET_AND noreturn, + +/* acl.c */ +extern int ext32_permission (struct inode *, int); + +/* balloc.c */ +extern int ext32_new_block (const struct inode *, unsigned long, + __u32 *, __u32 *, int *); +extern void ext32_free_blocks (const struct inode *, unsigned long, + unsigned long); +extern unsigned long ext32_count_free_blocks (struct super_block *); +extern void ext32_check_blocks_bitmap (struct super_block *); + +/* bitmap.c */ +extern unsigned long ext32_count_free (struct buffer_head *, unsigned); + +/* dir.c */ +extern int ext32_check_dir_entry (const char *, struct inode *, + struct ext32_dir_entry *, struct buffer_head *, + unsigned long); + +/* file.c */ +extern int ext32_read (struct inode *, struct file *, char *, int); +extern int ext32_write (struct inode *, struct file *, char *, int); + +/* fsync.c */ +extern int ext32_sync_file (struct inode *, struct file *); + +/* ialloc.c */ +extern struct inode * ext32_new_inode (const struct inode *, int, int *); +extern void ext32_free_inode (struct inode *); +extern unsigned long ext32_count_free_inodes (struct super_block *); +extern void ext32_check_inodes_bitmap (struct super_block *); + +/* inode.c */ +extern int ext32_bmap (struct inode *, int); + +extern struct buffer_head * ext32_getblk (struct inode *, long, int, int *); +extern struct buffer_head * ext32_bread (struct inode *, int, int, int *); + +extern int ext32_getcluster (struct inode * inode, long block); +extern void ext32_read_inode (struct inode *); +extern void ext32_write_inode (struct inode *); +extern void ext32_put_inode (struct inode *); +extern int ext32_sync_inode (struct inode *); +extern void ext32_discard_prealloc (struct inode *); + +/* ioctl.c */ +extern int ext32_ioctl (struct inode *, struct file *, unsigned int, + unsigned long); + +/* namei.c */ +extern void ext32_release (struct inode *, struct file *); +extern int ext32_lookup (struct inode *,const char *, int, struct inode **); +extern int ext32_create (struct inode *,const char *, int, int, + struct inode **); +extern int ext32_mkdir (struct inode *, const char *, int, int); +extern int ext32_rmdir (struct inode *, const char *, int); +extern int ext32_unlink (struct inode *, const char *, int); +extern int ext32_symlink (struct inode *, const char *, int, const char *); +extern int ext32_link (struct inode *, struct inode *, const char *, int); +extern int ext32_mknod (struct inode *, const char *, int, int, int); +extern int ext32_rename (struct inode *, const char *, int, + struct inode *, const char *, int, int); + +/* super.c */ +extern void ext32_error (struct super_block *, const char *, const char *, ...) + __attribute__ ((format (printf, 3, 4))); +extern NORET_TYPE void ext32_panic (struct super_block *, const char *, + const char *, ...) + __attribute__ ((NORET_AND format (printf, 3, 4))); +extern void ext32_warning (struct super_block *, const char *, const char *, ...) + __attribute__ ((format (printf, 3, 4))); +extern void ext32_put_super (struct super_block *); +extern void ext32_write_super (struct super_block *); +extern int ext32_remount (struct super_block *, int *, char *); +extern struct super_block * ext32_read_super (struct super_block *,void *,int); +extern int init_ext32_fs(void); +extern void ext32_statfs (struct super_block *, struct statfs *, int); + +/* truncate.c */ +extern void ext32_truncate (struct inode *); + +/* + * Inodes and files operations + */ + +/* dir.c */ +extern struct inode_operations ext32_dir_inode_operations; + +/* file.c */ +extern struct inode_operations ext32_file_inode_operations; + +/* symlink.c */ +extern struct inode_operations ext32_symlink_inode_operations; + +#endif /* __KERNEL__ */ + +#endif /* _LINUX_EXT32_FS_H */ diff -uNr linux.orig/include/linux/ext32_fs_i.h linux/include/linux/ext32_fs_i.h --- linux.orig/include/linux/ext32_fs_i.h Wed Dec 31 19:00:00 1969 +++ linux/include/linux/ext32_fs_i.h Sat Nov 7 00:21:50 1998 @@ -0,0 +1,41 @@ +/* + * linux/include/linux/ext32_fs_i.h + * + * Copyright (C) 1992, 1993, 1994, 1995 + * Remy Card (card@masi.ibp.fr) + * Laboratoire MASI - Institut Blaise Pascal + * Universite Pierre et Marie Curie (Paris VI) + * + * from + * + * linux/include/linux/minix_fs_i.h + * + * Copyright (C) 1991, 1992 Linus Torvalds + */ + +#ifndef _LINUX_EXT32_FS_I +#define _LINUX_EXT32_FS_I + +/* + * second extended file system inode data in memory + */ +struct ext32_inode_info { + __u32 i_data[15]; + __u32 i_flags; + __u32 i_faddr; + __u8 i_frag_no; + __u8 i_frag_size; + __u16 i_osync; + __u32 i_file_acl; + __u32 i_dir_acl; + __u32 i_dtime; + __u32 i_version; + __u32 i_block_group; + __u32 i_next_alloc_block; + __u32 i_next_alloc_goal; + __u32 i_prealloc_block; + __u32 i_prealloc_count; + int i_new_inode:1; /* Is a freshly allocated inode */ +}; + +#endif /* _LINUX_EXT32_FS_I */ diff -uNr linux.orig/include/linux/ext32_fs_sb.h linux/include/linux/ext32_fs_sb.h --- linux.orig/include/linux/ext32_fs_sb.h Wed Dec 31 19:00:00 1969 +++ linux/include/linux/ext32_fs_sb.h Sat Nov 7 00:21:50 1998 @@ -0,0 +1,65 @@ +/* + * linux/include/linux/ext32_fs_sb.h + * + * Copyright (C) 1992, 1993, 1994, 1995 + * Remy Card (card@masi.ibp.fr) + * Laboratoire MASI - Institut Blaise Pascal + * Universite Pierre et Marie Curie (Paris VI) + * + * from + * + * linux/include/linux/minix_fs_sb.h + * + * Copyright (C) 1991, 1992 Linus Torvalds + */ + +#ifndef _LINUX_EXT32_FS_SB +#define _LINUX_EXT32_FS_SB + +#include + +/* + * The following is not needed anymore since the descriptors buffer + * heads are now dynamically allocated + */ +/* #define EXT32_MAX_GROUP_DESC 8 */ + +#define EXT32_MAX_GROUP_LOADED 8 + +/* + * second extended-fs super-block data in memory + */ +struct ext32_sb_info { + unsigned long s_frag_size; /* Size of a fragment in bytes */ + unsigned long s_frags_per_block;/* Number of fragments per block */ + unsigned long s_inodes_per_block;/* Number of inodes per block */ + unsigned long s_frags_per_group;/* Number of fragments in a group */ + unsigned long s_blocks_per_group;/* Number of blocks in a group */ + unsigned long s_inodes_per_group;/* Number of inodes in a group */ + unsigned long s_itb_per_group; /* Number of inode table blocks per group */ + unsigned long s_db_per_group; /* Number of descriptor blocks per group */ + unsigned long s_desc_per_block; /* Number of group descriptors per block */ + unsigned long s_groups_count; /* Number of groups in the fs */ + struct buffer_head * s_sbh; /* Buffer containing the super block */ + struct ext32_super_block * s_es; /* Pointer to the super block in the buffer */ + struct buffer_head ** s_group_desc; + unsigned short s_loaded_inode_bitmaps; + unsigned short s_loaded_block_bitmaps; + unsigned long s_inode_bitmap_number[EXT32_MAX_GROUP_LOADED]; + struct buffer_head * s_inode_bitmap[EXT32_MAX_GROUP_LOADED]; + unsigned long s_block_bitmap_number[EXT32_MAX_GROUP_LOADED]; + struct buffer_head * s_block_bitmap[EXT32_MAX_GROUP_LOADED]; + int s_rename_lock; + struct wait_queue * s_rename_wait; + unsigned long s_mount_opt; + unsigned short s_resuid; + unsigned short s_resgid; + unsigned short s_mount_state; + unsigned short s_pad; + int s_addr_per_block_bits; + int s_desc_per_block_bits; + int s_inode_size; + int s_first_ino; +}; + +#endif /* _LINUX_EXT32_FS_SB */ diff -uNr linux.orig/include/linux/fs.h linux/include/linux/fs.h --- linux.orig/include/linux/fs.h Tue Dec 23 18:51:43 1997 +++ linux/include/linux/fs.h Sat Nov 7 00:25:10 1998 @@ -255,6 +255,7 @@ #include #include #include +#include #include #include #include @@ -355,6 +356,7 @@ struct pipe_inode_info pipe_i; struct minix_inode_info minix_i; struct ext2_inode_info ext2_i; + struct ext32_inode_info ext32_i; struct hpfs_inode_info hpfs_i; struct ntfs_inode_info ntfs_i; struct msdos_inode_info msdos_i; @@ -493,6 +495,7 @@ #include #include +#include #include #include #include @@ -528,6 +531,7 @@ union { struct minix_sb_info minix_sb; struct ext2_sb_info ext2_sb; + struct ext32_sb_info ext32_sb; struct hpfs_sb_info hpfs_sb; struct ntfs_sb_info ntfs_sb; struct msdos_sb_info msdos_sb; diff -uNr linux.orig/include/linux/highuid.h linux/include/linux/highuid.h --- linux.orig/include/linux/highuid.h Wed Dec 31 19:00:00 1969 +++ linux/include/linux/highuid.h Sat Nov 7 00:21:45 1998 @@ -0,0 +1,19 @@ +/* simple constants for the uid32 hack for Linux + Chris Wing +*/ + +/* This is the number used to indicate on disk that a high UID/GID will + be used. When you mount a magic ext32 filesystem on an ordinary Linux + machine, all of your highuid files will appear to be owned by this uid. +*/ + +#define MAGIC_HIGHUID 65534 + +/* This is the "default" high uid. It is used to signify uid overflow to + old programs when they request uid/gid information but are using the + old 16 bit interfaces. + When you run a libc5 program, it will think that all highuid files or + processes are owned by this uid. +*/ + +#define DEF_HIGHUID 65534 diff -uNr linux.orig/include/linux/types.h linux/include/linux/types.h --- linux.orig/include/linux/types.h Tue Dec 9 03:07:19 1997 +++ linux/include/linux/types.h Sat Nov 7 00:20:39 1998 @@ -19,6 +19,9 @@ typedef __kernel_key_t key_t; typedef __kernel_suseconds_t suseconds_t; +typedef __kernel_old_uid_t old_uid_t; +typedef __kernel_old_gid_t old_gid_t; + #if defined(__GNUC__) && !defined(__STRICT_ANSI__) typedef __kernel_loff_t loff_t; #endif