hurd-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

code for 64-bit flag day


From: Roland McGrath
Subject: code for 64-bit flag day
Date: Sun, 9 Jun 2002 16:22:14 -0400 (EDT)

I have made changes in my hurd and libc trees that I think cover the whole
64-bit flag day plan except for io_map.  Here are the patches for hurd.
I can send the patches for libc too if someone wants to actually try it out.

Mostly this is just the interface changes.  There are two changes I made
that are not directly related.  One is using ino_t instead of int for
diskfs's cache IDs; it always should have been ino_t and now it matters
because ino_t goes to 64 bits (and this fixes some problems for Alpha).
The other is using vm_size_t instead of int for various AMOUNT parameters
in RPCs (io_read et al).  Again, it always should have been that and the
size matters for Alpha (the signedness doesn't actually affect anything,
but unsigned is what it always should have been).

To recap the plan: the exported headers are now all LFS-aware, meaning that
they either always use the *64_t type names, or they test _FILE_OFFSET_BITS.
Code compiled with _FILE_OFFSET_BITS=32 (the default on x86) that uses the
hurd libraries will have to use the 64-named types (ino64_t, struct stat64,
etc).  The hurd itself is all compiled with -D_FILE_OFFSET_BITS=64, which is
why few or no changes were required to most of the code.

Because of the nature of C typedefs, you never need to test and can just
use the *64_t types.  Because of the nature of C structs, you need to be
using struct stat in _FILE_OFFSET_BITS=64 mode and struct stat64 in the
other mode.  I accomplished this without a lot of hair by using the
conditional in hurd_types.h and just using the typedefs like io_statbuf_t
in the other headers.  When compiling the hurd itself, or any time under
_FILE_OFFSET_BITS=64, that is typedef'd to struct stat.  When compiling
other programs under _FILE_OFFSET_BITS=32, it's struct stat64.

Most of the changes scattered in code are just to fix the printf formats
used for off_t or ino_t values.  Other than that it's primarily changes only
in the exported header files.

As far as I'm concerned this stuff is ready to go in.  I'm posting it here
to get some more eyeballs on it.  As soon as Marcus and/or Jeff are up to
it, I'd like to announce the sources are broken for a while, commit these
and the libc changes and get them all tested.  I think a sufficient baseline
test would be just to boot a newly-built hurd and run some old binaries and
see that nothing has changed visibly at user level.  Then you can try using
old binaries of dd, e2fsck, mke2fs to access a large partition (e.g. run
e2fsck -n on one of your Linux filesystems > 2GB, ideally > 4GB).

I've put off changing io_map because it's the only thing that's not
completely trivial on the hurd side.  I would like to commit the current set
of changes and have them tested before we touch it.  (The only reason we
really need to touch it soon is to avoid having an interface change again
later.  I can't see anything actually needing to mmap a region past 2GB any
time soon.)

I'm inclined to bump the hurd-version soname to 0.3 when we do this.
That would cover the old-package incompatibility question easily.


Index: ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/ChangeLog,v
retrieving revision 1.112
diff -u -r1.112 ChangeLog
--- ChangeLog   18 May 2002 21:30:53 -0000      1.112
+++ ChangeLog   9 Jun 2002 19:49:16 -0000
@@ -1,3 +1,12 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * Makeconf (CPPFLAGS): Add -D_FILE_OFFSET_BITS=64.
+
+2002-06-07  Roland McGrath  <address@hidden>
+
+       * libtreefs/treefs.h: Use io_statbuf_t in place of struct stat
+       throughout.
+
 2002-05-16  Roland McGrath  <address@hidden>
 
        * configure.in (asm_syntax): Add patterns for all the flavors we have
Index: Makeconf
===================================================================
RCS file: /cvsroot/hurd/hurd/Makeconf,v
retrieving revision 1.199
diff -u -r1.199 Makeconf
--- Makeconf    22 Mar 2002 07:54:04 -0000      1.199
+++ Makeconf    9 Jun 2002 19:49:17 -0000
@@ -58,7 +58,8 @@
 # Generic compiler options, appended to whatever the particular makefile set.
 # The config.make file will append the values chosed by configure.
 CPPFLAGS += -I. $(srcdirinc) -I.. $(top_srcdirinc) -I$(top_srcdir)/include \
-           -D_GNU_SOURCE -D_IO_MTSAFE_IO $($*-CPPFLAGS)
+           -D_GNU_SOURCE -D_IO_MTSAFE_IO -D_FILE_OFFSET_BITS=64 \
+           $($*-CPPFLAGS)
 CFLAGS += -Wall -g -O3
 
 # Include the configure-generated file of parameters.
Index: boot/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/boot/ChangeLog,v
retrieving revision 1.42
diff -u -r1.42 ChangeLog
--- boot/ChangeLog      1 Jun 2002 19:25:31 -0000       1.42
+++ boot/ChangeLog      9 Jun 2002 19:49:18 -0000
@@ -1,3 +1,7 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * boot.c (S_io_identity): Use ino_t for FILENO.
+
 2002-05-31  Roland McGrath  <address@hidden>
 
        * boot.c: Don't include "exec_S.h".
Index: boot/boot.c
===================================================================
RCS file: /cvsroot/hurd/hurd/boot/boot.c,v
retrieving revision 1.106
diff -u -r1.106 boot.c
--- boot/boot.c 1 Jun 2002 19:25:25 -0000       1.106
+++ boot/boot.c 9 Jun 2002 19:49:18 -0000
@@ -1750,7 +1750,7 @@
               mach_msg_type_name_t *idtype,
               mach_port_t *fsid,
               mach_msg_type_name_t *fsidtype,
-              int *fileno)
+              ino_t *fileno)
 {
   return EOPNOTSUPP;
 }
Index: ext2fs/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/ext2fs/ChangeLog,v
retrieving revision 1.84
diff -u -r1.84 ChangeLog
--- ext2fs/ChangeLog    5 Jun 2002 13:44:44 -0000       1.84
+++ ext2fs/ChangeLog    9 Jun 2002 19:49:19 -0000
@@ -1,3 +1,15 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * inode.c (diskfs_cached_lookup): Use ino_t for argument.
+
+       * ialloc.c (diskfs_free_node): Use %Ld format for ino_t/off_t values.
+       * pager.c (diskfs_grow, pager_unlock_page): Likewise.
+       * inode.c (read_node): Likewise.
+       * dir.c (diskfs_get_directs): Likewise.
+
+       * dir.c (diskfs_direnter_hard): Use size_t for OLDSIZE.
+       Fail with EOVERFLOW when it would exceed that width.
+
 2002-04-05  Neal H Walfield  <address@hidden>
 
        * pager.c (diskfs_grow): Correctly recalculate NEW_SIZE.
