From a33a9e6208f5ae30ba3563afa043ddfb9468fd3d Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Wed, 12 Dec 2001 03:18:29 +0000 Subject: [PATCH] bump to xfsprogs version 1.3.15. --- VERSION | 2 +- debian/changelog | 9 ++++--- doc/CHANGES | 4 +++ include/libxfs.h | 1 + libxfs/init.c | 18 ++++++-------- libxfs/xfs.h | 1 + libxfs/xfs_mount.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 81 insertions(+), 15 deletions(-) diff --git a/VERSION b/VERSION index a2a5b896e..2119de6b1 100644 --- a/VERSION +++ b/VERSION @@ -3,5 +3,5 @@ # PKG_MAJOR=1 PKG_MINOR=3 -PKG_REVISION=14 +PKG_REVISION=15 PKG_BUILD=0 diff --git a/debian/changelog b/debian/changelog index 46db6e36d..fc84f5a97 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 5 Dec 2001 17:13:06 +1100 + -- Nathan Scott Wed, 12 Dec 2001 09:25:42 +1100 xfsprogs (1.3.13-0) unstable; urgency=low diff --git a/doc/CHANGES b/doc/CHANGES index e6f4a02f5..d323b80dc 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -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 diff --git a/include/libxfs.h b/include/libxfs.h index a6f4ac9c8..7701de512 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -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 *); diff --git a/libxfs/init.c b/libxfs/init.c index 9954cdae7..68a758d12 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -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. */ diff --git a/libxfs/xfs.h b/libxfs/xfs.h index 008629a6d..7bd9a50cb 100644 --- a/libxfs/xfs.h +++ b/libxfs/xfs.h @@ -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 diff --git a/libxfs/xfs_mount.c b/libxfs/xfs_mount.c index bff0bfc84..bb35667d7 100644 --- a/libxfs/xfs_mount.c +++ b/libxfs/xfs_mount.c @@ -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; +} + -- 2.47.2