]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
bump to xfsprogs version 1.3.15.
authorNathan Scott <nathans@sgi.com>
Wed, 12 Dec 2001 03:18:29 +0000 (03:18 +0000)
committerNathan Scott <nathans@sgi.com>
Wed, 12 Dec 2001 03:18:29 +0000 (03:18 +0000)
VERSION
debian/changelog
doc/CHANGES
include/libxfs.h
libxfs/init.c
libxfs/xfs.h
libxfs/xfs_mount.c

diff --git a/VERSION b/VERSION
index a2a5b896e6d61cc67925fcd597f5c1fe78e52606..2119de6b1b9fe6ff4c7b0092e594dfea1c822c92 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -3,5 +3,5 @@
 #
 PKG_MAJOR=1
 PKG_MINOR=3
-PKG_REVISION=14
+PKG_REVISION=15
 PKG_BUILD=0
index 46db6e36d4f07969c538646dc6035944b04798ec..fc84f5a9799907ca16fe69c760593d51cd30117a 100644 (file)
@@ -1,9 +1,10 @@
-xfsprogs (1.3.14-1) unstable; urgency=low
+xfsprogs (1.3.15-1) unstable; urgency=low
 
- * Fix minor package version numbering issue (closes: #117545)
- * Fix bug in mkfs.xfs device size cross-check for realtime device
+  * Fix minor package version numbering issue (closes: #117545)
+  * Fix bug in mkfs.xfs device size cross-check for realtime device
+  * Reenable use of the BLKBSZSET ioctl in libxfs
 
- -- Nathan Scott <nathans@debian.org>  Wed,  5 Dec 2001 17:13:06 +1100
+ -- Nathan Scott <nathans@debian.org>  Wed, 12 Dec 2001 09:25:42 +1100
 
 xfsprogs (1.3.13-0) unstable; urgency=low
 
index e6f4a02f5123947c6a51370bd0287a8884aa087d..d323b80dca85f289f0d3e27efd2bd0ac3697ed81 100644 (file)
@@ -1,3 +1,7 @@
+xfsprogs-1.3.15 (12 December 2001)
+       - reenable the use of the BLKBSZSET ioctl, its baaack
+       - sync recent XFS kernel source changes back into libxfs
+
 xfsprogs-1.3.14 (05 December 2001)
        - fix minor debian package version numbering issue
        - add documentation for xfs_db(8) label/uuid commands
index a6f4ac9c8830f850dac025eef346c9263d1a1385..7701de512405966c9b4053ba14c300503e7994dd 100644 (file)
@@ -183,6 +183,7 @@ typedef struct xfs_mount {
 extern xfs_mount_t     *libxfs_mount (xfs_mount_t *, xfs_sb_t *,
                                dev_t, dev_t, dev_t, int);
 extern void    libxfs_mount_common (xfs_mount_t *, xfs_sb_t *);
+extern void    libxfs_initialize_perag (xfs_mount_t *, int);
 extern void    libxfs_umount (xfs_mount_t *);
 extern int     libxfs_rtmount_init (xfs_mount_t *);
 extern void    libxfs_alloc_compute_maxlevels (xfs_mount_t *);
index 9954cdae768efde89cffe8a280f58bf70be1802c..68a758d1239ced8561c09f674b016ea9d28cc766 100644 (file)
@@ -205,16 +205,12 @@ libxfs_device_open(char *path, int creat, int readonly, int setblksize)
                        progname, path, strerror(errno));
                exit(1);
        }
-       
-#ifdef HAVE_BLKBSZSET
+
        /*
-        * Set device blocksize to 512 bytes
-        *
-        * See bug #801063, but we no longer have this ioctl in the kernel -
-        * it will be needed again though when the fs blocksize != pagesize.
+        * Set device blocksize to 512 bytes (see bug #801063)
         */
 #ifndef BLKBSZSET
-#define BLKBSZSET _IO(0x12,110)        /* set device block size */
+#define BLKBSZSET _IOW(0x12,113,sizeof(int))   /* set device block size */
 #endif
        if (!readonly && setblksize && (statb.st_mode & S_IFMT) == S_IFBLK) {
                int blocksize = 512; /* bytes */
@@ -224,11 +220,11 @@ libxfs_device_open(char *path, int creat, int readonly, int setblksize)
                                progname, path, strerror(errno));
                }
        }