Index: ext2fs/dir.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ext2fs/dir.c,v
retrieving revision 1.42
diff -u -r1.42 dir.c
--- ext2fs/dir.c        2 Jun 2002 21:40:56 -0000       1.42
+++ ext2fs/dir.c        9 Jun 2002 19:49:20 -0000
@@ -411,7 +411,7 @@
          || EXT2_DIR_REC_LEN (entry->name_len) > entry->rec_len
          || memchr (entry->name, '\0', entry->name_len))
        {
-         ext2_warning ("bad directory entry: inode: %d offset: %zd",
+         ext2_warning ("bad directory entry: inode: %Ld offset: %zd",
                        dp->cache_id,
                        currentoff - blockaddr + idx * DIRBLKSIZ);
          return ENOENT;
@@ -531,7 +531,7 @@
   vm_address_t fromoff, tooff;
   int totfreed;
   error_t err;
-  off_t oldsize = 0;
+  size_t oldsize = 0;
 
   assert (ds->type == CREATE);
 
@@ -601,6 +601,12 @@
       assert (needed <= DIRBLKSIZ);
 
       oldsize = dp->dn_stat.st_size;
+      if ((off_t)(oldsize + DIRBLKSIZ) != dp->dn_stat.st_size)
+       {
+         /* We can't possibly map the whole directory in.  */
+         munmap ((caddr_t) ds->mapbuf, ds->mapextent);
+         return EOVERFLOW;
+       }
       while (oldsize + DIRBLKSIZ > dp->allocsize)
        {
          err = diskfs_grow (dp, oldsize + DIRBLKSIZ, cred);
@@ -1049,7 +1055,7 @@
 
       if (entryp->rec_len == 0)
        {
-         ext2_warning ("zero length directory entry: inode: %d offset: %zd",
+         ext2_warning ("zero length directory entry: inode: %Ld offset: %zd",
                        dp->cache_id,
                        blkno * DIRBLKSIZ + bufp - buf);
          return EIO;
@@ -1063,7 +1069,7 @@
        }
       else if (bufp - buf > DIRBLKSIZ)
        {
-         ext2_warning ("directory entry too long: inode: %d offset: %zd",
+         ext2_warning ("directory entry too long: inode: %Ld offset: %zd",
                        dp->cache_id,
                        blkno * DIRBLKSIZ + bufp - buf - entryp->rec_len);
          return EIO;
Index: ext2fs/ialloc.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ext2fs/ialloc.c,v
retrieving revision 1.36
diff -u -r1.36 ialloc.c
--- ext2fs/ialloc.c     17 Aug 2001 00:42:41 -0000      1.36
+++ ext2fs/ialloc.c     9 Jun 2002 19:49:21 -0000
@@ -1,6 +1,6 @@
 /* Inode allocation routines.
 
-   Copyright (C) 1995,96,99,2000 Free Software Foundation, Inc.
+   Copyright (C) 1995,96,99,2000,02 Free Software Foundation, Inc.
 
    Converted to work under the hurd by Miles Bader <address@hidden>
 
@@ -66,7 +66,7 @@
 
   if (inum < EXT2_FIRST_INO (sblock) || inum > sblock->s_inodes_count)
     {
-      ext2_error ("reserved inode or nonexistent inode: %u", inum);
+      ext2_error ("reserved inode or nonexistent inode: %Ld", inum);
       spin_unlock (&global_lock);
       return;
     }
@@ -78,7 +78,7 @@
   bh = bptr (gdp->bg_inode_bitmap);
 
   if (!clear_bit (bit, bh))
-    ext2_warning ("bit already cleared for inode %u", inum);
+    ext2_warning ("bit already cleared for inode %Ld", inum);
   else
     {
       record_global_poke (bh);
Index: ext2fs/inode.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ext2fs/inode.c,v
retrieving revision 1.60
diff -u -r1.60 inode.c
--- ext2fs/inode.c      4 Jan 2002 01:39:33 -0000       1.60
+++ ext2fs/inode.c      9 Jun 2002 19:49:21 -0000
@@ -63,7 +63,7 @@
 /* Fetch inode INUM, set *NPP to the node structure;
    gain one user reference and lock the node.  */
 error_t
-diskfs_cached_lookup (int inum, struct node **npp)
+diskfs_cached_lookup (ino_t inum, struct node **npp)
 {
   error_t err;
   struct node *np;
@@ -275,7 +275,7 @@
       info->i_high_size = di->i_size_high;
       if (info->i_high_size)   /* XXX */
        {
-         ext2_warning ("cannot handle large file inode %d", np->cache_id);
+         ext2_warning ("cannot handle large file inode %Ld", np->cache_id);
          return EFBIG;
        }
     }
Index: ext2fs/pager.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ext2fs/pager.c,v
retrieving revision 1.72
diff -u -r1.72 pager.c
--- ext2fs/pager.c      5 Jun 2002 13:44:44 -0000       1.72
+++ ext2fs/pager.c      9 Jun 2002 19:49:21 -0000
@@ -572,7 +572,7 @@
       if (err == ENOSPC)
        ext2_warning ("This filesystem is out of space, and will now crash.  
Bye!");
       else if (err)
-       ext2_warning ("inode=%d, page=0x%zx: %s",
+       ext2_warning ("inode=%Ld, page=0x%zx: %s",
                      node->cache_id, page, strerror (err));
 
       return err;
@@ -660,7 +660,7 @@
                  dn->last_page_partially_writable
                  ? " (last page writable)": "");
       if (err)
-       ext2_warning ("inode=%d, target=%ld: %s",
+       ext2_warning ("inode=%Ld, target=%Ld: %s",
                      node->cache_id, new_size, strerror (err));
 
       node->allocsize = new_size;
Index: hurd/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/hurd/ChangeLog,v
retrieving revision 1.49
diff -u -r1.49 ChangeLog
--- hurd/ChangeLog      8 Jun 2002 02:49:41 -0000       1.49
+++ hurd/ChangeLog      9 Jun 2002 19:49:22 -0000
@@ -1,3 +1,26 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * hurd_types.defs (loff_t, ino64_t): New types, 64 bits.
+       (off_t): Type removed.
+       (off_array_t): Use loff_t instead of off_t as base type.
+       * hurd_types.h (off_array_t): Likewise.
+       [_FILE_OFFSET_BITS != 64] (io_statbuf_t, fsys_statfsbuf_t): Define
+       using struct stat64/statfs64 instead of struct stat/statfs.
+       * io.defs (io_identity): Use ino64_t for FILENO.
+       * fs.defs (file_set_size): off_t -> loff_t
+       * fs_notify.defs (file_changed): Likewise.
+       * io.defs (io_write, io_read, io_seek): Likewise.
+       * io_request.defs: Likewise for those RPCs' *_request variants.
+       * io_reply.defs: Likewise for those RPCs' *_reply variants.
+
+       * hurd_types.defs (size_t): Remove type.
+       * fs.defs (dir_readdir): Use vm_size_t for AMOUNT.
+       * socket.defs (socket_send, socket_recv): Likewise.
+       * pfinet.defs (pfinet_siocgifconf): Likewise.
+       * io.defs (io_write, io_read, io_readable): Likewise.
+       * io_request.defs: Likewise for those RPCs' *_request variants.
+       * io_reply.defs: Likewise for those RPCs' *_reply variants.
+
 2002-06-07  Roland McGrath  <address@hidden>
 
        * hurd_types.defs (dev_t, ssize_t): Remove unused types.
Index: hurd/fs.defs
===================================================================
RCS file: /cvsroot/hurd/hurd/hurd/fs.defs,v
retrieving revision 1.48
diff -u -r1.48 fs.defs
--- hurd/fs.defs        5 Mar 2002 01:28:59 -0000       1.48
+++ hurd/fs.defs        9 Jun 2002 19:49:22 -0000
@@ -1,5 +1,5 @@
 /* Definitions for the filesystem interface.
-   Copyright (C) 1994,95,96,97,98,99, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1994,95,96,97,98,99,2002 Free Software Foundation, Inc.
 
 This file is part of the GNU Hurd.
 
@@ -108,7 +108,7 @@
 routine file_set_size (
        trunc_file: file_t;
        RPT
-       new_size: off_t);
+       new_size: loff_t);
 
 /* Apply/manipulate advisory lock */
 routine file_lock (
@@ -235,7 +235,7 @@
        entry: int;
        nentries: int;
        bufsiz: vm_size_t;
-       out amount: int);
+       out amount: vm_size_t);
 
 /* Create directory */
 routine dir_mkdir (
Index: hurd/fs_notify.defs
===================================================================
RCS file: /cvsroot/hurd/hurd/hurd/fs_notify.defs,v
retrieving revision 1.1
diff -u -r1.1 fs_notify.defs
--- hurd/fs_notify.defs 17 Jan 1995 09:23:36 -0000      1.1
+++ hurd/fs_notify.defs 9 Jun 2002 19:49:22 -0000
@@ -1,5 +1,5 @@
 /* Miscellaneous callbacks from Hurd fs servers to their clients.
-   Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1991,92,93,94,95,2002 Free Software Foundation, Inc.
 
 This file is part of the GNU Hurd.
 
@@ -8,7 +8,7 @@
 the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
-The GNU Hurd is distributed in the hope that it will be useful, 
+The GNU Hurd is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
@@ -26,7 +26,7 @@
 #endif
 
 
-/* This is sent by a filesystem (after being requested with 
+/* This is sent by a filesystem (after being requested with
    dir_notice_changes) every time a directory is changed.
    CHANGE identifies the sort of change that has occurred (see hurd_types.h);
    NAME is the name that was changed.  */
@@ -42,5 +42,5 @@
 routine file_changed (
        notify_port: mach_port_t;
        change: file_changed_type_t;
-       start: off_t;
-       end: off_t);
+       start: loff_t;
+       end: loff_t);
Index: hurd/hurd_types.defs
===================================================================
RCS file: /cvsroot/hurd/hurd/hurd/hurd_types.defs,v
retrieving revision 1.23
diff -u -r1.23 hurd_types.defs
--- hurd/hurd_types.defs        8 Jun 2002 02:49:29 -0000       1.23
+++ hurd/hurd_types.defs        9 Jun 2002 19:49:23 -0000
@@ -198,14 +198,14 @@
 type retry_type = unsigned32;
 type pid_t = int32;
 type wait_status_t = int32;
-type off_t = int32;
-type size_t = unsigned32;
+type loff_t = int64;
+type ino64_t = int64;
 type file_changed_type_t = unsigned32;
 type dir_changed_type_t = unsigned32;
 
 type portarray_t = array[] of mach_port_send_t;
 type intarray_t = array[] of int;
-type off_array_t = array[] of off_t;
+type off_array_t = array[] of loff_t;
 
 type pidarray_t = array[] of pid_t;
 type procinfo_t = array[] of int;
Index: hurd/hurd_types.h
===================================================================
RCS file: /cvsroot/hurd/hurd/hurd/hurd_types.h,v
retrieving revision 1.44
diff -u -r1.44 hurd_types.h
--- hurd/hurd_types.h   5 Jun 2002 23:27:36 -0000       1.44
+++ hurd/hurd_types.h   9 Jun 2002 19:49:23 -0000
@@ -57,12 +57,17 @@
 typedef mach_port_t *portarray_t;
 typedef pid_t *pidarray_t;
 typedef uid_t *idarray_t;
-typedef off_t *off_array_t;
+typedef loff_t *off_array_t;
 typedef struct rusage rusage_t;
 typedef struct flock flock_t;
 typedef struct utsname utsname_t;
+#if _FILE_OFFSET_BITS == 64
 typedef struct stat io_statbuf_t;
 typedef struct statfs fsys_statfsbuf_t;
+#else
+typedef struct stat64 io_statbuf_t;
+typedef struct statfs64 fsys_statfsbuf_t;
+#endif
 
 
 /*   Parameters and flags in RPC calls   */
Index: hurd/io.defs
===================================================================
RCS file: /cvsroot/hurd/hurd/hurd/io.defs,v
retrieving revision 1.35
diff -u -r1.35 io.defs
--- hurd/io.defs        2 Jan 2002 05:42:35 -0000       1.35
+++ hurd/io.defs        9 Jun 2002 19:49:23 -0000
@@ -1,5 +1,5 @@
 /* Definitions for generic IO interface
-   Copyright (C) 1991,93,94,95,96,99,2001 Free Software Foundation, Inc.
+   Copyright (C) 1991,93,94,95,96,99,2001,02 Free Software Foundation, Inc.
 
 This file is part of the GNU Hurd.
 
@@ -43,8 +43,8 @@
        io_object: io_t;
        RPT
        data: data_t SCP;
-       offset: off_t;
-       out amount: size_t);
+       offset: loff_t;
+       out amount: vm_size_t);
 
 /* Read data from an IO object.  If offset if -1, read from the object
    maintained file pointer.  If the object is not seekable, offset is
@@ -53,16 +53,16 @@
        io_object: io_t;
        RPT
        out data: data_t, dealloc;
-       offset: off_t;
-       amount: size_t);
+       offset: loff_t;
+       amount: vm_size_t);
 
 /* Change current read/write offset */
 routine io_seek (
        io_object: io_t;
        RPT
-       offset: off_t;
+       offset: loff_t;
        whence: int;
-       out newp: off_t);
+       out newp: loff_t);
 
 /* Tell how much data can be read from the object without blocking for
    a "long time" (this should be the same meaning of "long time" used
@@ -70,7 +70,7 @@
 routine io_readable (
        io_object: io_t;
        RPT
-       out amount: size_t);
+       out amount: vm_size_t);
 
 /* These four routines modify the O_APPEND, O_ASYNC, O_FSYNC, and
    O_NONBLOCK bits for the IO object. In addition, io_get_openmodes
@@ -316,7 +316,7 @@
        RPT
        out idport: mach_port_send_t;
        out fsidport: mach_port_send_t;
-       out fileno: int);
+       out fileno: ino64_t);
 
 /* Revoke the access of all descriptors except this one currently open
    on the specified object.  */
Index: hurd/io_reply.defs
===================================================================
RCS file: /cvsroot/hurd/hurd/hurd/io_reply.defs,v
retrieving revision 1.9
diff -u -r1.9 io_reply.defs
--- hurd/io_reply.defs  2 Jan 2002 02:08:11 -0000       1.9
+++ hurd/io_reply.defs  9 Jun 2002 19:49:23 -0000
@@ -1,5 +1,5 @@
 /* Definitions for generic IO interface
-   Copyright (C) 1991,93,94,95,2000,01 Free Software Foundation, Inc.
+   Copyright (C) 1991,93,94,95,2000,01,02 Free Software Foundation, Inc.
 
 This file is part of the GNU Hurd.
 
@@ -34,7 +34,7 @@
 simpleroutine io_write_reply (
        reply: reply_port_t;
        RETURN_CODE_ARG;
-       amount: int);
+       amount: vm_size_t);
 
 simpleroutine io_read_reply (
        reply: reply_port_t;
@@ -44,12 +44,12 @@
 simpleroutine io_seek_reply (
        reply: reply_port_t;
        RETURN_CODE_ARG;
-       newp: off_t);
+       newp: loff_t);
 
 simpleroutine io_readable_reply (
        reply: reply_port_t;
        RETURN_CODE_ARG;
-       amount: int);
+       amount: vm_size_t);
 
 simpleroutine io_set_all_openmodes_reply (
        reply: reply_port_t;
Index: hurd/io_request.defs
===================================================================
RCS file: /cvsroot/hurd/hurd/hurd/io_request.defs,v
retrieving revision 1.3
diff -u -r1.3 io_request.defs
--- hurd/io_request.defs        16 Jan 1995 22:35:28 -0000      1.3
+++ hurd/io_request.defs        9 Jun 2002 19:49:23 -0000
@@ -1,5 +1,5 @@
 /* Definitions for generic IO interface
-   Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation
+   Copyright (C) 1991,93,94,95,2002 Free Software Foundation, Inc.
 
 This file is part of the GNU Hurd.
 
@@ -8,7 +8,7 @@
 the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
-The GNU Hurd is distributed in the hope that it will be useful, 
+The GNU Hurd is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
@@ -35,18 +35,18 @@
                io_object: io_t;
                reply: reply_port_t;
                data: data_t;
-               offset: off_t);
+               offset: loff_t);
 
 simpleroutine io_read_request (
                io_object: io_t;
                reply: reply_port_t;
-               offset: off_t;
-               amount: int);
+               offset: loff_t;
+               amount: vm_size_t);
 
 simpleroutine io_seek_request (
                io_object: io_t;
                reply: reply_port_t;
-               offset: off_t;
+               offset: loff_t;
                whence: int);
 
 simpleroutine io_readable_request (
@@ -160,7 +160,3 @@
 simpleroutine io_sigio_request (
                io_object: io_t;
                reply: reply_port_t);
-
-
-               
-               
Index: hurd/pfinet.defs
===================================================================
RCS file: /cvsroot/hurd/hurd/hurd/pfinet.defs,v
retrieving revision 1.3
diff -u -r1.3 pfinet.defs
--- hurd/pfinet.defs    11 Jan 2001 22:28:29 -0000      1.3
+++ hurd/pfinet.defs    9 Jun 2002 19:49:23 -0000
@@ -1,5 +1,5 @@
 /* Definitions for pfinet-specific calls
-   Copyright (C) 1999, 2000 Free Software Foundation
+   Copyright (C) 1999,2000,02 Free Software Foundation, Inc.
 
 This file is part of the GNU Hurd.
 
@@ -8,7 +8,7 @@
 the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
-The GNU Hurd is distributed in the hope that it will be useful, 
+The GNU Hurd is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
@@ -34,6 +34,6 @@
    space) for BSD compatibility.  */
 routine pfinet_siocgifconf (
        port: io_t;
-       amount: int;
+       amount: vm_size_t;
        out buf: data_t, dealloc
 );
Index: hurd/socket.defs
===================================================================
RCS file: /cvsroot/hurd/hurd/hurd/socket.defs,v
retrieving revision 1.19
diff -u -r1.19 socket.defs
--- hurd/socket.defs    2 Jan 2002 05:42:35 -0000       1.19
+++ hurd/socket.defs    9 Jun 2002 19:49:23 -0000
@@ -1,5 +1,5 @@
 /* Definitions for socket interface
-   Copyright (C) 1991,93,94,95,2001 Free Software Foundation, Inc.
+   Copyright (C) 1991,93,94,95,2001,02 Free Software Foundation, Inc.
 
 This file is part of the GNU Hurd.
 
@@ -122,7 +122,7 @@
        data: data_t SCP;
        ports: portarray_t SCP;
        control: data_t SCP;
-       out amount: size_t);
+       out amount: vm_size_t);
 
 /* Receive data from a socket, possibly including Mach ports.  */
 routine socket_recv (
@@ -133,4 +133,4 @@
        out ports: portarray_t, dealloc;
        out control: data_t, dealloc;
        out outflags: int;
-       amount: size_t);
+       amount: vm_size_t);
Index: isofs/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/isofs/ChangeLog,v
retrieving revision 1.33
diff -u -r1.33 ChangeLog
--- isofs/ChangeLog     8 May 2002 10:08:07 -0000       1.33
+++ isofs/ChangeLog     9 Jun 2002 19:49:23 -0000
@@ -1,3 +1,7 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * inode.c (diskfs_cached_lookup): Use ino_t for argument.
+
 2002-05-08  Roland McGrath  <address@hidden>
 
        * rr.c (rrip_work): Cast pointer to uintptr_t instead of int.
Index: isofs/inode.c
===================================================================
RCS file: /cvsroot/hurd/hurd/isofs/inode.c,v
retrieving revision 1.14
diff -u -r1.14 inode.c
--- isofs/inode.c       20 Feb 2001 19:37:28 -0000      1.14
+++ isofs/inode.c       9 Jun 2002 19:49:24 -0000
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1997,98,2002 Free Software Foundation, Inc.
    Written by Thomas Bushnell, n/BSG.
 
    This file is part of the GNU Hurd.
@@ -100,7 +100,7 @@
       }
   if ((rr->valid & VALID_MD) && (rr->allmode & S_IFDIR))
       return 0;
-      
+
   /* If it is a symlink or a zero length file, don't use file_start.  */
   if (rr->valid & VALID_SL || isonum_733 (record->size) == 0)
     return 0;
@@ -163,7 +163,7 @@
 /* Fetch inode with cache id ID; set *NPP to the node structure;
    gain one user reference and lock the node. */
 error_t
-diskfs_cached_lookup (int id, struct node **npp)
+diskfs_cached_lookup (ino_t id, struct node **npp)
 {
   struct node *np;
   error_t err;
Index: libdiskfs/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/libdiskfs/ChangeLog,v
retrieving revision 1.179
diff -u -r1.179 ChangeLog
--- libdiskfs/ChangeLog 27 May 2002 01:43:17 -0000      1.179
+++ libdiskfs/ChangeLog 9 Jun 2002 19:49:27 -0000
@@ -1,3 +1,16 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * io-identity.c (diskfs_S_io_identity): Use ino_t for FILENO.
+
+       * dir-readdir.c (diskfs_S_dir_readdir): Use vm_size_t for AMT.
+
+       * diskfs.h (struct node): Use io_statbuf_t instead of struct stat.
+       (struct node): Use ino64_t for cache_id.
+       (struct node): Use loff_t instead of off_t.
+       (diskfs_grow, diskfs_truncate, diskfs_node_rdwr): Likewise.
+       (diskfs_notice_filechange): Likewise.
+       (diskfs_cached_lookup): Use ino64_t for CACHE_ID argument.
+
 2002-05-26  Roland McGrath  <address@hidden>
 
        * dir-unlink.c (diskfs_S_dir_unlink): Return EPERM instead of EISDIR,
Index: libdiskfs/dir-readdir.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libdiskfs/dir-readdir.c,v
retrieving revision 1.8
diff -u -r1.8 dir-readdir.c
--- libdiskfs/dir-readdir.c     8 May 2002 09:57:08 -0000       1.8
+++ libdiskfs/dir-readdir.c     9 Jun 2002 19:49:27 -0000
@@ -31,7 +31,7 @@
                      int entry,
                      int nentries,
                      vm_size_t bufsiz,
-                     int *amt)
+                     vm_size_t *amt)
 {
   error_t err;
   struct node *np;
Index: libdiskfs/diskfs.h
===================================================================
RCS file: /cvsroot/hurd/hurd/libdiskfs/diskfs.h,v
retrieving revision 1.96
diff -u -r1.96 diskfs.h
--- libdiskfs/diskfs.h  11 May 2002 19:12:42 -0000      1.96
+++ libdiskfs/diskfs.h  9 Jun 2002 19:49:27 -0000
@@ -75,7 +75,7 @@
 
   struct disknode *dn;
 
-  struct stat dn_stat;
+  io_statbuf_t dn_stat;
 
   /* Stat has been modified if one of the following four fields
      is nonzero.  Also, if one of the dn_set_?time fields is nonzero,
@@ -104,9 +104,9 @@
 
   struct modreq *filemod_reqs;
 
-  off_t allocsize;
+  loff_t allocsize;
 
-  int cache_id;
+  ino64_t cache_id;
 
   int author_tracks_uid;
 };
@@ -399,13 +399,13 @@
    long, do nothing.)  If this is a symlink (and diskfs_shortcut_symlink
    is set) then this should clear the symlink, even if
    diskfs_create_symlink_hook stores the link target elsewhere.  */
-error_t diskfs_truncate (struct node *np, off_t size);
+error_t diskfs_truncate (struct node *np, loff_t size);
 
 /* The user must define this function.  Grow the disk allocated to locked node
    NP to be at least SIZE bytes, and set NP->allocsize to the actual
    allocated size.  (If the allocated size is already SIZE bytes, do
    nothing.)  CRED identifies the user responsible for the call.  */
-error_t diskfs_grow (struct node *np, off_t size, struct protid *cred);
+error_t diskfs_grow (struct node *np, loff_t size, struct protid *cred);
 
 /* The user must define this function.  Write to disk (synchronously
    iff WAIT is nonzero) from format-specific buffers any non-paged
@@ -631,7 +631,7 @@
    extension).  For reads, *AMTREAD is filled with the amount actually
    read.  */
 error_t
-diskfs_node_rdwr (struct node *np, char *data, off_t off,
+diskfs_node_rdwr (struct node *np, char *data, loff_t off,
                  size_t amt, int dir, struct protid *cred,
                  size_t *amtread);
 
@@ -652,7 +652,7 @@
    This should be called after the change is fully completed.  */
 void
 diskfs_notice_filechange (struct node *np, enum file_changed_type type,
-                         off_t start, off_t end);
+                         loff_t start, loff_t end);
 
 /* Create a new node structure with DS as its physical disknode.
    The new node will have one hard reference and no light references.  */
@@ -750,7 +750,7 @@
                          const char *name, struct dirstat *ds);
 
 /* Return the node corresponding to CACHE_ID in *NPP. */
-error_t diskfs_cached_lookup (int cache_id, struct node **npp);
+error_t diskfs_cached_lookup (ino64_t cache_id, struct node **npp);
 
 /* Create a new node. Give it MODE; if that includes IFDIR, also
    initialize `.' and `..' in the new directory.  Return the node in NPP.
Index: libdiskfs/io-identity.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libdiskfs/io-identity.c,v
retrieving revision 1.8
diff -u -r1.8 io-identity.c
--- libdiskfs/io-identity.c     1 Apr 2001 01:39:52 -0000       1.8
+++ libdiskfs/io-identity.c     9 Jun 2002 19:49:28 -0000
@@ -1,5 +1,5 @@
 /* libdiskfs implementation of io_identity RPC
-   Copyright (C) 1996, 1997, 1998, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1996,97,98,2001,02 Free Software Foundation, Inc.
    Written by Michael I. Bushnell, p/BSG.
 
    This file is part of the GNU Hurd.
@@ -28,7 +28,7 @@
                      mach_msg_type_name_t *idtype,
                      mach_port_t *fsys,
                      mach_msg_type_name_t *fsystype,
-                     int *fileno)
+                     ino_t *fileno)
 {
   struct node *np;
   error_t err;
Index: libfshelp/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/libfshelp/ChangeLog,v
retrieving revision 1.30
diff -u -r1.30 ChangeLog
--- libfshelp/ChangeLog 28 May 2002 23:59:05 -0000      1.30
+++ libfshelp/ChangeLog 9 Jun 2002 19:49:28 -0000
@@ -1,3 +1,8 @@
+2002-06-07  Roland McGrath  <address@hidden>
+
+       * fshelp.h: Use io_statbuf_t in place of struct stat throughout.
+       (fshelp_get_identity): ino_t -> ino64_t
+
 2002-05-10  Roland McGrath  <address@hidden>
 
        * exec-reauth.c (fshelp_exec_reauth): Always set *SECURE if nonnull,
Index: libfshelp/fshelp.h
===================================================================
RCS file: /cvsroot/hurd/hurd/libfshelp/fshelp.h,v
retrieving revision 1.49
diff -u -r1.49 fshelp.h
--- libfshelp/fshelp.h  5 Mar 2002 01:28:59 -0000       1.49
+++ libfshelp/fshelp.h  9 Jun 2002 19:49:29 -0000
@@ -194,7 +194,7 @@
    notifications) are used.
    */
 error_t fshelp_get_identity (struct port_bucket *bucket,
-                            ino_t fileno, mach_port_t *pt);
+                            ino64_t fileno, mach_port_t *pt);
 
 
 
@@ -236,26 +236,26 @@
 /* Check to see whether USER should be considered the owner of the
    file identified by ST.  If so, return zero; otherwise return an
    appropriate error code. */
-error_t fshelp_isowner (struct stat *st, struct iouser *user);
+error_t fshelp_isowner (io_statbuf_t *st, struct iouser *user);
 
 /* Check to see whether USER should be considered a controller of the
    filesystem.  Which is to say, check to see if we should give USER the
    control port.  ST is the stat of the root node.  USER is the user
    asking for a send right to the control port.  */
 error_t
-fshelp_iscontroller (struct stat *st, struct iouser *user);
+fshelp_iscontroller (io_statbuf_t *st, struct iouser *user);
 
 /* Check to see whether the user USER can operate on a file identified
    by ST.  OP is one of S_IREAD, S_IWRITE, and S_IEXEC.  If the access
    is permitted, return zero; otherwise return an appropriate error
    code.  */
-error_t fshelp_access (struct stat *st, int op, struct iouser *user);
+error_t fshelp_access (io_statbuf_t *st, int op, struct iouser *user);
 
 /* Check to see whether USER is allowed to modify DIR with respect to
    existing file ST.  (If there is no existing file, pass 0 for ST.)
    If the access is permissable return 0; otherwise return an
    appropriate error code.  */
-error_t fshelp_checkdirmod (struct stat *dir, struct stat *st,
+error_t fshelp_checkdirmod (io_statbuf_t *dir, io_statbuf_t *st,
                            struct iouser *user);
 
 
@@ -266,6 +266,6 @@
 
 /* Change the stat times of NODE as indicated by WHAT (from the set TOUCH_*)
    to the current time.  */
-void fshelp_touch (struct stat *st, unsigned what,
+void fshelp_touch (io_statbuf_t *st, unsigned what,
                   volatile struct mapped_time_value *maptime);
 #endif
Index: libftpconn/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/libftpconn/ChangeLog,v
retrieving revision 1.24
diff -u -r1.24 ChangeLog
--- libftpconn/ChangeLog        8 May 2002 09:28:28 -0000       1.24
+++ libftpconn/ChangeLog        9 Jun 2002 19:49:29 -0000
@@ -1,3 +1,8 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * ftpconn.h (ftp_conn_add_stat_fun_t) [_FILE_OFFSET_BITS != 64]:
+       Use struct stat64 in place of struct stat.
+
 2002-05-07  Roland McGrath  <address@hidden>
 
        * xfer.c (ftp_conn_start_open_actv_data): size_t -> socklen_t
Index: libftpconn/ftpconn.h
===================================================================
RCS file: /cvsroot/hurd/hurd/libftpconn/ftpconn.h,v
retrieving revision 1.12
diff -u -r1.12 ftpconn.h
--- libftpconn/ftpconn.h        22 Dec 2001 20:31:48 -0000      1.12
+++ libftpconn/ftpconn.h        9 Jun 2002 19:49:29 -0000
@@ -1,6 +1,6 @@
 /* Manage an ftp connection
 
-   Copyright (C) 1997,2001 Free Software Foundation, Inc.
+   Copyright (C) 1997,2001,02 Free Software Foundation, Inc.
 
    Written by Miles Bader <address@hidden>
 
@@ -49,7 +49,11 @@
    symlink.  NAME and SYMLINK_TARGET should be copied if they are used
    outside of this function.  HOOK is as passed into ...get_stats.  */
 typedef error_t (*ftp_conn_add_stat_fun_t) (const char *name,
+# if _FILE_OFFSET_BITS == 64
                                            const struct stat *stat,
+# else
+                                           const struct stat64 *stat,
+# endif
                                            const char *symlink_target,
                                            void *hook);
 
Index: libnetfs/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/libnetfs/ChangeLog,v
retrieving revision 1.68
diff -u -r1.68 ChangeLog
--- libnetfs/ChangeLog  23 May 2002 21:24:18 -0000      1.68
+++ libnetfs/ChangeLog  9 Jun 2002 19:49:30 -0000
@@ -1,3 +1,17 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * io-identity.c (netfs_S_io_identity): Use ino_t for FILENO.
+
+       * dir-readdir.c (netfs_S_dir_readdir): Use vm_size_t for AMT.
+
+2002-06-07  Roland McGrath  <address@hidden>
+
+       * netfs.h (struct node): Use io_statbuf_t instead of struct stat.
+       (netfs_attempt_statfs): Use fsys_statfsbuf_t instead of struct statfs.
+       (struct peropen): Use loff_t instead of off_t.
+       (netfs_attempt_read, netfs_attempt_write): Likewise.
+       (netfs_attempt_set_size, netfs_file_get_storage_info): Likewise.
+
 2002-05-23  Marcus Brinkmann  <address@hidden>
 
        * io-read.c (netfs_S_io_read): If desired amount is larger than
Index: libnetfs/dir-readdir.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libnetfs/dir-readdir.c,v
retrieving revision 1.5
diff -u -r1.5 dir-readdir.c
--- libnetfs/dir-readdir.c      11 Oct 1999 09:02:59 -0000      1.5
+++ libnetfs/dir-readdir.c      9 Jun 2002 19:49:30 -0000
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996,99,2002 Free Software Foundation, Inc.
    Written by Michael I. Bushnell, p/BSG.
 
    This file is part of the GNU Hurd.
@@ -31,7 +31,7 @@
                     int entry,
                     int nentries,
                     vm_size_t bufsiz,
-                    int *amt)
+                    vm_size_t *amt)
 {
   error_t err;
   struct node *np;
Index: libnetfs/io-identity.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libnetfs/io-identity.c,v
retrieving revision 1.5
diff -u -r1.5 io-identity.c
--- libnetfs/io-identity.c      18 Nov 1996 23:50:44 -0000      1.5
+++ libnetfs/io-identity.c      9 Jun 2002 19:49:30 -0000
@@ -1,5 +1,5 @@
 /* libnetfs implementation of io_identity RPC
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 2002 Free Software Foundation, Inc.
    Written by Michael I. Bushnell, p/BSG.
 
    This file is part of the GNU Hurd.
@@ -27,17 +27,17 @@
                     mach_msg_type_name_t *idtype,
                     mach_port_t *fsys,
                     mach_msg_type_name_t *fsystype,
-                    int *fileno)
+                    ino_t *fileno)
 {
   struct node *np;
   error_t err;
-  
+
   if (!cred)
     return EOPNOTSUPP;
-  
+
   np = cred->po->np;
   mutex_lock (&np->lock);
-  
+
   err = netfs_validate_stat (np, cred->user);
   if (err)
     {
@@ -55,7 +55,7 @@
   *fsys = netfs_fsys_identity;
   *fsystype = MACH_MSG_TYPE_MAKE_SEND;
   *fileno = np->nn_stat.st_ino;
-  
+
   mutex_unlock (&np->lock);
   return 0;
 }
Index: libnetfs/netfs.h
===================================================================
RCS file: /cvsroot/hurd/hurd/libnetfs/netfs.h,v
retrieving revision 1.32
diff -u -r1.32 netfs.h
--- libnetfs/netfs.h    13 May 2002 22:23:37 -0000      1.32
+++ libnetfs/netfs.h    9 Jun 2002 19:49:30 -0000
@@ -48,7 +48,7 @@
 /* One of these is created for each open */
 struct peropen
 {
-  off_t filepointer;
+  loff_t filepointer;
   int lock_status;
   int refcnt;
   int openstat;
@@ -73,7 +73,7 @@
   struct netnode *nn;
 
   /* The stat information for this particular node.  */
-  struct stat nn_stat;
+  io_statbuf_t nn_stat;
   /* The S_IPTRANS and S_IFMT bits here are examined instead of nn_stat.st_mode
      to decide whether to do passive translator processing.  Other bits
      are ignored, so you can set this to nn_stat.st_mode if you want that.  */
@@ -172,13 +172,13 @@
 /* The user must define this function.  This should attempt to set the
    size of the locked file NP (for user CRED) to SIZE bytes long.  */
 error_t netfs_attempt_set_size (struct iouser *cred, struct node *np,
-                               off_t size);
+                               loff_t size);
 
 /* The user must define this function.  This should attempt to fetch
    filesystem status information for the remote filesystem, for the
    user CRED. NP is locked.  */
 error_t netfs_attempt_statfs (struct iouser *cred, struct node *np,
-                             struct statfs *st);
+                             fsys_statfsbuf_t *st);
 
 /* The user must define this function.  This should sync the locked
    file NP completely to disk, for the user CRED.  If WAIT is set,
@@ -260,14 +260,14 @@
    bytes.  Put the data at DATA.  Set *LEN to the amount successfully
    read upon return.  */
 error_t netfs_attempt_read (struct iouser *cred, struct node *np,
-                           off_t offset, size_t *len, void *data);
+                           loff_t offset, size_t *len, void *data);
 
 /* The user must define this function.  Write to the locked file NP
    for user CRED starting at OFSET and continuing for up to *LEN bytes
    from DATA.  Set *LEN to the amount successfully written upon
    return.  */
 error_t netfs_attempt_write (struct iouser *cred, struct node *np,
-                            off_t offset, size_t *len, void *data);
+                            loff_t offset, size_t *len, void *data);
 
 /* The user must define this function.  Return the valid access
    types (bitwise OR of O_READ, O_WRITE, and O_EXEC) in *TYPES for
@@ -306,7 +306,7 @@
                                     mach_msg_type_number_t *num_ports,
                                     int **ints,
                                     mach_msg_type_number_t *num_ints,
-                                    off_t **offsets,
+                                    loff_t **offsets,
                                     mach_msg_type_number_t *num_offsets,
                                     char **data,
                                     mach_msg_type_number_t *data_len);
Index: libstore/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/libstore/ChangeLog,v
retrieving revision 1.91
diff -u -r1.91 ChangeLog
--- libstore/ChangeLog  7 Jun 2002 09:05:51 -0000       1.91
+++ libstore/ChangeLog  9 Jun 2002 19:49:31 -0000
@@ -1,5 +1,8 @@
 2002-06-07  Roland McGrath  <address@hidden>
 
+       * store.h (struct store_enc): Use loff_t instead of off_t.
+       (store_enc_init, store_enc_return, store_return): Likewise.
+
        * encode.c (store_std_leaf_encode): Do a sizeof comparison to get
        `too_big' optimized out when store_enc starts using 64 bit offsets.
 
Index: libstore/store.h
===================================================================
RCS file: /cvsroot/hurd/hurd/libstore/store.h,v
retrieving revision 1.43
diff -u -r1.43 store.h
--- libstore/store.h    14 Mar 2002 21:10:07 -0000      1.43
+++ libstore/store.h    9 Jun 2002 19:49:32 -0000
@@ -634,7 +634,7 @@
   /* Each of the four vectors used.  All are vm_allocated.  */
   mach_port_t *ports;
   int *ints;
