Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Dec 2014 08:09:56 +0000 (UTC)
From:      Gleb Kurtsou <gleb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r276109 - in projects/ino64/sys: compat/freebsd32 sys
Message-ID:  <201412230809.sBN89uAe076715@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gleb
Date: Tue Dec 23 08:09:55 2014
New Revision: 276109
URL: https://svnweb.freebsd.org/changeset/base/276109

Log:
  Update system headers.
  
  Bump ino_t and dev_t to 64-bit, nlink_t to 32-bit.
  
  Increase MNAMELEN to 1024.
  
  Change struct dirent layout to include directory entry offset aka cookie.
  
  Bump STATFS_VERSION to 20141215

Modified:
  projects/ino64/sys/compat/freebsd32/freebsd32.h
  projects/ino64/sys/sys/_types.h
  projects/ino64/sys/sys/dirent.h
  projects/ino64/sys/sys/mount.h
  projects/ino64/sys/sys/stat.h
  projects/ino64/sys/sys/vnode.h

Modified: projects/ino64/sys/compat/freebsd32/freebsd32.h
==============================================================================
--- projects/ino64/sys/compat/freebsd32/freebsd32.h	Tue Dec 23 08:09:48 2014	(r276108)
+++ projects/ino64/sys/compat/freebsd32/freebsd32.h	Tue Dec 23 08:09:55 2014	(r276109)
@@ -107,7 +107,8 @@ struct itimerval32 {
 	struct timeval32 it_value;
 };
 
