]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Fix dev_t mangling in xfsprogs tools, use xfs_dev_t as its size is what we expect.
authorNathan Scott <nathans@sgi.com>
Wed, 17 Dec 2003 10:30:22 +0000 (10:30 +0000)
committerNathan Scott <nathans@sgi.com>
Wed, 17 Dec 2003 10:30:22 +0000 (10:30 +0000)
VERSION
debian/changelog
doc/CHANGES
include/libxfs.h
include/platform_defs.h.in
libxfs/util.c
libxfs/xfs.h
man/man8/xfs_db.8
mkfs/proto.c
repair/dinode.c
repair/phase6.c

diff --git a/VERSION b/VERSION
index b599fbaccf3781f319e02909354bbc4d097553a5..224eedb86a4ad2a5454a3f680cffb1fd42519e40 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -3,5 +3,5 @@
 #
 PKG_MAJOR=2
 PKG_MINOR=6
-PKG_REVISION=1
+PKG_REVISION=2
 PKG_BUILD=0
index 6eeca419888517876da215008b5bb1429eb6e662..6b2020432f7ae04ec41a06f86b884646b7665868 100644 (file)
@@ -1,3 +1,9 @@
+xfsprogs (2.6.2-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Nathan Scott <nathans@debian.org>  Wed, 17 Dec 2003 21:16:53 +1100
+
 xfsprogs (2.6.1-1) unstable; urgency=low
 
   * New upstream release.
index fb803e8c56f8bb420a2029c5f7da9b3ee56709ea..c21cfce75ad805a904af6b9d9af3dad8a95dc50b 100644 (file)
@@ -1,3 +1,10 @@
+xfsprogs-2.6.2 (17 December 2003)
+       - Fix dev_t sizing issues in user tools - glibc uses a 64
+         bit number and XFS has a 32 device bit number, confusion
+         reigns.  Not much manipulates device numbers in the XFS
+         user tools though, hence hasn't really been seen before.
+         Thanks to Christoph for the patch.
+
 xfsprogs-2.6.1 (27 November 2003)
        - Human-friendly xfs_io read/write bsize specifications.
        - Dump throughput and IOPs values after xfs_io reads/writes.
index 12cc5954a21101eab5340c17d72d14f99ff09c4e..f61f1ef8fc63792e141fbd9ffda66742dbceeb1f 100644 (file)
@@ -360,7 +360,7 @@ typedef struct {
 } cred_t;
 
 extern int     libxfs_inode_alloc (xfs_trans_t **, xfs_inode_t *, mode_t,
-                               ushort, dev_t, cred_t *, xfs_inode_t **);
+                               ushort, xfs_dev_t, cred_t *, xfs_inode_t **);
 extern void    libxfs_trans_inode_alloc_buf (xfs_trans_t *, xfs_buf_t *);
 
 extern void    libxfs_idata_realloc (xfs_inode_t *, int, int);
index 1b3915cb49cfc1d76b19ac35dfeb338c77cc6453..33732d0738d52a50504deef44c0c1fc8ec0e63e3 100644 (file)
@@ -514,8 +514,7 @@ typedef unsigned long long __psunsigned_t;
 #define IRIX_DEV_MAJOR(dev)    ((int)(((unsigned)(dev) >> IRIX_DEV_BITSMINOR) \
                                        & IRIX_DEV_MAXMAJ))
 #define IRIX_DEV_MINOR(dev)    ((int)((dev) & IRIX_DEV_MAXMIN))
-#define IRIX_MKDEV(major,minor)        ((dev_t)(((major) << IRIX_DEV_BITSMINOR) \
+#define IRIX_MKDEV(major,minor)        ((xfs_dev_t)(((major) << IRIX_DEV_BITSMINOR) \
                                        | (minor&IRIX_DEV_MAXMIN)))
-#define IRIX_DEV_TO_KDEVT(dev) makedev(IRIX_DEV_MAJOR(dev),IRIX_DEV_MINOR(dev))
 
 #endif /* __XFS_PLATFORM_DEFS_H__ */