-  off_t *offsets;
+  loff_t *offsets;
   char *data;
 
   /* The sizes of the vectors.  */
@@ -648,7 +648,7 @@
      version won't be deallocated.  */
   mach_port_t *init_ports;
   int *init_ints;
-  off_t *init_offsets;
+  loff_t *init_offsets;
   char *init_data;
 };
 
@@ -658,7 +658,7 @@
 void store_enc_init (struct store_enc *enc,
                     mach_port_t *ports, mach_msg_type_number_t num_ports,
                     int *ints, mach_msg_type_number_t num_ints,
-                    off_t *offsets, mach_msg_type_number_t num_offsets,
+                    loff_t *offsets, mach_msg_type_number_t num_offsets,
                     char *data, mach_msg_type_number_t data_len);
 
 /* Deallocate storage used by the fields in ENC (but nothing is done with ENC
@@ -670,7 +670,7 @@
 void store_enc_return (struct store_enc *enc,
                       mach_port_t **ports, mach_msg_type_number_t *num_ports,
                       int **ints, mach_msg_type_number_t *num_ints,
-                      off_t **offsets, mach_msg_type_number_t *num_offsets,
+                      loff_t **offsets, mach_msg_type_number_t *num_offsets,
                       char **data, mach_msg_type_number_t *data_len);
 
 /* Encode STORE into the given return variables, suitably for returning from a
@@ -678,7 +678,7 @@
 error_t store_return (const struct store *store,
                      mach_port_t **ports, mach_msg_type_number_t *num_ports,
                      int **ints, mach_msg_type_number_t *num_ints,
-                     off_t **offsets, mach_msg_type_number_t *num_offsets,
+                     loff_t **offsets, mach_msg_type_number_t *num_offsets,
                      char **data, mach_msg_type_number_t *data_len);
 
 /* Encode STORE into ENC, which should have been prepared with
Index: libtreefs/treefs.h
===================================================================
RCS file: /cvsroot/hurd/hurd/libtreefs/treefs.h,v
retrieving revision 1.1
diff -u -r1.1 treefs.h
--- libtreefs/treefs.h  18 Jul 1996 04:32:22 -0000      1.1
+++ libtreefs/treefs.h  9 Jun 2002 19:49:32 -0000
@@ -1,8 +1,8 @@
 /* Hierarchial filesystem support
 
-   Copyright (C) 1995 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2002 Free Software Foundation, Inc.
 
-   Written by Miles Bader <address@hidden>
+   Written by Miles Bader <address@hidden>
 
    This file is part of the GNU Hurd.
 
@@ -84,9 +84,9 @@
 };
 
 /* A filesystem node in the tree.  */
