svn commit: r225154 - in projects/ino64/sys/ufs: ffs ufs
mdf at FreeBSD.org
mdf at FreeBSD.org
Wed Aug 24 23:33:36 UTC 2011
On Wed, Aug 24, 2011 at 3:14 PM, Matthew D Fleming <mdf at freebsd.org> wrote:
> Author: mdf
> Date: Wed Aug 24 22:14:55 2011
> New Revision: 225154
> URL: http://svn.freebsd.org/changeset/base/225154
>
> Log:
> Use fixed-width types in on-disk structures. This takes care of all the
> ino_t references I could find that were on-disk.
>
> GSoC r223157.
> Code by Gleb Kurtsou.
Note that I've explicitly left all the XXXfid structs alone; when
ino_t is changed to 64-bit they will use 64-bit members for inode
number. The only in-tree one that may be a problem is ReiserFS which
will have a 32 byte FID after compiler padding is applied. This can
be reduced to 24 bytes by reordering the members. In theory, IIRC,
even 32 bits is an okay FID, however I have seen a note at $WORK that
NFSv2 has 32 byte file handles and BSD is using 8 bytes for the fsid.
If anyone knows anything more, please let me know. For the moment I
think my plan is to re-order the members of various implementations to
keep them smaller, and leave it as an ino_t in the struct definition.
Thanks,
matthew
> Modified:
> projects/ino64/sys/ufs/ffs/fs.h
> projects/ino64/sys/ufs/ufs/dinode.h
>
> Modified: projects/ino64/sys/ufs/ffs/fs.h
> ==============================================================================
> --- projects/ino64/sys/ufs/ffs/fs.h Wed Aug 24 22:07:38 2011 (r225153)
> +++ projects/ino64/sys/ufs/ffs/fs.h Wed Aug 24 22:14:55 2011 (r225154)
> @@ -338,7 +338,7 @@ struct fs {
> ufs2_daddr_t fs_csaddr; /* blk addr of cyl grp summary area */
> int64_t fs_pendingblocks; /* (u) blocks being freed */
> u_int32_t fs_pendinginodes; /* (u) inodes being freed */
> - ino_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */
> + u_int32_t fs_snapinum[FSMAXSNAP];/* list of snapshot inode numbers */
> u_int32_t fs_avgfilesize; /* expected average file size */
> u_int32_t fs_avgfpdir; /* expected # of files per directory */
> int32_t fs_save_cgsize; /* save real cg size to use fs_bsize */
> @@ -695,8 +695,8 @@ struct jsegrec {
> */
> struct jrefrec {
> uint32_t jr_op;
> - ino_t jr_ino;
> - ino_t jr_parent;
> + uint32_t jr_ino;
> + uint32_t jr_parent;
> uint16_t jr_nlink;
> uint16_t jr_mode;
> off_t jr_diroff;
> @@ -709,8 +709,8 @@ struct jrefrec {
> */
> struct jmvrec {
> uint32_t jm_op;
> - ino_t jm_ino;
> - ino_t jm_parent;
> + uint32_t jm_ino;
> + uint32_t jm_parent;
> uint16_t jm_unused;
> off_t jm_oldoff;
> off_t jm_newoff;
>
> Modified: projects/ino64/sys/ufs/ufs/dinode.h
> ==============================================================================
> --- projects/ino64/sys/ufs/ufs/dinode.h Wed Aug 24 22:07:38 2011 (r225153)
> +++ projects/ino64/sys/ufs/ufs/dinode.h Wed Aug 24 22:14:55 2011 (r225154)
> @@ -146,7 +146,7 @@ struct ufs2_dinode {
> ufs2_daddr_t di_db[NDADDR]; /* 112: Direct disk blocks. */
> ufs2_daddr_t di_ib[NIADDR]; /* 208: Indirect disk blocks. */
> u_int64_t di_modrev; /* 232: i_modrev for NFSv4 */
> - ino_t di_freelink; /* 240: SUJ: Next unlinked inode. */
> + u_int32_t di_freelink; /* 240: SUJ: Next unlinked inode. */
> uint32_t di_spare[3]; /* 244: Reserved; currently unused */
> };
>
> @@ -168,7 +168,7 @@ struct ufs2_dinode {
> struct ufs1_dinode {
> u_int16_t di_mode; /* 0: IFMT, permissions; see below. */
> int16_t di_nlink; /* 2: File link count. */
> - ino_t di_freelink; /* 4: SUJ: Next unlinked inode. */
> + u_int32_t di_freelink; /* 4: SUJ: Next unlinked inode. */
> u_int64_t di_size; /* 8: File byte count. */
> int32_t di_atime; /* 16: Last access time. */
> int32_t di_atimensec; /* 20: Last access time. */
>
More information about the svn-src-projects
mailing list