index f1f338a86969c6fbf8779a854dddfde81f98dac4..0fb9671f4608f066d48bcbc02999d73f229922c4 100644 (file)
@@ -46,7 +46,7 @@ libxfs_inode_alloc(
        xfs_inode_t     *pip,
        mode_t          mode,
        ushort          nlink,
-       dev_t           rdev,
+       xfs_dev_t       rdev,
        cred_t          *cr,
        xfs_inode_t     **ipp)
 {
@@ -134,7 +134,7 @@ libxfs_ialloc(
        xfs_inode_t     *pip,
        mode_t          mode,
        nlink_t         nlink,
-       dev_t           rdev,
+       xfs_dev_t       rdev,
        cred_t          *cr,
        xfs_prid_t      prid,
        int             okalloc,
@@ -201,11 +201,13 @@ libxfs_ialloc(
        flags = XFS_ILOG_CORE;
        switch (mode & S_IFMT) {
        case S_IFIFO:
+       case S_IFSOCK:
+               /* doesn't make sense to set an rdev for these */
+               rdev = 0;
        case S_IFCHR:
        case S_IFBLK:
-       case S_IFSOCK:
                ip->i_d.di_format = XFS_DINODE_FMT_DEV;
-               ip->i_df.if_u2.if_rdev = makedev(major(rdev), minor(rdev));                     ip->i_df.if_flags = 0;
+               ip->i_df.if_u2.if_rdev = rdev;
                flags |= XFS_ILOG_DEV;
                break;
        case S_IFREG:
index de54800e990c5275bf8ebb5a6f059544e3d3cea2..f960a95a0faa7cf29ce588150b3fede606b2ada4 100644 (file)
@@ -245,7 +245,6 @@ typedef struct { dev_t dev; } xfs_buftarg_t;
 #define ktrace_t       void
 #define m_ddev_targp   m_dev
 #define unlikely(x)    (x)
-#define kdev_none(x)   (!(x))
 #define INIT_LIST_HEAD(x)
 #define KERN_WARNING
 #define XFS_ERROR(e)   (e)
@@ -395,7 +394,7 @@ static inline int xfs_btree_readahead (xfs_btree_cur_t *cur, int lev, int lr)
 
 
 /* xfs_inode.c */
-int  xfs_ialloc (xfs_trans_t *, xfs_inode_t *, mode_t, nlink_t, dev_t, cred_t *,
+int  xfs_ialloc (xfs_trans_t *, xfs_inode_t *, mode_t, nlink_t, xfs_dev_t, cred_t *,
                xfs_prid_t, int, xfs_buf_t **, boolean_t *, xfs_inode_t **);
 int  xfs_iread_extents (xfs_trans_t *, xfs_inode_t *, int);
 int  xfs_imap (xfs_mount_t *, xfs_trans_t *, xfs_ino_t, xfs_imap_t *, uint);
index 4580909b3e8ea0de66df68473731ded4a480136d..b410aa1d665d2e071927e7a6cf79871cbf72d731 100644 (file)
@@ -952,7 +952,7 @@ The following are fields in the inode core:
 \f3version\f1: inode version, 1 or 2
 .br
 \f3format\f1: format of \f3u\f1 union data
-(0: dev_t,
+(0: xfs_dev_t,
 1: local file \- in-inode directory or symlink,
 2: extent list,
 3: Btree root,
index f81511356ee7b8c3b9032f052cc42ecbe721a2e4..4bde45bb8d8f9f9623ffd7c11961d0235f9f9592 100644 (file)
@@ -463,8 +463,8 @@ parseproto(
        case IF_REGULAR:
                buf = newregfile(pp, &len);
                getres(tp, XFS_B_TO_FSB(mp, len));
-               error = libxfs_inode_alloc(&tp, pip, mode|S_IFREG, 1,
-                                       mp->m_dev, &creds, &ip);
+               error = libxfs_inode_alloc(&tp, pip, mode|S_IFREG, 1, 0,
+                                       &creds, &ip);
                if (error)
                        fail(_("Inode allocation failed"), error);
                flags |= newfile(tp, ip, &flist, &first, 0, 0, buf, len);
@@ -481,8 +481,8 @@ parseproto(
                llen = cvtnum(mp->m_sb.sb_blocksize, mp->m_sb.sb_sectsize, value);
                getres(tp, XFS_B_TO_FSB(mp, llen));
 
-               error = libxfs_inode_alloc(&tp, pip, mode|S_IFREG, 1,
-                                               mp->m_dev, &creds, &ip);
+               error = libxfs_inode_alloc(&tp, pip, mode|S_IFREG, 1, 0,
+                                               &creds, &ip);
                if (error)
                        fail(_("Inode pre-allocation failed"), error);
 
@@ -505,7 +505,7 @@ parseproto(
                majdev = (int)getnum(pp);
                mindev = (int)getnum(pp);
                error = libxfs_inode_alloc(&tp, pip, mode|S_IFBLK, 1,
-                               makedev(majdev, mindev), &creds, &ip);
+                               IRIX_MKDEV(majdev, mindev), &creds, &ip);
                if (error) {
                        fail(_("Inode allocation failed"), error);
                }
@@ -521,7 +521,7 @@ parseproto(
                majdev = (int)getnum(pp);
                mindev = (int)getnum(pp);
                error = libxfs_inode_alloc(&tp, pip, mode|S_IFCHR, 1,
-                               makedev(majdev, mindev), &creds, &ip);
+                               IRIX_MKDEV(majdev, mindev), &creds, &ip);
                if (error)
                        fail(_("Inode allocation failed"), error);
                libxfs_trans_ijoin(tp, pip, 0);
@@ -533,8 +533,8 @@ parseproto(
 
        case IF_FIFO:
                getres(tp, 0);
-               error = libxfs_inode_alloc(&tp, pip, mode|S_IFIFO, 1,
-                               mp->m_dev, &creds, &ip);
+               error = libxfs_inode_alloc(&tp, pip, mode|S_IFIFO, 1, 0,
+                               &creds, &ip);
                if (error)
                        fail(_("Inode allocation failed"), error);
                libxfs_trans_ijoin(tp, pip, 0);
@@ -546,8 +546,8 @@ parseproto(
                buf = getstr(pp);
                len = (int)strlen(buf);
                getres(tp, XFS_B_TO_FSB(mp, len));
-               error = libxfs_inode_alloc(&tp, pip, mode|S_IFLNK, 1,
-                               mp->m_dev, &creds, &ip);
+               error = libxfs_inode_alloc(&tp, pip, mode|S_IFLNK, 1, 0,
+                               &creds, &ip);
                if (error)
                        fail(_("Inode allocation failed"), error);
                flags |= newfile(tp, ip, &flist, &first, 1, 1, buf, len);
@@ -558,8 +558,8 @@ parseproto(
                break;
        case IF_DIRECTORY:
                getres(tp, 0);
-               error = libxfs_inode_alloc(&tp, pip, mode|S_IFDIR, 1,
-                               mp->m_dev, &creds, &ip);
+               error = libxfs_inode_alloc(&tp, pip, mode|S_IFDIR, 1, 0,
+                               &creds, &ip);
                if (error)
                        fail(_("Inode allocation failed"), error);
                ip->i_d.di_nlink++;             /* account for . */
@@ -642,8 +642,8 @@ rtinit(
        if ((i = libxfs_trans_reserve(tp, MKFS_BLOCKRES_INODE, 0, 0, 0, 0)))
                res_failed(i);
        bzero(&creds, sizeof(creds));
-       error = libxfs_inode_alloc(&tp, mp->m_rootip, S_IFREG, 1,
-                               mp->m_dev, &creds, &rbmip);
+       error = libxfs_inode_alloc(&tp, mp->m_rootip, S_IFREG, 1, 0,
+                               &creds, &rbmip);
        if (error) {
                fail(_("Realtime bitmap inode allocation failed"), error);
        }
@@ -660,8 +660,8 @@ rtinit(
        libxfs_mod_sb(tp, XFS_SB_RBMINO);
        libxfs_trans_ihold(tp, rbmip);
        mp->m_rbmip = rbmip;
-       error = libxfs_inode_alloc(&tp, mp->m_rootip, S_IFREG, 1,
-                               mp->m_dev, &creds, &rsumip);
+       error = libxfs_inode_alloc(&tp, mp->m_rootip, S_IFREG, 1, 0,
+                               &creds, &rsumip);
        if (error) {
                fail(_("Realtime summary inode allocation failed"), error);
        }
index 9d7f96ab045bcef761cc9b1e2b4e3202a48bbc36..2579a269cb7229b9c90ec75308f7c5a779c8ad03 100644 (file)
@@ -66,7 +66,7 @@ calc_attr_offset(xfs_mount_t *mp, xfs_dinode_t *dino)
         */
        switch (dinoc->di_format)  {
        case XFS_DINODE_FMT_DEV:
-               offset += sizeof(dev_t);
+               offset += sizeof(xfs_dev_t);
                break;
        case XFS_DINODE_FMT_LOCAL:
                offset += INT_GET(dinoc->di_size, ARCH_CONVERT);
@@ -2290,12 +2290,12 @@ _("mismatch between format (%d) and size (%lld) in directory ino %llu\n"),
                switch (dinoc->di_format)  {
                case XFS_DINODE_FMT_DEV:
                        if (dinoc->di_forkoff !=
-                                       (roundup(sizeof(dev_t), 8) >> 3))  {
+                                       (roundup(sizeof(xfs_dev_t), 8) >> 3))  {
                                do_warn(
                _("bad attr fork offset %d in dev inode %llu, should be %d\n"),
                                        (int) dinoc->di_forkoff,
                                        lino,
-                                       (int) (roundup(sizeof(dev_t), 8) >> 3));
+                                       (int) (roundup(sizeof(xfs_dev_t), 8) >> 3));
                                err = 1;
                        }
                        break;
index 79c9b5c7aab77e9f3bb02fe393d9c0d1fa941972..4da14370c829736d6c234d01dcb7f4d362cb6def 100644 (file)
@@ -753,7 +753,7 @@ mk_orphanage(xfs_mount_t *mp)
                        i, ORPHANAGE);
 
        error = libxfs_inode_alloc(&tp, pip, mode|S_IFDIR,
-                                       1, mp->m_dev, &zerocr, &ip);
+                                       1, 0, &zerocr, &ip);
 
        if (error) {
                do_error(_("%s inode allocation failed %d\n"),