-struct treefs_node 
+struct treefs_node
 {
-  struct stat stat;
+  io_statbuf_t stat;
   struct treefs_fsys *fsys;
 
   struct trans_link active_trans;
@@ -124,7 +124,7 @@
   /* The port for the node which this filesystem is translating.  */
   mach_port_t underlying_port;
   /* And stat info for it.  */
-  struct stat underlying_stat;
+  io_statbuf_t underlying_stat;
 
   /* Flags from the TREEFS_FSYS_ set.  */
   int flags;
@@ -237,8 +237,8 @@
 
 extern spin_lock_t treefs_node_refcnt_lock;
 
-/* Add a hard reference to a node.  If there were no hard 
-   references previously, then the node cannot be locked 
+/* Add a hard reference to a node.  If there were no hard
+   references previously, then the node cannot be locked
    (because you must hold a hard reference to hold the lock). */
 extern inline void
 treefs_node_ref (struct treefs_node *node)
@@ -263,7 +263,7 @@
 treefs_node_release (struct treefs_node *node)
 {
   int tried_drop_weak_refs = 0;
-  
+
  loop:
   spin_lock (&treefs_node_refcnt_lock);
   assert (node->refs);
@@ -310,7 +310,7 @@
 treefs_node_unref (struct treefs_node *node)
 {
   int tried_drop_weak_refs = 0;
-  
+
  loop:
   spin_lock (&treefs_node_refcnt_lock);
   assert (node->refs);
@@ -331,7 +331,7 @@
          spin_unlock (&treefs_node_refcnt_lock);
          node->refs++;
          spin_unlock (&treefs_node_refcnt_lock);
-         
+
          treefs_node_try_dropping_weak_refs (node);
          tried_drop_weak_refs = 1;
 
@@ -372,7 +372,7 @@
 
 /* Release a weak reference on NODE.  If NODE is locked by anyone, then
    this cannot be the last reference (because you must hold a
-   hard reference in order to hold the lock).  */  
+   hard reference in order to hold the lock).  */
 extern inline void
 treefs_node_unref_weak (struct treefs_node *node)
 {
Index: libtrivfs/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/libtrivfs/ChangeLog,v
retrieving revision 1.43
diff -u -r1.43 ChangeLog
--- libtrivfs/ChangeLog 28 May 2002 23:58:18 -0000      1.43
+++ libtrivfs/ChangeLog 9 Jun 2002 19:49:33 -0000
@@ -1,3 +1,14 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * io-identity.c (trivfs_S_io_identity): Use ino_t for FILENO.
+
+       * dir-readdir.c (trivfs_S_dir_readdir): Use vm_size_t for AMOUNT.
+
+2002-06-07  Roland McGrath  <address@hidden>
+
+       * trivfs.h (trivfs_modify_stat):
+       Use io_statbuf_t instead of struct stat.
+
 2002-05-28  Roland McGrath  <address@hidden>
 
        * dir-readdir.c (trivfs_S_dir_readdir): u_int -> size_t
Index: libtrivfs/dir-readdir.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libtrivfs/dir-readdir.c,v
retrieving revision 1.9
diff -u -r1.9 dir-readdir.c
--- libtrivfs/dir-readdir.c     28 May 2002 23:58:13 -0000      1.9
+++ libtrivfs/dir-readdir.c     9 Jun 2002 19:49:33 -0000
@@ -27,7 +27,7 @@
                      int entry,
                      int nentries,
                      vm_size_t bufsiz,
-                     int *amount)
+                     vm_size_t *amount)
 {
   return cred ? ENOTDIR : EOPNOTSUPP;
 }
Index: libtrivfs/io-identity.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libtrivfs/io-identity.c,v
retrieving revision 1.3
diff -u -r1.3 io-identity.c
--- libtrivfs/io-identity.c     10 May 1996 00:42:10 -0000      1.3
+++ libtrivfs/io-identity.c     9 Jun 2002 19:49:33 -0000
@@ -1,5 +1,5 @@
-/* Fetching identity port 
-   Copyright (C) 1996 Free Software Foundation, Inc.
+/* Fetching identity port
+   Copyright (C) 1996,2002 Free Software Foundation, Inc.
    Written by Michael I. Bushnell, p/BSG.
 
    This file is part of the GNU Hurd.
@@ -29,14 +29,14 @@
                      mach_msg_type_name_t *idport_type,
                      mach_port_t *fsidport,
                      mach_msg_type_name_t *fsidport_type,
-                     int *fileno)
+                     ino_t *fileno)
 {
   error_t err;
   struct stat st;
-  
+
   if (!cred)
     return EOPNOTSUPP;
-  
+
   err = io_stat (cred->realnode, &st);
   if (err)
     return err;
Index: libtrivfs/trivfs.h
===================================================================
RCS file: /cvsroot/hurd/hurd/libtrivfs/trivfs.h,v
retrieving revision 1.38
diff -u -r1.38 trivfs.h
--- libtrivfs/trivfs.h  11 Oct 1999 07:42:23 -0000      1.38
+++ libtrivfs/trivfs.h  9 Jun 2002 19:49:33 -0000
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1994, 1995, 1996, 1997, 1999 Free Software Foundation
+   Copyright (C) 1994,95,96,97,99,2002 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -98,7 +98,7 @@
    stat (as returned from the underlying node) for presentation to
    callers of io_stat.  It is permissable for this function to do
    nothing.  */
-void trivfs_modify_stat (struct trivfs_protid *cred, struct stat *);
+void trivfs_modify_stat (struct trivfs_protid *cred, io_statbuf_t *);
 
 /* If this variable is set, it is called to find out what access this
    file permits to USER instead of checking the underlying node.
Index: pfinet/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/pfinet/ChangeLog,v
retrieving revision 1.66
diff -u -r1.66 ChangeLog
--- pfinet/ChangeLog    31 May 2002 23:37:07 -0000      1.66
+++ pfinet/ChangeLog    9 Jun 2002 19:49:34 -0000
@@ -1,3 +1,9 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * pfinet-ops.c (S_pfinet_siocgifconf): Use vm_size_t for AMOUNT.
+
+       * io-ops.c (S_io_identity): Use ino_t for FILENO.
+
 2002-05-31  Roland McGrath  <address@hidden>
 
        * Makefile (LINUXSRCS): Search for .S files as well as .c files
Index: pfinet/io-ops.c
===================================================================
RCS file: /cvsroot/hurd/hurd/pfinet/io-ops.c,v
retrieving revision 1.27
diff -u -r1.27 io-ops.c
--- pfinet/io-ops.c     29 May 2002 08:34:38 -0000      1.27
+++ pfinet/io-ops.c     9 Jun 2002 19:49:34 -0000
@@ -448,7 +448,7 @@
               mach_msg_type_name_t *idtype,
               mach_port_t *fsys,
               mach_msg_type_name_t *fsystype,
-              int *fileno)
+              ino_t *fileno)
 {
   error_t err;
 
Index: pfinet/pfinet-ops.c
===================================================================
RCS file: /cvsroot/hurd/hurd/pfinet/pfinet-ops.c,v
retrieving revision 1.1
diff -u -r1.1 pfinet-ops.c
--- pfinet/pfinet-ops.c 11 Jan 2001 22:28:29 -0000      1.1
+++ pfinet/pfinet-ops.c 9 Jun 2002 19:49:34 -0000
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000,02 Free Software Foundation, Inc.
    Written by Marcus Brinkmann.
 
    This file is part of the GNU Hurd.
@@ -41,7 +41,7 @@
    negative, there is no limit.  */
 error_t
 S_pfinet_siocgifconf (io_t port,
-                     int amount,
+                     vm_size_t amount,
                      char **ifr,
                      mach_msg_type_number_t *len)
 {
Index: pflocal/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/pflocal/ChangeLog,v
retrieving revision 1.24
diff -u -r1.24 ChangeLog
--- pflocal/ChangeLog   8 May 2002 10:16:21 -0000       1.24
+++ pflocal/ChangeLog   9 Jun 2002 19:49:35 -0000
@@ -1,3 +1,7 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * io.c (S_io_identity): Use ino_t for FILENO.
+
 2002-05-08  Roland McGrath  <address@hidden>
 
        * io.c (S_io_reauthenticate): unsigned -> size_t
Index: pflocal/io.c
===================================================================
RCS file: /cvsroot/hurd/hurd/pflocal/io.c,v
retrieving revision 1.38
diff -u -r1.38 io.c
--- pflocal/io.c        8 May 2002 10:16:18 -0000       1.38
+++ pflocal/io.c        9 Jun 2002 19:49:35 -0000
@@ -468,7 +468,7 @@
 S_io_identity (struct sock_user *user,
               mach_port_t *id, mach_msg_type_name_t *id_type,
               mach_port_t *fsys_id, mach_msg_type_name_t *fsys_id_type,
-              int *fileno)
+              ino_t *fileno)
 {
   static mach_port_t server_id = MACH_PORT_NULL;
   error_t err = 0;
Index: term/users.c
===================================================================
RCS file: /cvsroot/hurd/hurd/term/users.c,v
retrieving revision 1.97
diff -u -r1.97 users.c
--- term/users.c        26 Mar 2002 19:11:01 -0000      1.97
+++ term/users.c        9 Jun 2002 19:49:36 -0000
@@ -79,7 +79,7 @@
 struct protid_hook
 {
   int refcnt;
-  pid_t pid, pgrp;
+  pid_t pid, pgrp, sid;
 };
 
 void
@@ -415,10 +415,10 @@
 /* Implement term_become_ctty as described in <hurd/term.defs>.  */
 kern_return_t
 S_term_open_ctty (mach_port_t arg,
-                   pid_t pid,
-                   pid_t pgrp,
-                   mach_port_t *newpt,
-                   mach_msg_type_name_t *newpttype)
+                 pid_t pid,
+                 pid_t pgrp,
+                 mach_port_t *newpt,
+                 mach_msg_type_name_t *newpttype)
 {
   error_t err;
   struct trivfs_protid *newcred;
@@ -427,6 +427,12 @@
   if (!cred)
     return EOPNOTSUPP;
 
+  if (pid <= 0 || pgrp <= 0)
+    {
+      ports_port_deref (cred);
+      return EINVAL;
+    }
+
   mutex_lock (&global_lock);
 
   if (!cred->po->openmodes & (O_READ|O_WRITE))
@@ -445,6 +451,7 @@
 
          hook->pid = pid;
          hook->pgrp = pgrp;
+         hook->sid = getsid (pid);
          hook->refcnt = 1;
 
          if (newcred->hook)
@@ -1634,6 +1641,9 @@
   mutex_lock (&global_lock);
   if (!(cred->po->openmodes & (O_READ|O_WRITE)))
     err = EBADF;
+  else if (!cred->hook
+          || getsid (-pgrp) != ((struct protid_hook *)cred->hook)->sid)
+    err = EPERM;
   else
     {
       termflags &= ~NO_OWNER;
Index: tmpfs/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/tmpfs/ChangeLog,v
retrieving revision 1.21
diff -u -r1.21 ChangeLog
--- tmpfs/ChangeLog     2 Jun 2002 21:41:49 -0000       1.21
+++ tmpfs/ChangeLog     9 Jun 2002 19:49:36 -0000
@@ -1,3 +1,12 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * node.c (diskfs_cached_lookup): Use ino_t for argument.
+       * node.c (diskfs_alloc_node): Case to uintptr_t before ino_t.
+       (diskfs_cached_lookup): Likewise, and vice versa.
+       * dir.c (diskfs_get_directs, diskfs_lookup_hard): Likewise.
+
+       * tmpfs.c (diskfs_append_args): Use %Ld format for off_t value.
+
 2002-05-29  Roland McGrath  <address@hidden>
 
        * node.c (diskfs_S_file_get_storage_info): Return a null port when the
Index: tmpfs/dir.c
===================================================================
RCS file: /cvsroot/hurd/hurd/tmpfs/dir.c,v
retrieving revision 1.9
diff -u -r1.9 dir.c
--- tmpfs/dir.c 2 Jun 2002 21:41:35 -0000       1.9
+++ tmpfs/dir.c 9 Jun 2002 19:49:36 -0000
@@ -95,7 +95,7 @@
          entp->d_fileno = 2;
        }
       else
-       entp->d_fileno = (ino_t) dp->dn->u.dir.dotdot;
+       entp->d_fileno = (ino_t) (uintptr_t) dp->dn->u.dir.dotdot;
       entp->d_type = DT_DIR;
       entp->d_namlen = 2;
       entp->d_name[0] = '.';
@@ -123,7 +123,7 @@
       size_t rlen = (offsetof (struct dirent, d_name[1]) + d->namelen + 7) & 
~7;
       if (rlen + (char *) entp - *data > bufsiz || (n >= 0 && i > n))
        break;
-      entp->d_fileno = (ino_t) d->dn;
+      entp->d_fileno = (ino_t) (uintptr_t) d->dn;
       entp->d_type = DT_UNKNOWN;
       entp->d_namlen = d->namelen;
       memcpy (entp->d_name, d->name, d->namelen + 1);
@@ -220,7 +220,7 @@
          ds->prevp = prevp;
 
        if (np)
-         return diskfs_cached_lookup ((ino_t) d->dn, np);
+         return diskfs_cached_lookup ((ino_t) (uintptr_t) d->dn, np);
        else
          return 0;
       }
Index: tmpfs/node.c
===================================================================
RCS file: /cvsroot/hurd/hurd/tmpfs/node.c,v
retrieving revision 1.11
diff -u -r1.11 node.c
--- tmpfs/node.c        2 Jun 2002 21:41:20 -0000       1.11
+++ tmpfs/node.c        9 Jun 2002 19:49:36 -0000
@@ -52,7 +52,7 @@
   spin_unlock (&diskfs_node_refcnt_lock);
 
   dn->type = IFTODT (mode & S_IFMT);
-  return diskfs_cached_lookup ((ino_t) dn, npp);
+  return diskfs_cached_lookup ((ino_t) (uintptr_t) dn, npp);
 }
 
 void
