This is the mail archive of the cygwin-developers@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: key64_t? ino64_t?


On Sat, May 10, 2003 at 08:05:35PM +0200, Corinna Vinschen wrote:
>On Sat, May 10, 2003 at 02:04:07PM -0400, Christopher Faylor wrote:
>> On Sat, May 10, 2003 at 07:40:55PM +0200, Corinna Vinschen wrote:
>> >This is important to decide and to code ASAP, to get out 1.5.0 finally.
>> >
>> >Do we want a 64 bit key_t in Cygwin?  Yes?  No?  Who will do the changes?
>> 
>> I'd say yes.  The changes should be trivial compared to ino_t.
>> 
>> >Do we want a 64 bit ino_t in Cygwin?  Yes?  No?  Who will do the changes?
>> >(Probably me in this case).
>> 
>> Did you see my email to cygwin?  I said I had most of the changes done, AFAICT.
>
>Yeah, just too late. :-)

How does this look?  Did I miss anything?

(There's also a change to dirent.h in newlib which I haven't included)

cgf

Index: dir.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/dir.cc,v
retrieving revision 1.68
diff -u -p -r1.68 dir.cc
--- dir.cc	1 Apr 2003 16:11:41 -0000	1.68
+++ dir.cc	10 May 2003 18:56:42 -0000
@@ -146,6 +146,7 @@ readdir (DIR *dir)
 	  dir->__d_dirent->d_ino = hash_path_name (dino, res->d_name);
 	}
     }
+  dir->__d_dirent->old_d_ino = dir->__d_dirent->d_ino;	// just truncate
   return res;
 }
 
Index: fhandler.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler.h,v
retrieving revision 1.159
diff -u -p -r1.159 fhandler.h
--- fhandler.h	1 Apr 2003 16:11:41 -0000	1.159
+++ fhandler.h	10 May 2003 18:56:48 -0000
@@ -151,7 +151,7 @@ class fhandler_base
   int access;
   HANDLE io_handle;
 
-  unsigned long namehash;	/* hashed filename, used as inode num */
+  ino_t namehash;	/* hashed filename, used as inode num */
 
  protected:
   /* Full unix path name of this file */
@@ -292,7 +292,7 @@ class fhandler_base
 
   const char *get_name () { return unix_path_name; }
   const char *get_win32_name () { return win32_path_name; }
-  unsigned long get_namehash () { return namehash; }
+  ino_t get_namehash () { return namehash; }
 
   virtual void hclose (HANDLE h) {CloseHandle (h);}
   virtual void set_inheritance (HANDLE &h, int not_inheriting);
