diff options
author | bde <bde@FreeBSD.org> | 2000-01-01 14:43:20 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2000-01-01 14:43:20 +0000 |
commit | a5e8250f8cd3d7d14638c62ec2b7337f4a4b34da (patch) | |
tree | 46ea4cf85cc20dafb426252282477c2bc3757a9a /sys/gnu | |
parent | 3a5569cf048ed1771b7c5b4764b52be8f1a15a14 (diff) | |
download | FreeBSD-src-a5e8250f8cd3d7d14638c62ec2b7337f4a4b34da.zip FreeBSD-src-a5e8250f8cd3d7d14638c62ec2b7337f4a4b34da.tar.gz |
Use an ifdef in ext2_fs.h instead of a bogus separate file (ext2_fs_i.h)
to avoid the namespace problems caused by <ufs/ufs/inode.h> #defining
i_mode, etc.
ext2_fs_i.h had nothing to do with the Linux version. It was a small
part of the Linux version of ext2_fs.h (the part that declares extra
in-core fields for an inode). We don't need it because we use the
ufs in-core inode for the extra fields.
Diffstat (limited to 'sys/gnu')
-rw-r--r-- | sys/gnu/ext2fs/ext2_fs.h | 67 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_fs_i.h | 86 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_inode_cnv.c | 7 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_fs.h | 67 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_inode_cnv.c | 7 |
5 files changed, 144 insertions, 90 deletions
diff --git a/sys/gnu/ext2fs/ext2_fs.h b/sys/gnu/ext2fs/ext2_fs.h index ce45bbd..fc54119 100644 --- a/sys/gnu/ext2fs/ext2_fs.h +++ b/sys/gnu/ext2fs/ext2_fs.h @@ -3,6 +3,8 @@ * * Aug 1995, Godmar Back (gback@cs.utah.edu) * University of Utah, Department of Computer Science + * + * $FreeBSD$ */ /* * linux/include/linux/ext2_fs.h @@ -227,6 +229,71 @@ struct ext2_group_desc #define EXT2_IOC_SETVERSION _IOW('v', 2, long) /* + * Only declare `struct ext2_inode' if <ufs/ufs/inode.h> hasn't made things + * difficult by #defining i_mode and other struct members. The details of + * the struct are only needed in ext2_inode_cnv.c where the ext2fs on-disk + * inode is converted to a ufs in-core inode. + */ +#ifndef i_mode + +/* + * Structure of an inode on the disk + */ +struct ext2_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[EXT2_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 */ +}; + +#endif /* i_mode */ + +/* * File system states */ #define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */ diff --git a/sys/gnu/ext2fs/ext2_fs_i.h b/sys/gnu/ext2fs/ext2_fs_i.h deleted file mode 100644 index 800b2d4..0000000 --- a/sys/gnu/ext2fs/ext2_fs_i.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * added for EXT2FS support in Lites 1.1 - * - * Aug 1995, Godmar Back (gback@cs.utah.edu) - * University of Utah, Department of Computer Science - * - * Note that this started out to be ext2_fs_i.h. In reality it - * doesn't have anything to do with. I put the declaration of - * the on disk ext2 format here from ext2_fs.h because this is - * something that would name clash with other stuff. - * This is used only in ext2_inode_cnv.c - */ -/* - * linux/include/linux/ext2_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 _EXT2_FS_I -#define _EXT2_FS_I - -/* - * Structure of an inode on the disk - */ -struct ext2_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[EXT2_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 */ -}; - -#endif /* _EXT2_FS_I */ diff --git a/sys/gnu/ext2fs/ext2_inode_cnv.c b/sys/gnu/ext2fs/ext2_inode_cnv.c index f97e8d3..ab8ceb1 100644 --- a/sys/gnu/ext2fs/ext2_inode_cnv.c +++ b/sys/gnu/ext2fs/ext2_inode_cnv.c @@ -19,6 +19,7 @@ * improvements that they make and grant CSL redistribution rights. * * Utah $Hdr$ + * $FreeBSD$ */ /* @@ -33,7 +34,10 @@ #include <ufs/ufs/quota.h> #include <ufs/ufs/inode.h> -/* these defs would destroy the ext2_fs_i #include */ +/* + * Undo the definitions in <ufs/ufs/inode.h> that would destroy the include + * of <gnu/ext2fs/ext2_fs.h>. + */ #undef i_atime #undef i_blocks #undef i_ctime @@ -52,7 +56,6 @@ #include <gnu/ext2fs/ext2_fs.h> #include <gnu/ext2fs/ext2_extern.h> -#include <gnu/ext2fs/ext2_fs_i.h> void ext2_print_dinode( di ) diff --git a/sys/gnu/fs/ext2fs/ext2_fs.h b/sys/gnu/fs/ext2fs/ext2_fs.h index ce45bbd..fc54119 100644 --- a/sys/gnu/fs/ext2fs/ext2_fs.h +++ b/sys/gnu/fs/ext2fs/ext2_fs.h @@ -3,6 +3,8 @@ * * Aug 1995, Godmar Back (gback@cs.utah.edu) * University of Utah, Department of Computer Science + * + * $FreeBSD$ */ /* * linux/include/linux/ext2_fs.h @@ -227,6 +229,71 @@ struct ext2_group_desc #define EXT2_IOC_SETVERSION _IOW('v', 2, long) /* + * Only declare `struct ext2_inode' if <ufs/ufs/inode.h> hasn't made things + * difficult by #defining i_mode and other struct members. The details of + * the struct are only needed in ext2_inode_cnv.c where the ext2fs on-disk + * inode is converted to a ufs in-core inode. + */ +#ifndef i_mode + +/* + * Structure of an inode on the disk + */ +struct ext2_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[EXT2_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 */ +}; + +#endif /* i_mode */ + +/* * File system states */ #define EXT2_VALID_FS 0x0001 /* Unmounted cleanly */ diff --git a/sys/gnu/fs/ext2fs/ext2_inode_cnv.c b/sys/gnu/fs/ext2fs/ext2_inode_cnv.c index f97e8d3..ab8ceb1 100644 --- a/sys/gnu/fs/ext2fs/ext2_inode_cnv.c +++ b/sys/gnu/fs/ext2fs/ext2_inode_cnv.c @@ -19,6 +19,7 @@ * improvements that they make and grant CSL redistribution rights. * * Utah $Hdr$ + * $FreeBSD$ */ /* @@ -33,7 +34,10 @@ #include <ufs/ufs/quota.h> #include <ufs/ufs/inode.h> -/* these defs would destroy the ext2_fs_i #include */ +/* + * Undo the definitions in <ufs/ufs/inode.h> that would destroy the include + * of <gnu/ext2fs/ext2_fs.h>. + */ #undef i_atime #undef i_blocks #undef i_ctime @@ -52,7 +56,6 @@ #include <gnu/ext2fs/ext2_fs.h> #include <gnu/ext2fs/ext2_extern.h> -#include <gnu/ext2fs/ext2_fs_i.h> void ext2_print_dinode( di ) |