@@ -154,9 +154,9 @@
 /* Fetch inode INUM, set *NPP to the node structure;
    gain one user reference and lock the node.  */
 error_t
-diskfs_cached_lookup (int inum, struct node **npp)
+diskfs_cached_lookup (ino_t inum, struct node **npp)
 {
-  struct disknode *dn = (void *) inum;
+  struct disknode *dn = (void *) (uintptr_t) inum;
   struct node *np;
 
   assert (npp);
@@ -175,7 +175,7 @@
       struct stat *st;
 
       np = diskfs_make_node (dn);
-      np->cache_id = (ino_t) dn;
+      np->cache_id = (ino_t) (uintptr_t) dn;
 
       spin_lock (&diskfs_node_refcnt_lock);
       dn->hnext = all_nodes;
@@ -191,7 +191,7 @@
       st->st_fsid = getpid ();
       st->st_blksize = vm_page_size;
 
-      st->st_ino = (ino_t) dn;
+      st->st_ino = (ino_t) (uintptr_t) dn;
       st->st_gen = dn->gen;
 
       st->st_size = dn->size;
Index: tmpfs/tmpfs.c
===================================================================
RCS file: /cvsroot/hurd/hurd/tmpfs/tmpfs.c,v
retrieving revision 1.13
diff -u -r1.13 tmpfs.c
--- tmpfs/tmpfs.c       28 May 2002 23:57:10 -0000      1.13
+++ tmpfs/tmpfs.c       9 Jun 2002 19:49:37 -0000
@@ -245,7 +245,7 @@
 #define S(n, c) if ((lim & ((1 << n) - 1)) == 0) sfx = c, lim >>= n
       S (30, 'G'); else S (20, 'M'); else S (10, 'K'); else sfx = '\0';
 #undef S
-      snprintf (buf, sizeof buf, "%ld%c", lim, sfx);
+      snprintf (buf, sizeof buf, "%Ld%c", lim, sfx);
       err = argz_add (argz, argz_len, buf);
     }
 
Index: ufs/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs/ChangeLog,v
retrieving revision 1.44
diff -u -r1.44 ChangeLog
--- ufs/ChangeLog       8 May 2002 10:00:26 -0000       1.44
+++ ufs/ChangeLog       9 Jun 2002 19:49:39 -0000
@@ -1,3 +1,13 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * inode.c (diskfs_cached_lookup): Use ino_t for argument.
+
+       * dir.c (diskfs_direnter_hard): Use size_t for OLDSIZE.
+       Fail with EOVERFLOW when it would exceed that width.
+
+       * alloc.c, dir.c: Use %Ld format for ino_t values.
+       * alloc.c (diskfs_alloc_node): Use %Ld format for blkcnt_t values.
+
 2002-05-08  Roland McGrath  <address@hidden>
 
        * main.c (diskfs_append_args): Fix argument type.
Index: ufs/alloc.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs/alloc.c,v
retrieving revision 1.23
diff -u -r1.23 alloc.c
--- ufs/alloc.c 20 Dec 1998 20:51:02 -0000      1.23
+++ ufs/alloc.c 9 Jun 2002 19:49:39 -0000
@@ -1,5 +1,5 @@
 /* Disk allocation routines
-   Copyright (C) 1993, 94, 95, 96, 98 Free Software Foundation, Inc.
+   Copyright (C) 1993,94,95,96,98,2002 Free Software Foundation, Inc.
 
 This file is part of the GNU Hurd.
 
@@ -685,7 +685,7 @@
        assert ("duplicate allocation" && !np->dn_stat.st_mode);
        assert (! (np->dn_stat.st_mode & S_IPTRANS));
        if (np->dn_stat.st_blocks) {
-         printf("free inode %d had %ld blocks\n",
+         printf("free inode %Ld had %Ld blocks\n",
                 ino, np->dn_stat.st_blocks);
          np->dn_stat.st_blocks = 0;
          np->dn_set_ctime = 1;
@@ -1395,7 +1395,7 @@
        assert ((u_int)size <= fs->fs_bsize && !fragoff (fs, size));
        cg = dtog(fs, bno);
        if ((u_int)bno >= fs->fs_size) {
-               printf("bad block %ld, ino %d\n", bno, np->dn->number);
+               printf("bad block %ld, ino %Ld\n", bno, np->dn->number);
 /*             ffs_fserr(fs, ip->i_uid, "bad block"); */
                return;
        }