-#endif
 
-       /* get the device number from the stat buf - unless
+       /*
+        * Get the device number from the stat buf - unless
         * we're not opening a real device, in which case
-        * choose a new fake device number
+        * choose a new fake device number.
         */
        dev=(statb.st_rdev)?(statb.st_rdev):(nextfakedev--);
 
@@ -754,6 +750,8 @@ libxfs_mount(
                exit(1);
        }
 
+       libxfs_initialize_perag(mp, sbp->sb_agcount);
+
        /*
         * mkfs calls mount before the root inode is allocated.
         */
index 008629a6d3343cd76daaa3273b156908d6587a36..7bd9a50cb706e0e5d7baf3852e979ea62ac729df 100644 (file)
@@ -95,6 +95,7 @@
 #define xfs_dir2_bogus_removename      libxfs_dir2_bogus_removename
 
 #define xfs_mount_common                libxfs_mount_common
+#define xfs_initialize_perag            libxfs_initialize_perag
 #define xfs_rtmount_init                libxfs_rtmount_init
 #define xfs_alloc_fix_freelist         libxfs_alloc_fix_freelist
 #define xfs_iread                      libxfs_iread
index bff0bfc844aa30cb61a9e8e407f865ac2af248b4..bb35667d7c0287c77e74d3a713441ba5ad9840f8 100644 (file)
@@ -214,3 +214,64 @@ xfs_xlatesb(void *data, xfs_sb_t *sb, int dir, xfs_arch_t arch,
     }
     
 }
+
+void
+xfs_initialize_perag(xfs_mount_t *mp, int agcount)
+{
+       int             index, max_metadata;
+       xfs_perag_t     *pag;
+       xfs_agino_t     agino;
+       xfs_ino_t       ino;
+       xfs_sb_t        *sbp = &mp->m_sb;
+       xfs_ino_t       max_inum = XFS_MAXINUMBER_32;
+
+       /* Check to see if the filesystem can overflow 32 bit inodes */
+       agino = XFS_OFFBNO_TO_AGINO(mp, sbp->sb_agblocks - 1, 0);
+       ino = XFS_AGINO_TO_INO(mp, agcount - 1, agino);
+
+       /* Clear the mount flag if no inode can overflow 32 bits
+        * on this filesystem.
+        */
+       if (ino <= max_inum) {
+               mp->m_flags &= ~XFS_MOUNT_32BITINODES;
+       }
+
+       /* If we can overflow then setup the ag headers accordingly */
+       if (mp->m_flags & XFS_MOUNT_32BITINODES) {
+               /* Calculate how much should be reserved for inodes to
+                * meet the max inode percentage.
+                */
+               if (mp->m_maxicount) {
+                       __uint64_t      icount;
+
+                       icount = sbp->sb_dblocks * sbp->sb_imax_pct;
+                       do_div(icount, 100);
+                       icount += sbp->sb_agblocks - 1;
+                       do_div(icount, mp->m_ialloc_blks);
+                       max_metadata = icount;
+               } else {
+                       max_metadata = agcount;
+               }
+               for (index = 0; index < agcount; index++) {
+                       ino = XFS_AGINO_TO_INO(mp, index, agino);
+                       if (ino > max_inum) {
+                               index++;
+                               break;
+                       }
+
+                       /* This ag is prefered for inodes */
+                       pag = &mp->m_perag[index];
+                       pag->pagi_inodeok = 1;
+                       if (index < max_metadata)
+                               pag->pagf_metadata = 1;
+               }
+       } else {
+               /* Setup default behavior for smaller filesystems */
+               for (index = 0; index < agcount; index++) {
+                       pag = &mp->m_perag[index];
+                       pag->pagi_inodeok = 1;
+               }
+       }
+       mp->m_maxagi = index;
+}
+