Index: fhandler_disk_file.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler_disk_file.cc,v
retrieving revision 1.48
diff -u -p -r1.48 fhandler_disk_file.cc
--- fhandler_disk_file.cc	11 Apr 2003 09:38:07 -0000	1.48
+++ fhandler_disk_file.cc	10 May 2003 18:56:49 -0000
@@ -250,7 +250,7 @@ fhandler_disk_file::fstat_helper (struct
     case DRIVE_RAMDISK:
       /* Although the documentation indicates otherwise, it seems like
 	 "inodes" on these devices are persistent, at least across reboots. */
-      buf->st_ino = nFileIndexHigh | nFileIndexLow;
+      buf->st_ino = (((ino_t) nFileIndexHigh) << 32) | (ino_t) nFileIndexLow;
       break;
     default:
       /* Either the nFileIndex* fields are unreliable or unavailable.  Use the
Index: fhandler_socket.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/fhandler_socket.cc,v
retrieving revision 1.90
diff -u -p -r1.90 fhandler_socket.cc
--- fhandler_socket.cc	1 Apr 2003 17:17:46 -0000	1.90
+++ fhandler_socket.cc	10 May 2003 18:56:52 -0000
@@ -442,14 +442,14 @@ fhandler_socket::fstat (struct __stat64 
       if (get_socket_type ()) /* fstat */
 	{
 	  buf->st_dev = 0;
-	  buf->st_ino = (ino_t) get_handle ();
+	  buf->st_ino = (ino_t) ((DWORD) get_handle ());
 	  buf->st_mode = S_IFSOCK | S_IRWXU | S_IRWXG | S_IRWXO;
 	}
       else
 	{
 	  path_conv spc ("/dev", PC_SYM_NOFOLLOW | PC_NULLEMPTY, NULL);
 	  buf->st_dev = spc.volser ();
-	  buf->st_ino = (ino_t) get_namehash ();
+	  buf->st_ino = get_namehash ();
 	  buf->st_mode &= ~S_IRWXO;
 	  buf->st_rdev = (get_device () << 16) | get_unit ();
 	}
Index: path.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/path.cc,v
retrieving revision 1.249
diff -u -p -r1.249 path.cc
--- path.cc	27 Apr 2003 03:09:17 -0000	1.249
+++ path.cc	10 May 2003 18:57:01 -0000
@@ -3185,7 +3185,7 @@ readlink (const char *path, char *buf, i
    the directory.  FIXME: Not bullet-proof. */
 /* Cygwin internal */
 
-unsigned long __stdcall
+ino_t __stdcall
 hash_path_name (ino_t hash, const char *name)
 {
   if (!*name)
Index: syscalls.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/syscalls.cc,v
retrieving revision 1.266
diff -u -p -r1.266 syscalls.cc
--- syscalls.cc	3 May 2003 16:03:19 -0000	1.266
+++ syscalls.cc	10 May 2003 18:57:03 -0000
@@ -990,7 +990,7 @@ static void
 stat64_to_stat32 (struct __stat64 *src, struct __stat32 *dst)
 {
   dst->st_dev = ((src->st_dev >> 8) & 0xff00) | (src->st_dev & 0xff);
-  dst->st_ino = src->st_ino;
+  dst->st_ino = ((unsigned) (src->st_ino >> 32)) | (unsigned) src->st_ino;
   dst->st_mode = src->st_mode;
   dst->st_nlink = src->st_nlink;
   dst->st_uid = src->st_uid;
Index: winsup.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/winsup.h,v
retrieving revision 1.112
diff -u -p -r1.112 winsup.h
--- winsup.h	28 Apr 2003 20:10:53 -0000	1.112
+++ winsup.h	10 May 2003 18:57:03 -0000
@@ -198,7 +199,7 @@ int __stdcall writable_directory (const 
 int __stdcall stat_dev (DWORD, int, unsigned long, struct __stat64 *);
 extern BOOL allow_ntsec;
 
-unsigned long __stdcall hash_path_name (ino_t hash, const char *name) __attribute__ ((regparm(2)));
+ino_t __stdcall hash_path_name (ino_t hash, const char *name) __attribute__ ((regparm(2)));
 void __stdcall nofinalslash (const char *src, char *dst) __attribute__ ((regparm(2)));
 extern "C" char *__stdcall rootdir (char *full_path) __attribute__ ((regparm(1)));
 
Index: include/cygwin/stat.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/cygwin/stat.h,v
retrieving revision 1.6
diff -u -p -r1.6 stat.h
--- include/cygwin/stat.h	1 Apr 2003 16:11:41 -0000	1.6
+++ include/cygwin/stat.h	10 May 2003 18:57:03 -0000
@@ -19,9 +19,9 @@ extern "C" {
 #ifdef __INSIDE_CYGWIN__
 struct __stat32
 {
-  __dev16_t     st_dev;
-  ino_t         st_ino;
-  mode_t        st_mode;
+  __dev16_t	st_dev;
+  __ino32_t	st_ino;
+  mode_t	st_mode;
   nlink_t       st_nlink;
   __uid16_t     st_uid;
   __gid16_t     st_gid;
@@ -38,7 +38,7 @@ struct __stat32
 struct __stat64
 {
   __dev32_t     st_dev;
-  ino_t         st_ino;
+  __ino64_t     st_ino;
   mode_t        st_mode;
   nlink_t       st_nlink;
   __uid32_t     st_uid;
Index: include/cygwin/types.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/cygwin/types.h,v
retrieving revision 1.18
diff -u -p -r1.18 types.h
--- include/cygwin/types.h	3 May 2003 18:14:29 -0000	1.18
+++ include/cygwin/types.h	10 May 2003 18:57:03 -0000
@@ -90,7 +90,13 @@ typedef __gid16_t gid_t;
 
 #ifndef __ino_t_defined
 #define __ino_t_defined
-typedef unsigned long ino_t;
+typedef unsigned long __ino32_t;
+typedef unsigned long long __ino64_t;
+#ifdef __CYGWIN_USE_BIG_TYPES__
+typedef __ino64_t ino_t;
+#else
+typedef __ino32_t ino_t;
+#endif
 #endif /*__ino_t_defined*/
 
 #ifndef __BIT_TYPES_DEFINED


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]