@@ -1518,7 +1518,7 @@
        cgp->cg_time = diskfs_mtime->seconds;
        ino %= fs->fs_ipg;
        if (isclr(cg_inosused(cgp), ino)) {
-/*             printf("dev = 0x%x, ino = %d, fs = %s\n",
+/*             printf("dev = 0x%x, ino = %Ld, fs = %s\n",
                    pip->i_dev, ino, fs->fs_fsmnt); */
                assert (diskfs_readonly);
        }
Index: ufs/dir.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs/dir.c,v
retrieving revision 1.43
diff -u -r1.43 dir.c
--- ufs/dir.c   8 May 2002 09:59:52 -0000       1.43
+++ ufs/dir.c   9 Jun 2002 19:49:40 -0000
@@ -379,7 +379,7 @@
          || DIRSIZ (DIRECT_NAMLEN (entry)) > read_disk_entry (entry->d_reclen)
          || memchr (entry->d_name, '\0', DIRECT_NAMLEN (entry)))
        {
-         fprintf (stderr, "Bad directory entry: inode: %d offset: %zd\n",
+         fprintf (stderr, "Bad directory entry: inode: %Ld offset: %zd\n",
                  dp->dn->number, currentoff - blockaddr + idx * DIRBLKSIZ);
          return ENOENT;
        }
@@ -502,7 +502,7 @@
   vm_address_t fromoff, tooff;
   int totfreed;
   error_t err;
-  off_t oldsize = 0;
+  size_t oldsize = 0;
 
   assert (ds->type == CREATE);
 
@@ -585,6 +585,12 @@
       assert (needed <= DIRBLKSIZ);
 
       oldsize = dp->dn_stat.st_size;
+      if ((off_t)(oldsize + DIRBLKSIZ) != dp->dn_stat.st_size)
+       {
+         /* We can't possibly map the whole directory in.  */
+         munmap ((caddr_t) ds->mapbuf, ds->mapextent);
+         return EOVERFLOW;
+       }
       while (oldsize + DIRBLKSIZ > dp->allocsize)
        {
          err = diskfs_grow (dp, oldsize + DIRBLKSIZ, cred);
Index: ufs/inode.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs/inode.c,v
retrieving revision 1.58
diff -u -r1.58 inode.c
--- ufs/inode.c 21 Nov 2001 22:08:48 -0000      1.58
+++ ufs/inode.c 9 Jun 2002 19:49:40 -0000
@@ -1,5 +1,5 @@
 /* Inode management routines
-   Copyright (C) 1994,95,96,97,98,2000,01 Free Software Foundation, Inc.
+   Copyright (C) 1994,95,96,97,98,2000,01,02 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -47,7 +47,7 @@
 /* Fetch inode INUM, set *NPP to the node structure;
    gain one user reference and lock the node.  */
 error_t
-diskfs_cached_lookup (int inum, struct node **npp)
+diskfs_cached_lookup (ino_t inum, struct node **npp)
 {
   struct disknode *dn;
   struct node *np;
Index: ufs-fsck/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs-fsck/ChangeLog,v
retrieving revision 1.13
diff -u -r1.13 ChangeLog
--- ufs-fsck/ChangeLog  30 Sep 2001 23:14:31 -0000      1.13
+++ ufs-fsck/ChangeLog  9 Jun 2002 19:49:41 -0000
@@ -1,3 +1,12 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * fsck.h: Use ino_t for lfdir.
+       * setup.c: Likewise.
+
+       * fsck.h (struct dirinfo): Use size_t for i_isize.
+
+       * dir.c, pass1.c, pass2.c, utilities.c: Use %Ld for ino_t values.
+
 2001-09-30  Roland McGrath  <address@hidden>
 
        * pass5.c (pass5): A little manual CSE makes buggy gcc not to crash.
Index: ufs-fsck/dir.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs-fsck/dir.c,v
retrieving revision 1.15
diff -u -r1.15 dir.c
--- ufs-fsck/dir.c      6 May 1999 14:35:18 -0000       1.15
+++ ufs-fsck/dir.c      9 Jun 2002 19:49:41 -0000
@@ -1,5 +1,5 @@
 /* Directory management subroutines
-   Copyright (C) 1994, 1996, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1994,96,99,2002 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -28,19 +28,19 @@
 {
   u_int blks;
   struct dirinfo *dnp;
-  
+
   blks = howmany (dp->di_size, sblock->fs_bsize);
   if (blks > NDADDR)
     blks = NDADDR + NIADDR;
   blks *= sizeof (daddr_t);
   dnp = malloc (sizeof (struct dirinfo) + blks);
-  
+
   dnp->i_number = number;
   dnp->i_parent = dnp->i_dotdot = 0;
   dnp->i_isize = dp->di_size;
   dnp->i_numblks = blks;
   bcopy (dp->di_db, dnp->i_blks, blks);
-  
+
   if (dirarrayused ==  dirarraysize)
     {
       if (dirarraysize == 0)
@@ -68,12 +68,12 @@
 lookup_directory (ino_t ino)
 {
   int i;
-  
+
   for (i = 0; i < dirarrayused; i++)
     if (dirarray[i]->i_number == ino)
       return dirarray[i];
-  
-  errexit ("Cannot find chached directory I=%d\n", ino);
+
+  errexit ("Cannot find cached directory I=%Ld\n", ino);
 }
 
 /* Check to see if DIR is really a readable directory; if it
@@ -87,23 +87,23 @@
     case DIRECTORY:
     case DIRECTORY|DIR_REF:
       return 1;
-      
+
     case UNALLOC:
-      warning (1, "CANNOT %s I=%d; NOT ALLOCATED", action, dir);
+      warning (1, "CANNOT %s I=%Ld; NOT ALLOCATED", action, dir);
       return 0;
-      
+
     case BADDIR:
-      warning (1, "CANNOT %s I=%d; BAD BLOCKS", action, dir);
+      warning (1, "CANNOT %s I=%Ld; BAD BLOCKS", action, dir);
       return 0;
-      
+
     case REG:
-      warning (1, "CANNOT %s I=%d; NOT DIRECTORY", action, dir);
+      warning (1, "CANNOT %s I=%Ld; NOT DIRECTORY", action, dir);
       return 0;
 
     default:
       errexit ("ILLEGAL STATE");
     }
-}  
+}
 
 /* Search directory DIR for name NAME.  If NAME is found, then
    set *INO to the inode of the entry; otherwise clear INO.  Returns 1 if all
@@ -114,7 +114,7 @@
   struct dinode dino;
   int len;
 
-  /* Scan through one directory block and see if it 
+  /* Scan through one directory block and see if it
      contains NAME. */
   void
   check1block (void *buf)
@@ -147,7 +147,7 @@
     {
       void *buf = alloca (nfrags * sblock->fs_fsize);
       void *bufp;
-      
+
       readblock (fsbtodb (sblock, bno), buf, nfrags * sblock->fs_fsize);
       for (bufp = buf;
           bufp - buf < nfrags * sblock->fs_fsize
@@ -160,7 +160,7 @@
        }
       return 1;
     }
-  
+
   *ino = 0;
 
   if (!validdir (dir, "READ"))
@@ -220,7 +220,7 @@
     {
       void *buf = alloca (nfrags * sblock->fs_fsize);
       void *bufp;
-      
+
       readblock (fsbtodb (sblock, bno), buf, nfrags * sblock->fs_fsize);
       for (bufp = buf;
           bufp - buf < nfrags * sblock->fs_fsize
@@ -236,10 +236,10 @@
        }
       return 1;
     }
-       
+
   if (!validdir (dir, "REWRITE"))
     return 0;
-  
+
   getinode (dir, &dino);
   len = strlen (name);
   madechange = 0;
@@ -254,7 +254,7 @@
 {
   daddr_t lastbn, newblk;
   char *cp, buf[sblock->fs_bsize];
-  
+
   lastbn = lblkno (sblock, dp->di_size);
   if (blkoff (sblock, dp->di_size) && lastbn >= NDADDR - 1)
     return 0;
@@ -264,24 +264,24 @@
     return 0;
   else if (!blkoff (sblock, dp->di_size) && dp->di_db[lastbn])
     return 0;
- 
+
   newblk = allocblk (sblock->fs_frag);
   if (!newblk)
     return 0;
-  
+
   if (blkoff (sblock, dp->di_size))
     dp->di_db[lastbn + 1] = dp->di_db[lastbn];
   dp->di_db[lastbn] = newblk;
   dp->di_size += sblock->fs_bsize;
   dp->di_blocks += sblock->fs_bsize / DEV_BSIZE;
-  
+
   for (cp = buf; cp < buf + sblock->fs_bsize; cp += DIRBLKSIZ)
     {
       struct directory_entry *dir = (struct directory_entry *) cp;
       dir->d_ino = 0;
       dir->d_reclen = DIRBLKSIZ;
     }
-  
+
   writeblock (fsbtodb (sblock, newblk), buf, sblock->fs_bsize);
   return 1;
 }
@@ -297,10 +297,10 @@
   struct dinode dino;
   int needed;
   int madeentry;
-  
+
   /* Read a directory block and see if it contains room for the
      new entry.  If so, add it and return 1; otherwise return 0. */
-  int 
+  int
   check1block (void *buf)
     {
       struct directory_entry *dp;
@@ -341,7 +341,7 @@
            }
        }
       return 0;
-    }  
+    }
 
   /* Read part of a directory and look to see if it
      contains NAME.  Return 1 if we should keep looking
@@ -351,7 +351,7 @@
     {
       void *buf = alloca (nfrags * sblock->fs_fsize);
       void *bufp;
-      
+
       readblock (fsbtodb (sblock, bno), buf, nfrags * sblock->fs_fsize);
       for (bufp = buf;
           bufp - buf < nfrags * sblock->fs_fsize
@@ -367,10 +367,10 @@
        }
       return 1;
     }
-       
+
   if (!validdir (dir, "MODIFY"))
     return 0;
-  
+
   getinode (dir, &dino);
   len = strlen (name);
   needed = DIRSIZ (len);
@@ -379,7 +379,7 @@
   if (!madeentry)
     {
       /* Attempt to expand the directory. */
-      problem (0, "NO SPACE LEFT IN DIR INO=%d", dir);
+      problem (0, "NO SPACE LEFT IN DIR INO=%Ld", dir);
       if (preen || reply ("EXPAND"))
        {
          if (expanddir (&dino))
@@ -408,7 +408,7 @@
   ino_t ino;
 
   mode |= IFDIR;
-  
+
   ino = allocino (request, mode);
   if (!ino)
     return 0;
@@ -416,11 +416,11 @@
     goto bad;
   if (!makeentry (ino, parent, ".."))
     goto bad;
-  
+
   linkfound[ino]++;
   linkfound[parent]++;
   return ino;
-  
+
  bad:
   freeino (ino);
   return 0;
@@ -471,16 +471,16 @@
            }
        }
     }
-  
+
   getinode (lfdir, &lfdino);
   if ((lfdino.di_model & IFMT) != IFDIR)
     {
       ino_t oldlfdir;
-      
+
       problem (1, "`%s' IS NOT A DIRECTORY", lfname);
       if (! reply ("REALLOCATE"))
        return 0;
-      
+
       oldlfdir = lfdir;
 
       lfdir = allocdir (ROOTINO, 0, lfmode);
@@ -494,20 +494,20 @@
          warning (1, "SORRY, CANNOT CREATE `%s' DIRECTORY", lfname);
          return 0;
        }
-      
+
       /* One less link to the old one */
       linkfound[oldlfdir]--;
-  
+
       getinode (lfdir, &lfdino);
   }
-  
+
   if (inodestate[lfdir] != DIRECTORY && inodestate[lfdir] != 
(DIRECTORY|DIR_REF))
     {
       warning (1, "SORRY.  `%s' DIRECTORY NOT ALLOCATED", lfname);
       return 0;
     }
 
-  asprintf (&tempname, "#%d", ino);
+  asprintf (&tempname, "#%Ld", ino);
   search_failed = !searchdir (lfdir, tempname, &foo);
   while (foo)
     {
@@ -531,7 +531,7 @@
     }
   free (tempname);
   linkfound[ino]++;