-#define FREEBSD4_MNAMELEN        (88 - 2 * sizeof(int32_t)) /* size of on/from name bufs */
+#define FREEBSD4_MFSNAMELEN	16
+#define FREEBSD4_MNAMELEN	(88 - 2 * sizeof(int32_t))
 
 /* 4.x version */
 struct statfs32 {
@@ -125,7 +126,7 @@ struct statfs32 {
 	int32_t	f_flags;
 	int32_t	f_syncwrites;
 	int32_t	f_asyncwrites;
-	char	f_fstypename[MFSNAMELEN];
+	char	f_fstypename[FREEBSD4_MFSNAMELEN];
 	char	f_mntonname[FREEBSD4_MNAMELEN];
 	int32_t	f_syncreads;
 	int32_t	f_asyncreads;
@@ -162,14 +163,34 @@ struct msghdr32 {
 struct stat32 {
 	dev_t	st_dev;
 	ino_t	st_ino;
-	mode_t	st_mode;
 	nlink_t	st_nlink;
+	mode_t	st_mode;
+	u_int16_t st_padding0;
 	uid_t	st_uid;
 	gid_t	st_gid;
 	dev_t	st_rdev;
 	struct timespec32 st_atim;
 	struct timespec32 st_mtim;
 	struct timespec32 st_ctim;
+	struct timespec32 st_birthtim;
+	off_t	st_size;
+	int64_t	st_blocks;
+	u_int32_t st_blksize;
+	u_int32_t st_flags;
+	u_int64_t st_gen;
+	u_int64_t st_spare[10];
+};
+struct freebsd10_stat32 {
+	u_int32_t st_dev;
+	u_int32_t st_ino;
+	mode_t	st_mode;
+	u_int16_t st_nlink;
+	uid_t	st_uid;
+	gid_t	st_gid;
+	u_int32_t st_rdev;
+	struct timespec32 st_atim;
+	struct timespec32 st_mtim;
+	struct timespec32 st_ctim;
 	off_t	st_size;
 	int64_t	st_blocks;
 	u_int32_t st_blksize;
@@ -183,9 +204,9 @@ struct stat32 {
 
 struct ostat32 {
 	__uint16_t st_dev;
-	ino_t	st_ino;
+	__uint32_t st_ino;
 	mode_t	st_mode;
-	nlink_t	st_nlink;
+	__uint16_t st_nlink;
 	__uint16_t st_uid;
 	__uint16_t st_gid;
 	__uint16_t st_rdev;

Modified: projects/ino64/sys/sys/_types.h
==============================================================================
--- projects/ino64/sys/sys/_types.h	Tue Dec 23 08:09:48 2014	(r276108)
+++ projects/ino64/sys/sys/_types.h	Tue Dec 23 08:09:55 2014	(r276109)
@@ -43,13 +43,13 @@ typedef	__uint64_t	__fsblkcnt_t;
 typedef	__uint64_t	__fsfilcnt_t;
 typedef	__uint32_t	__gid_t;
 typedef	__int64_t	__id_t;		/* can hold a gid_t, pid_t, or uid_t */
-typedef	__uint32_t	__ino_t;	/* inode number */
+typedef	__uint64_t	__ino_t;	/* inode number */
 typedef	long		__key_t;	/* IPC key (for Sys V IPC) */
 typedef	__int32_t	__lwpid_t;	/* Thread ID (a.k.a. LWP) */
 typedef	__uint16_t	__mode_t;	/* permissions */
 typedef	int		__accmode_t;	/* access permissions */
 typedef	int		__nl_item;
-typedef	__uint16_t	__nlink_t;	/* link count */
+typedef	__uint32_t	__nlink_t;	/* link count */
 typedef	__int64_t	__off_t;	/* file offset */
 typedef	__int32_t	__pid_t;	/* process [group] */
 typedef	__int64_t	__rlim_t;	/* resource limit - intentionally */
@@ -99,7 +99,7 @@ typedef	__uint_least32_t __char32_t;
 #define	_CHAR32_T_DECLARED
 #endif
 
-typedef	__uint32_t	__dev_t;	/* device number */
+typedef	__uint64_t	__dev_t;	/* device number */
 
 typedef	__uint32_t	__fixpt_t;	/* fixed point number */
 

Modified: projects/ino64/sys/sys/dirent.h
==============================================================================
--- projects/ino64/sys/sys/dirent.h	Tue Dec 23 08:09:48 2014	(r276108)
+++ projects/ino64/sys/sys/dirent.h	Tue Dec 23 08:09:55 2014	(r276109)
@@ -36,6 +36,16 @@
 #include <sys/cdefs.h>
 #include <sys/_types.h>
 
+#ifndef _INO_T_DECLARED
+typedef	__ino_t		ino_t;
+#define	_INO_T_DECLARED
+#endif
+
+#ifndef _OFF_T_DECLARED
+typedef	__off_t		off_t;
+#define	_OFF_T_DECLARED
+#endif
+
 /*
  * The dirent structure defines the format of directory entries returned by
  * the getdirentries(2) system call.
@@ -48,10 +58,13 @@
  */
 
 struct dirent {
-	__uint32_t d_fileno;		/* file number of entry */
+	ino_t      d_fileno;		/* file number of entry */
+	off_t      d_off__unused;	/* directory offset of entry */
 	__uint16_t d_reclen;		/* length of this record */
+	__uint16_t d_namlen;		/* length of string in d_name */
 	__uint8_t  d_type; 		/* file type, see below */
-	__uint8_t  d_namlen;		/* length of string in d_name */
+	__uint8_t  d_unused1;
+	__uint16_t d_unused2;
 #if __BSD_VISIBLE
 #define	MAXNAMLEN	255
 	char	d_name[MAXNAMLEN + 1];	/* name must be no longer than this */
@@ -61,6 +74,14 @@ struct dirent {
 };
 
 #if __BSD_VISIBLE
+struct freebsd10_dirent {
+	__uint32_t d_fileno;		/* file number of entry */
+	__uint16_t d_reclen;		/* length of this record */
+	__uint8_t  d_type; 		/* file type, see below */
+	__uint8_t  d_namlen;		/* length of string in d_name */
+	char	d_name[255 + 1];	/* name must be no longer than this */
+};
+
 /*
  * File types
  */

Modified: projects/ino64/sys/sys/mount.h
==============================================================================
--- projects/ino64/sys/sys/mount.h	Tue Dec 23 08:09:48 2014	(r276108)
+++ projects/ino64/sys/sys/mount.h	Tue Dec 23 08:09:55 2014	(r276109)
@@ -65,8 +65,8 @@ struct fid {
  * filesystem statistics
  */
 #define	MFSNAMELEN	16		/* length of type name including null */
-#define	MNAMELEN	88		/* size of on/from name bufs */
-#define	STATFS_VERSION	0x20030518	/* current version number */
+#define	MNAMELEN	1024		/* size of on/from name bufs */
+#define	STATFS_VERSION	0x20141215	/* current version number */
 struct statfs {
 	uint32_t f_version;		/* structure version number */
 	uint32_t f_type;		/* type of filesystem */
@@ -92,6 +92,32 @@ struct statfs {
 	char	  f_mntonname[MNAMELEN];    /* directory on which mounted */
 };
 
+#define	FREEBSD10_STATFS_VERSION	0x20030518 /* current version number */
+struct freebsd10_statfs {
+	uint32_t f_version;		/* structure version number */
+	uint32_t f_type;		/* type of filesystem */
+	uint64_t f_flags;		/* copy of mount exported flags */
+	uint64_t f_bsize;		/* filesystem fragment size */
+	uint64_t f_iosize;		/* optimal transfer block size */
+	uint64_t f_blocks;		/* total data blocks in filesystem */
+	uint64_t f_bfree;		/* free blocks in filesystem */
+	int64_t	 f_bavail;		/* free blocks avail to non-superuser */
+	uint64_t f_files;		/* total file nodes in filesystem */
+	int64_t	 f_ffree;		/* free nodes avail to non-superuser */
+	uint64_t f_syncwrites;		/* count of sync writes since mount */
+	uint64_t f_asyncwrites;		/* count of async writes since mount */
+	uint64_t f_syncreads;		/* count of sync reads since mount */
+	uint64_t f_asyncreads;		/* count of async reads since mount */
+	uint64_t f_spare[10];		/* unused spare */
+	uint32_t f_namemax;		/* maximum filename length */
+	uid_t	  f_owner;		/* user that mounted the filesystem */
+	fsid_t	  f_fsid;		/* filesystem id */
+	char	  f_charspare[80];	/* spare string space */
+	char	  f_fstypename[16];	/* filesystem type name */
+	char	  f_mntfromname[88];	/* mounted filesystem */
+	char	  f_mntonname[88];	/* directory on which mounted */
+};
+
 #ifdef _KERNEL
 #define	OMFSNAMELEN	16	/* length of fs type name, including null */
 #define	OMNAMELEN	(88 - 2 * sizeof(long))	/* size of on/from name bufs */

Modified: projects/ino64/sys/sys/stat.h
==============================================================================
--- projects/ino64/sys/sys/stat.h	Tue Dec 23 08:09:48 2014	(r276108)
+++ projects/ino64/sys/sys/stat.h	Tue Dec 23 08:09:55 2014	(r276109)
@@ -102,9 +102,9 @@ typedef	__uid_t		uid_t;
 #ifdef _KERNEL
 struct ostat {
 	__uint16_t st_dev;		/* inode's device */
-	ino_t	  st_ino;		/* inode's number */
+	__uint32_t st_ino;		/* inode's number */
 	mode_t	  st_mode;		/* inode protection mode */
-	nlink_t	  st_nlink;		/* number of hard links */
+	__uint16_t st_nlink;		/* number of hard links */
 	__uint16_t st_uid;		/* user ID of the file's owner */
 	__uint16_t st_gid;		/* group ID of the file's group */
 	__uint16_t st_rdev;		/* device type */
@@ -119,14 +119,15 @@ struct ostat {
 };
 #endif
 
-struct stat {
-	__dev_t   st_dev;		/* inode's device */
-	ino_t	  st_ino;		/* inode's number */
+#if __BSD_VISIBLE
+struct freebsd10_stat {
+	__uint32_t st_dev;		/* inode's device */
+	__uint32_t st_ino;		/* inode's number */
 	mode_t	  st_mode;		/* inode protection mode */
-	nlink_t	  st_nlink;		/* number of hard links */
+	__uint16_t st_nlink;		/* number of hard links */
 	uid_t	  st_uid;		/* user ID of the file's owner */
 	gid_t	  st_gid;		/* group ID of the file's group */
-	__dev_t   st_rdev;		/* device type */
+	__uint32_t st_rdev;		/* device type */
 	struct	timespec st_atim;	/* time of last access */
 	struct	timespec st_mtim;	/* time of last data modification */
 	struct	timespec st_ctim;	/* time of last file status change */
@@ -148,16 +149,38 @@ struct stat {
 	unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec));
 	unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec));
 };
+#endif
+
+struct stat {
+	dev_t     st_dev;		/* inode's device */
+	ino_t	  st_ino;		/* inode's number */
+	nlink_t	  st_nlink;		/* number of hard links */
+	mode_t	  st_mode;		/* inode protection mode */
+	__int16_t st_padding0;
+	uid_t	  st_uid;		/* user ID of the file's owner */
+	gid_t	  st_gid;		/* group ID of the file's group */
+	dev_t     st_rdev;		/* device type */
+	struct	timespec st_atim;	/* time of last access */
+	struct	timespec st_mtim;	/* time of last data modification */
+	struct	timespec st_ctim;	/* time of last file status change */
+	struct	timespec st_birthtim;	/* time of file creation */
+	off_t	  st_size;		/* file size, in bytes */
+	blkcnt_t st_blocks;		/* blocks allocated for file */
+	blksize_t st_blksize;		/* optimal blocksize for I/O */
+	fflags_t  st_flags;		/* user defined flags for file */
+	__uint64_t st_gen;		/* file generation number */
+	__uint64_t st_spare[10];
+};
 
 #ifdef _KERNEL
 struct nstat {
-	__dev_t   st_dev;		/* inode's device */
-	ino_t	  st_ino;		/* inode's number */
+	__uint32_t st_dev;		/* inode's device */
+	__uint32_t st_ino;		/* inode's number */
 	__uint32_t st_mode;		/* inode protection mode */
 	__uint32_t st_nlink;		/* number of hard links */
 	uid_t	  st_uid;		/* user ID of the file's owner */
 	gid_t	  st_gid;		/* group ID of the file's group */
-	__dev_t   st_rdev;		/* device type */
+	__uint32_t st_rdev;		/* device type */
 	struct	timespec st_atim;	/* time of last access */
 	struct	timespec st_mtim;	/* time of last data modification */
 	struct	timespec st_ctim;	/* time of last file status change */

Modified: projects/ino64/sys/sys/vnode.h
==============================================================================
--- projects/ino64/sys/sys/vnode.h	Tue Dec 23 08:09:48 2014	(r276108)
+++ projects/ino64/sys/sys/vnode.h	Tue Dec 23 08:09:55 2014	(r276109)
@@ -261,11 +261,12 @@ struct xvnode {
 struct vattr {
 	enum vtype	va_type;	/* vnode type (for create) */
 	u_short		va_mode;	/* files access mode and type */
-	short		va_nlink;	/* number of references to file */
+	u_short		va_padding0;
+	nlink_t		va_nlink;	/* number of references to file */
 	uid_t		va_uid;		/* owner user id */
 	gid_t		va_gid;		/* owner group id */
 	dev_t		va_fsid;	/* filesystem id */
-	long		va_fileid;	/* file id */
+	ino_t		va_fileid;	/* file id */
 	u_quad_t	va_size;	/* file size in bytes */
 	long		va_blocksize;	/* blocksize preferred for i/o */
 	struct timespec	va_atime;	/* time of last access */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412230809.sBN89uAe076715>