]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
sync userspace with kernel
authorEric Sandeen <sandeen@sgi.com>
Wed, 5 Jun 2002 16:24:32 +0000 (16:24 +0000)
committerEric Sandeen <sandeen@sgi.com>
Wed, 5 Jun 2002 16:24:32 +0000 (16:24 +0000)
include/xfs_mount.h
libxfs/xfs_dir2_sf.c

index d13a64ddb98b4e1ad4477767a4931a809ffab878..27edd2cf0cac040699a822082d5f2094e59be3a6 100644 (file)
@@ -357,8 +357,12 @@ typedef struct xfs_mount {
 /*
  * Default minimum read and write sizes.
  */
-#define        XFS_READIO_LOG_LARGE    12      /* > 32MB memory */
+#define        XFS_READIO_LOG_LARGE    12
 #define        XFS_WRITEIO_LOG_LARGE   12
+/*
+ * Default allocation size
+ */
+#define XFS_WRITE_IO_LOG       16
 
 /*
  * Max and min values for UIO and mount-option defined I/O sizes;
index c6bae1833296280f4dd33cfc909fede4b8017070..2d1ad4c60269c14a664d1249913d78e94be88da7 100644 (file)
@@ -843,6 +843,7 @@ xfs_dir2_sf_replace(
        int                     i;              /* entry index */
 #if XFS_BIG_FILESYSTEMS || defined(DEBUG)
        xfs_ino_t               ino=0;          /* entry old inode number */
+       int                     i8elevated;     /* sf_toino8 set i8count=1 */
 #endif
        xfs_dir2_sf_entry_t     *sfep;          /* shortform directory entry */
        xfs_dir2_sf_t           *sfp;           /* shortform structure */
@@ -889,8 +890,10 @@ xfs_dir2_sf_replace(
                 * Still fits, convert to 8-byte now.
                 */
                xfs_dir2_sf_toino8(args);
+               i8elevated = 1;
                sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data;
-       }
+       } else
+               i8elevated = 0;
 #endif
        ASSERT(args->namelen != 1 || args->name[0] != '.');
        /*
@@ -929,6 +932,10 @@ xfs_dir2_sf_replace(
                 */
                if (i == sfp->hdr.count) {
                        ASSERT(args->oknoent);
+#if XFS_BIG_FILESYSTEMS || defined(DEBUG)
+                       if (i8elevated)
+                               xfs_dir2_sf_toino4(args);
+#endif
                        return XFS_ERROR(ENOENT);
                }
        }
@@ -946,6 +953,19 @@ xfs_dir2_sf_replace(
                else
                        sfp->hdr.i8count--;
        }
+       /*
+        * See if the old number was small, the new number is large.
+        */
+       if (ino <= XFS_DIR2_MAX_SHORT_INUM &&
+           args->inumber > XFS_DIR2_MAX_SHORT_INUM) {
+               /*
+                * add to the i8count unless we just converted to 8-byte
+                * inodes (which does an implied i8count = 1)
+                */
+               ASSERT(sfp->hdr.i8count != 0);
+               if (!i8elevated)
+                       sfp->hdr.i8count++;
+       }
 #endif
        xfs_dir2_sf_check(args);
        xfs_trans_log_inode(args->trans, dp, XFS_ILOG_DDATA);