-  
+
   if (parent != -1)
     {
       /* Reset `..' in ino */
@@ -539,7 +539,7 @@
        {
          if (!changeino (ino, "..", lfdir))
            {
-             warning (1, "CANNOT ADJUST `..' LINK I=%u", ino);
+             warning (1, "CANNOT ADJUST `..' LINK I=%Ld", ino);
              return 0;
            }
          /* Forget about link to old parent */
@@ -547,21 +547,21 @@
        }
       else if (!makeentry (ino, lfdir, ".."))
        {
-         warning (1, "CANNOT CREAT `..' LINK I=%u", ino);
+         warning (1, "CANNOT CREAT `..' LINK I=%Ld", ino);
          return 0;
        }
-      
+
       /* Account for link to lost+found; update inode directly
         here to avoid confusing warning later. */
       linkfound[lfdir]++;
       linkcount[lfdir]++;
       lfdino.di_nlink++;
       write_inode (lfdir, &lfdino);
-      
+
       if (parent)
-       warning (0, "DIR I=%u CONNECTED; PARENT WAS I=%u", ino, parent);
+       warning (0, "DIR I=%Ld CONNECTED; PARENT WAS I=%Ld", ino, parent);
       else
-       warning (0, "DIR I=%u CONNECTED", ino);
+       warning (0, "DIR I=%Ld CONNECTED", ino);
     }
   return 1;
 }
Index: ufs-fsck/fsck.h
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs-fsck/fsck.h,v
retrieving revision 1.12
diff -u -r1.12 fsck.h
--- ufs-fsck/fsck.h     2 May 1996 01:00:58 -0000       1.12
+++ ufs-fsck/fsck.h     9 Jun 2002 19:49:41 -0000
@@ -1,5 +1,5 @@
-/* 
-   Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+/*
+   Copyright (C) 1994,95,96,2002 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -59,7 +59,7 @@
 extern char *device_name;
 
 
-/* Command line flags */ 
+/* Command line flags */
 int nowrite;                   /* all questions fail */
 int noquery;                   /* all questions succeed */
 
@@ -81,7 +81,7 @@
   ino_t i_parent;              /* inode entry of parent */
   ino_t i_dotdot;              /* inode number of `..' */
   ino_t i_dot;                 /* inode number of `.' */
-  ino_t i_isize;               /* size of inode */
+  size_t i_isize;              /* size of inode */
   u_int i_numblks;             /* size of block array in bytes */
   daddr_t i_blks[0];           /* array of inode block addresses */
 };
@@ -121,7 +121,7 @@
 
 extern int fsmodified;
 
-extern int lfdir;
+extern ino_t lfdir;
 
 /* Total number of files found on the partition.  */
 extern daddr_t num_files;
@@ -145,7 +145,7 @@
 #define DI_MODE(dp) (((dp)->di_modeh << 16) | (dp)->di_model)
 
 
-     
+
 int setup (char *);
 void pass1 (), pass1b (), pass2 (), pass3 (), pass4 (), pass5 ();
 
Index: ufs-fsck/pass1.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs-fsck/pass1.c,v
retrieving revision 1.14
diff -u -r1.14 pass1.c
--- ufs-fsck/pass1.c    2 May 1996 03:23:29 -0000       1.14
+++ ufs-fsck/pass1.c    9 Jun 2002 19:49:41 -0000
@@ -1,5 +1,5 @@
 /* Pass one of GNU fsck -- count blocks and verify inodes
-   Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1994,95,96,2002 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -24,7 +24,7 @@
 
 static struct dinode zino;
 
-/* Find all the blocks in use by files and filesystem reserved blocks. 
+/* Find all the blocks in use by files and filesystem reserved blocks.
    Set them in the global block map.  For each file, if a block is found
    allocated twice, then record the block and inode in DUPLIST.
    Initialize INODESTATE, LINKCOUNT, and TYPEMAP. */
@@ -52,7 +52,7 @@
      node.  Increment NBLOCKS by the number of data blocks held.
      Set BLKERROR if this block is invalid.
      Return RET_GOOD, RET_BAD, RET_STOP if the block is good,
-     bad, or if we should entirely stop checking blocks in this 
+     bad, or if we should entirely stop checking blocks in this
      inode. */
   int
   checkblock (daddr_t bno, int nfrags, off_t offset)
@@ -69,10 +69,10 @@
          blkerror = 1;
          wasbad = 1;
          if (nblkrngerrors == 0)
-           warning (0, "I=%d HAS BAD BLOCKS", number);
+           warning (0, "I=%Ld HAS BAD BLOCKS", number);
          if (nblkrngerrors++ > MAXBAD)
            {
-             problem (0, "EXCESSIVE BAD BLKS I=%d", number);
+             problem (0, "EXCESSIVE BAD BLKS I=%Ld", number);
              if (preen || reply ("SKIP"))
                {
                  pfail ("SKIPPING");
@@ -93,12 +93,12 @@
                {
                  blkerror = 1;
                  if (nblkduperrors == 0)
-                   warning (0, "I=%d HAS DUPLICATE BLOCKS", number);
+                   warning (0, "I=%Ld HAS DUPLICATE BLOCKS", number);
                  warning (0, "DUPLICATE BLOCK %ld", bno);
                  wasbad = 1;
                  if (nblkduperrors++ > MAXBAD)
                    {
-                     problem (0, "EXCESSIVE DUP BLKS I=%d", number);
+                     problem (0, "EXCESSIVE DUP BLKS I=%Ld", number);
                      if (preen || reply ("SKIP"))
                        {
                          pfail ("SKIPPING");
@@ -128,16 +128,16 @@
        }
       return wasbad ? RET_BAD : RET_GOOD;
     }
-  
+
 
   /* Account for blocks used by meta data */
   for (cg = 0; cg < sblock->fs_ncg; cg++)
     {
       daddr_t firstdata, firstcgblock, bno;
-      
+
       /* Each cylinder group past the first reserves data
         from its cylinder group copy to (but not including)
-        the first datablock. 
+        the first datablock.
 
         The first, however, reserves from the very front of the
         cylinder group (thus including the boot block), and it also
@@ -155,7 +155,7 @@
       for (bno = firstcgblock; bno < firstdata; bno++)
        setbmap (bno);
     }
-  
+
   /* Loop through each inode, doing initial checks */
   for (number = 0, cg = 0; cg < sblock->fs_ncg; cg++)
     for (i = 0; i < sblock->fs_ipg; i++, number++)
@@ -165,15 +165,15 @@
        int dbwarn = 0, ibwarn = 0;
 
 /*     if (!preen && !(number % 10000))
-         printf ("I=%d\n", number); */
+         printf ("I=%Ld\n", number); */
 
        if (number < ROOTINO)
          continue;
-       
+
        getinode (number, dp);
        mode = DI_MODE (dp);
        type = mode & IFMT;
-       
+
        /* If the node is not allocated, then make sure it's
           properly clear */
        if (type == 0)
@@ -184,7 +184,7 @@
                || DI_MODE (dp)
                || dp->di_size)
              {
-               problem (0, "PARTIALLY ALLOCATED INODE I=%d", number);
+               problem (0, "PARTIALLY ALLOCATED INODE I=%Ld", number);
                if (preen || reply ("CLEAR"))
                  {
                    clear_inode (number, dp);
@@ -196,15 +196,15 @@
        else
          {
            /* Node is allocated. */
-           
+
            /* Check to see if we think the node should be cleared */
 
            /* Verify size for basic validity */
            holdallblocks = 0;
-           
+
            if (dp->di_size + sblock->fs_bsize - 1 < dp->di_size)
              {
-               problem (1, "OVERFLOW IN FILE SIZE I=%d (SIZE == %lld)", 
number, 
+               problem (1, "OVERFLOW IN FILE SIZE I=%Ld (SIZE == %lld)", 
number,
                        dp->di_size);
                if (reply ("CLEAR"))
                  {
@@ -213,12 +213,12 @@
                    continue;
                  }
                inodestate[number] = UNALLOC;
-               warning (0, "WILL TREAT ANY BLOCKS HELD BY I=%d AS ALLOCATED",
+               warning (0, "WILL TREAT ANY BLOCKS HELD BY I=%Ld AS ALLOCATED",
                        number);
                holdallblocks = 1;
              }
 
-           /* Decode type and set NDB 
+           /* Decode type and set NDB
               also set inodestate correctly. */
            inodestate[number] = REG;
            switch (type)
@@ -227,19 +227,19 @@
              case IFCHR:
                ndb = 1;
                break;
-                   
+
              case IFIFO:
              case IFSOCK:
                ndb = 0;
                break;
-                   
+
              case IFLNK:
                if (sblock->fs_maxsymlinklen != -1)
                  {
                    /* Check to see if this is a fastlink.  The
                       old fast link format has fs_maxsymlinklen
                       of zero and di_blocks zero; the new format has
-                      fs_maxsymlinklen set and we ignore di_blocks. 
+                      fs_maxsymlinklen set and we ignore di_blocks.
                       So check for either. */
                    if ((sblock->fs_maxsymlinklen
                         && dp->di_size < sblock->fs_maxsymlinklen)
@@ -262,16 +262,16 @@
                else
                  ndb = howmany (dp->di_size, sblock->fs_bsize);
                break;
-                   
+
              case IFDIR:
                inodestate[number] = DIRECTORY;
                /* Fall through */
              case IFREG:
                ndb = howmany (dp->di_size, sblock->fs_bsize);
                break;
-               
+
              default:
-               problem (1, "UNKNOWN FILE TYPE I=%d (MODE=%ol)", number, mode);
+               problem (1, "UNKNOWN FILE TYPE I=%Ld (MODE=%ol)", number, mode);
                if (reply ("CLEAR"))
                  {
                    clear_inode (number, dp);
@@ -280,14 +280,14 @@
                  }
                inodestate[number] = UNALLOC;
                holdallblocks = 1;
-               warning (0, "WILL TREAT ANY BLOCKS HELD BY I=%d "
+               warning (0, "WILL TREAT ANY BLOCKS HELD BY I=%Ld "
                        "AS ALLOCATED", number);
                ndb = 0;
              }
 
            if (ndb < 0)
              {
-               problem (1, "BAD FILE SIZE I= %d (SIZE == %lld)", number,
+               problem (1, "BAD FILE SIZE I= %Ld (SIZE == %lld)", number,
                        dp->di_size);
                if (reply ("CLEAR"))
                  {
@@ -296,7 +296,7 @@
                    continue;
                  }
                inodestate[number] = UNALLOC;
-               warning (0, "WILL TREAT ANY BLOCKS HELD BY I=%d AS ALLOCATED", 
+               warning (0, "WILL TREAT ANY BLOCKS HELD BY I=%Ld AS ALLOCATED",
                         number);
                holdallblocks = 1;
              }
@@ -308,10 +308,10 @@
            if (!holdallblocks)
              {
                if (dp->di_size
-                   && (type == IFBLK || type == IFCHR 
+                   && (type == IFBLK || type == IFCHR
                        || type == IFSOCK || type == IFIFO))
                  {
-                   problem (1, "SPECIAL NODE I=%d (MODE=%ol) HAS SIZE %lld",
+                   problem (1, "SPECIAL NODE I=%Ld (MODE=%ol) HAS SIZE %lld",
                            number, mode, dp->di_size);
                    if (reply ("TRUNCATE"))
                      {
@@ -319,10 +319,10 @@
                        write_inode (number, dp);
                      }
                  }
-               
+
                /* If we haven't set NDB speciall above, then it is set from
                   the file size correctly by the size check. */
-               
+
                /* Check all the direct and indirect blocks that are past the
                   amount necessary to be zero. */
                for (lbn = ndb; lbn < NDADDR; lbn++)
@@ -332,7 +332,7 @@
                        if (!dbwarn)
                          {
                            dbwarn = 1;
-                           problem (0, "INODE I=%d HAS EXTRA DIRECT BLOCKS", 
+                           problem (0, "INODE I=%Ld HAS EXTRA DIRECT BLOCKS",
                                   number);
                            if (preen || reply ("DEALLOCATE"))
                              {
@@ -357,7 +357,7 @@
                        if (ibwarn)
                          {
                            ibwarn = 1;
-                           problem (0, "INODE I=%d HAS EXTRA INDIRECT BLOCKS",
+                           problem (0, "INODE I=%Ld HAS EXTRA INDIRECT BLOCKS",
                                   number);
                            if (preen || reply ("DEALLOCATE"))
                              {
@@ -373,7 +373,7 @@
                      write_inode (number, dp);
                  }
              }
-           
+
            /* If this node is really allocated (as opposed to something
               that we should clear but the user won't) then set LINKCOUNT
               and TYPEMAP entries. */
@@ -397,7 +397,7 @@
                  warning (1, "DUPLICATE or BAD BLOCKS");
                else
                  {
-                   problem (0, "I=%d has ", number);
+                   problem (0, "I=%Ld has ", number);
                    if (nblkduperrors)
                      {
                        pextend ("%d DUPLICATE BLOCKS", nblkduperrors);
@@ -418,7 +418,7 @@
              }
            else if (dp->di_blocks != nblocks)
              {
-               problem (0, "INCORRECT BLOCK COUNT I=%d (%ld should be %d)",
+               problem (0, "INCORRECT BLOCK COUNT I=%Ld (%ld should be %d)",
                         number, dp->di_blocks, nblocks);
                if (preen || reply ("CORRECT"))
                  {
@@ -435,5 +435,3 @@
          }
       }
 }
-
-           
Index: ufs-fsck/pass1b.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs-fsck/pass1b.c,v
retrieving revision 1.6
diff -u -r1.6 pass1b.c
--- ufs-fsck/pass1b.c   10 May 1996 00:12:45 -0000      1.6
+++ ufs-fsck/pass1b.c   9 Jun 2002 19:49:41 -0000
@@ -1,5 +1,5 @@
 /* Pass 1b of fsck -- scan inodes for references to duplicate blocks
-   Copyright (C) 1994, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1994,96,2002 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -31,7 +31,7 @@
   struct dups *duphead = duplist;
 
   /* Check each block of file DP; if the block is in the dup block
-     list then add it to the dup block list under this file.  
+     list then add it to the dup block list under this file.
      Return RET_GOOD or RET_BAD if the block is
      good or bad, respectively.  */
   int
@@ -39,7 +39,7 @@
     {
       struct dups *dlp;
       int hadbad = 0;
-      
+
       for (; nfrags > 0; bno++, nfrags--)
        {
          if (check_range (bno, 1))
@@ -76,7 +76,7 @@
            allblock_iterate (dp, checkblock);
            if (dupblk)
              {
-               problem (1, "I=%d HAS %d DUPLICATE BLOCKS", number, dupblk);
+               problem (1, "I=%Ld HAS %d DUPLICATE BLOCKS", number, dupblk);
                if (reply ("CLEAR"))
                  {
                    clear_inode (number, dp);
@@ -88,5 +88,3 @@
          }
       }
 }
-
-  
Index: ufs-fsck/pass2.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs-fsck/pass2.c,v
retrieving revision 1.23
diff -u -r1.23 pass2.c
--- ufs-fsck/pass2.c    16 Aug 1996 14:32:55 -0000      1.23
+++ ufs-fsck/pass2.c    9 Jun 2002 19:49:41 -0000
@@ -1,5 +1,5 @@
 /* Pass 2 of GNU fsck -- examine all directories for validity
-   Copyright (C) 1994, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1994,96,2002 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -70,7 +70,7 @@
                  for (bp = (char *)buf; bp < (char *)buf + DIRBLKSIZ; bp++)
                    if (*bp)
                      goto reclen_problem;
-                 
+
                  problem (0, "NULL BLOCK IN DIRECTORY");
                  if (preen || reply ("PATCH"))
                    {
@@ -83,7 +83,7 @@
                  else
                    return mod;
                }
-             
+
            reclen_problem:
              problem (1, "BAD RECLEN IN DIRECTORY");
              if (reply ("SALVAGE"))
@@ -98,7 +98,7 @@
                /* But give up regardless */
                return mod;
            }
-         
+
          /* Check INO */
          if (dp->d_ino > maxino)
            {
@@ -113,7 +113,7 @@
 
          if (!dp->d_ino)
            continue;
-         
+
          /* Check INO */
          if (inodestate[dp->d_ino] == UNALLOC)
            {
@@ -138,7 +138,7 @@
                  dp->d_ino = 0;
                  mod = 1;
                }
-           }             
+           }
          else
            {
              /* Check for illegal characters */
@@ -165,7 +165,7 @@
                    }
                }
            }
-         
+
          if (!dp->d_ino)
            continue;
 
@@ -181,10 +181,10 @@
                  mod = 1;
                }
            }
-         
+
          /* Here we should check for duplicate directory entries;
             that's too much trouble right now. */
-         
+
          /* Account for the inode in the linkfound map */
          if (inodestate[dp->d_ino] != UNALLOC)
            linkfound[dp->d_ino]++;
@@ -205,7 +205,7 @@
                    {
                      problem (0, "EXTRANEOUS LINK `%s' TO DIR I=%ld",
                               dp->d_name, dp->d_ino);
-                     pextend (" FOUND IN DIR I=%d", dnp->i_number);
+                     pextend (" FOUND IN DIR I=%Ld", dnp->i_number);
                      if (preen || reply ("REMOVE"))
                        {
                          dp->d_ino = 0;
@@ -234,9 +234,9 @@
 
       readblock (fsbtodb (sblock, bno), buf, nfrags * sblock->fs_fsize);
       rewrite = 0;
-      for (bufp = buf; 
+      for (bufp = buf;
           bufp - buf < nfrags * sblock->fs_fsize
-          && offset + (bufp - buf) + DIRBLKSIZ <= dnp->i_isize; 
+          && offset + (bufp - buf) + DIRBLKSIZ <= dnp->i_isize;
           bufp += DIRBLKSIZ)
        {
          if (check1block (bufp))
@@ -251,7 +251,7 @@
     {
     default:
       errexit ("BAD STATE %d FOR ROOT INODE", (int) (inodestate[ROOTINO]));
-      
+
     case DIRECTORY:
       break;
 
@@ -262,7 +262,7 @@
       if (allocdir (ROOTINO, ROOTINO, 0755) != ROOTINO)
        errexit ("CANNOT ALLOCATE ROOT INODE");
       break;
-      
+
     case REG:
       problem (1, "ROOT INODE NOT DIRECTORY");
       if (reply ("REALLOCATE"))
@@ -270,7 +270,7 @@
       if (allocdir (ROOTINO, ROOTINO, 0755) != ROOTINO)
        errexit ("CANNOT ALLOCATE ROOT INODE");
       break;
-      
+
     case BADDIR:
       problem (1, "DUPLICATE or BAD BLOCKS IN ROOT INODE");
       if (reply ("REALLOCATE"))
@@ -283,20 +283,20 @@
        errexit ("ABORTING");
       break;
     }
-  
+
   /* Sort inpsort */
   qsort (dirsorted, dirarrayused, sizeof (struct dirinfo *), sortfunc);
-  
+
   /* Check basic integrity of each directory */
   for (nd = 0; nd < dirarrayused; nd++)
     {
       dnp = dirsorted[nd];
-      
+
       if (dnp->i_isize == 0)
        continue;
       if (dnp->i_isize % DIRBLKSIZ)
        {
-         problem (0, "DIRECTORY INO=%d: LENGTH %d NOT MULTIPLE OF %d",
+         problem (0, "DIRECTORY INO=%Ld: LENGTH %d NOT MULTIPLE OF %d",
                   dnp->i_number, dnp->i_isize, DIRBLKSIZ);
          if (preen || reply ("ADJUST"))
            {
@@ -310,10 +310,10 @@
       dino.di_size = dnp->i_isize;
       assert (dnp->i_numblks <= (NDADDR + NIADDR) * sizeof (daddr_t));
       bcopy (dnp->i_blks, dino.di_db, dnp->i_numblks);
-      
+
       datablocks_iterate (&dino, checkdirblock);
     }
-  
+
 
   /* At this point for each directory:
      If this directory is an entry in another directory, then i_parent is
@@ -323,12 +323,12 @@
   for (nd = 0; nd < dirarrayused; nd++)
     {
       dnp = dirsorted[nd];
-      
+
       /* Root is considered to be its own parent even though it isn't
         listed. */
       if (dnp->i_number == ROOTINO && !dnp->i_parent)
        dnp->i_parent = ROOTINO;
-         
+
       /* Check `.' to make sure it exists and is correct */
       if (dnp->i_dot == 0)
        {
@@ -397,5 +397,4 @@
            }
        }
     }
-}  
-             
+}
Index: ufs-fsck/setup.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs-fsck/setup.c,v
retrieving revision 1.10
diff -u -r1.10 setup.c
--- ufs-fsck/setup.c    25 Mar 1999 07:44:33 -0000      1.10
+++ ufs-fsck/setup.c    9 Jun 2002 19:49:41 -0000
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 1994, 1996, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1994,96,99,2002 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -42,7 +42,7 @@
 
 int fsmodified = 0;
 
-int lfdir;
+ino_t lfdir;
 
 /* Get ready to run on device with pathname DEV. */
 int
Index: ufs-fsck/utilities.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs-fsck/utilities.c,v
retrieving revision 1.18
diff -u -r1.18 utilities.c
--- ufs-fsck/utilities.c        26 Feb 2001 04:16:10 -0000      1.18
+++ ufs-fsck/utilities.c        9 Jun 2002 19:49:41 -0000
@@ -1,5 +1,5 @@
 /* Miscellaneous functions for fsck
-   Copyright (C) 1994, 1995, 1996, 1999, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1994,95,96,99,2001,02 Free Software Foundation, Inc.
    Written by Michael I. Bushnell.
 
    This file is part of the GNU Hurd.
@@ -355,7 +355,7 @@
     }
 
   if (ino < ROOTINO || ino > maxino)
-    pextend (" (BOGUS INODE) I=%d", ino);
+    pextend (" (BOGUS INODE) I=%Ld", ino);
   else
     {
       char *p;
@@ -364,7 +364,7 @@
 
       getinode (ino, &dino);
 
-      pextend (" %s I=%d", (DI_MODE (&dino) & IFMT) == IFDIR ? "DIR" : "FILE",
+      pextend (" %s I=%Ld", (DI_MODE (&dino) & IFMT) == IFDIR ? "DIR" : "FILE",
             ino);
 
       pw = getpwuid (dino.di_uid);
Index: ufs-utils/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs-utils/ChangeLog,v
retrieving revision 1.12
diff -u -r1.12 ChangeLog
--- ufs-utils/ChangeLog 7 Dec 2001 00:35:31 -0000       1.12
+++ ufs-utils/ChangeLog 9 Jun 2002 19:49:42 -0000
@@ -1,3 +1,7 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * mkfs.c (iput): Use %Ld format for ino_t values.
+
 2001-12-06  Roland McGrath  <address@hidden>
 
        * dlabel.c (fd_get_device): Only deallocate NODE if store_create fails.
Index: ufs-utils/mkfs.c
===================================================================
RCS file: /cvsroot/hurd/hurd/ufs-utils/mkfs.c,v
retrieving revision 1.20
diff -u -r1.20 mkfs.c
--- ufs-utils/mkfs.c    2 Dec 2001 22:06:54 -0000       1.20
+++ ufs-utils/mkfs.c    9 Jun 2002 19:49:43 -0000
@@ -1279,7 +1279,7 @@
        sblock.fs_cstotal.cs_nifree--;
        fscs[0].cs_nifree--;
        if (ino >= sblock.fs_ipg * sblock.fs_ncg)
-         deverr (32, 0, "fsinit: inode value out of range (%d)", ino);
+         deverr (32, 0, "fsinit: inode value out of range (%Ld)", ino);
        d = fsbtodb(&sblock, ino_to_fsba(&sblock, ino));
        rdfs(d, sblock.fs_bsize, buf);
        buf[ino_to_fsbo(&sblock, ino)] = *ip;
Index: utils/ChangeLog
===================================================================
RCS file: /cvsroot/hurd/hurd/utils/ChangeLog,v
retrieving revision 1.133
diff -u -r1.133 ChangeLog
--- utils/ChangeLog     28 May 2002 23:57:34 -0000      1.133
+++ utils/ChangeLog     9 Jun 2002 19:49:44 -0000
@@ -1,3 +1,7 @@
+2002-06-08  Roland McGrath  <address@hidden>
+
+       * ftpdir.c (pdirent): Use %lld format for off_t value.
+
 2002-05-28  Roland McGrath  <address@hidden>
 
        * fakeauth.c (idvec_copyout): Fix argument type.
Index: utils/ftpdir.c
===================================================================
RCS file: /cvsroot/hurd/hurd/utils/ftpdir.c,v
retrieving revision 1.2
diff -u -r1.2 ftpdir.c
--- utils/ftpdir.c      3 Jul 1997 17:09:55 -0000       1.2
+++ utils/ftpdir.c      9 Jun 2002 19:49:44 -0000
@@ -1,8 +1,7 @@
 /* Get a directory listing using the ftp protocol
 
-   Copyright (C) 1997 Free Software Foundation, Inc.
-
-   Written by Miles Bader <address@hidden>
+   Copyright (C) 1997,2002 Free Software Foundation, Inc.
+   Written by Miles Bader <address@hidden>
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -37,7 +36,7 @@
 {
   {"user",     'u', "USER",0, "User to login as on ftp server"},
   {"password", 'p', "PWD", 0, "USER's password"},
-  {"account",  'a', "ACCT",0, "Account to login as"}, 
+  {"account",  'a', "ACCT",0, "Account to login as"},
   {"separator",'S', "SEP", 0, "String to separate multiple listings"},
   {"prefix",   'P', "PFX", 0, "String to proceed listings; the first and 
second"
                               " occurances of %s are replace by HOST and DIR"},
@@ -203,7 +202,7 @@
 {
   char timebuf[20];
   strftime (timebuf, sizeof timebuf, "%Y-%m-%d %H:%M", localtime 
(&st->st_mtime));
-  printf ("%6o %2d %5d %5d %6ld  %s  %s\n",
+  printf ("%6o %2d %5d %5d %6lld  %s  %s\n",
          st->st_mode, st->st_nlink, st->st_uid, st->st_gid, st->st_size,
          timebuf, name);
   if (symlink_target)
@@ -223,7 +222,7 @@
   return err;
 }
 
-int 
+int
 main (int argc, char **argv)
 {
   struct ftpdir_host *hosts = 0;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]