]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
sync with recent kernel source changes (benign for userspace).
authorNathan Scott <nathans@sgi.com>
Mon, 14 Jan 2002 07:08:16 +0000 (07:08 +0000)
committerNathan Scott <nathans@sgi.com>
Mon, 14 Jan 2002 07:08:16 +0000 (07:08 +0000)
include/xfs_inode.h
libxfs/xfs_ialloc.c
libxfs/xfs_inode.c

index 7950594d7f7a26cc497eed2613a952ba2280c721..35be1e3ba4c7e35986134b471625b835a4c902ac 100644 (file)
@@ -137,6 +137,11 @@ typedef    struct xfs_dio {
        size_t          xd_length;
 } xfs_dio_t;
 
+typedef struct dm_attrs_s {
+       __uint32_t      da_dmevmask;    /* DMIG event mask */
+       __uint16_t      da_dmstate;     /* DMIG state info */
+       __uint16_t      da_pad;         /* DMIG extra padding */
+} dm_attrs_t;
 
 typedef struct xfs_iocore {
        void                    *io_obj;        /* pointer to container
@@ -159,10 +164,13 @@ typedef struct xfs_iocore {
        unsigned int            io_flags;       /* IO related flags */
 
        /* DMAPI state */
-       __uint32_t      io_dmevmask;    /* DMIG event mask */
-       __uint16_t      io_dmstate;     /* DMIG state info */
+       dm_attrs_t              io_dmattrs;
+
 } xfs_iocore_t;
 
+#define        io_dmevmask     io_dmattrs.da_dmevmask
+#define        io_dmstate      io_dmattrs.da_dmstate
+
 #define XFS_IO_INODE(io)       ((xfs_inode_t *) ((io)->io_obj))
 #define XFS_IO_DCXVN(io)       ((dcxvn_t *) ((io)->io_obj))
 
index fde856a704a6d01103ad68c96f5e0b6e95d3308e..dd5962cdef421ab52be3b0ae8dad176a3fb18cf0 100644 (file)
@@ -937,8 +937,30 @@ xfs_dilocate(
        agino = XFS_INO_TO_AGINO(mp, ino);
        agbno = XFS_AGINO_TO_AGBNO(mp, agino);
        if (agno >= mp->m_sb.sb_agcount || agbno >= mp->m_sb.sb_agblocks ||
-           ino != XFS_AGINO_TO_INO(mp, agno, agino))
+           ino != XFS_AGINO_TO_INO(mp, agno, agino)) {
+#ifdef DEBUG
+               if (agno >= mp->m_sb.sb_agcount) {
+                       xfs_fs_cmn_err(CE_ALERT, mp,
+                                       "xfs_dilocate: agno (%d) >= "
+                                       "mp->m_sb.sb_agcount (%d)",
+                                       agno,  mp->m_sb.sb_agcount);
+               }
+               if (agbno >= mp->m_sb.sb_agblocks) {
+                       xfs_fs_cmn_err(CE_ALERT, mp,
+                                       "xfs_dilocate: agbno (0x%llx) >= "
+                                       "mp->m_sb.sb_agblocks (0x%llx)",
+                                       agbno, mp->m_sb.sb_agblocks);
+               }
+               if (ino != XFS_AGINO_TO_INO(mp, agno, agino)) {
+                       xfs_fs_cmn_err(CE_ALERT, mp,
+                                       "xfs_dilocate: ino (0x%llx) != "
+                                       "XFS_AGINO_TO_INO(mp, agno, agino) "
+                                       "(0x%llx)",
+                                       ino, XFS_AGINO_TO_INO(mp, agno, agino));
+               }
+#endif /* DEBUG */
                return XFS_ERROR(EINVAL);
+       }
        if ((mp->m_sb.sb_blocksize >= XFS_INODE_CLUSTER_SIZE(mp)) ||
            !(flags & XFS_IMAP_LOOKUP)) {
                offset = XFS_INO_TO_OFFSET(mp, ino);
@@ -965,17 +987,39 @@ xfs_dilocate(
                mraccess(&mp->m_peraglock);
                error = xfs_ialloc_read_agi(mp, tp, agno, &agbp);
                mraccunlock(&mp->m_peraglock);
-               if (error)
+               if (error) {
+#ifdef DEBUG
+                       xfs_fs_cmn_err(CE_ALERT, mp, "xfs_dilocate: "
+                                       "xfs_ialloc_read_agi() returned "
+                                       "error %d, agno %d",
+                                       error, agno);
+#endif /* DEBUG */
                        return error;
+               }
                cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO,
                        (xfs_inode_t *)0, 0);
-               if ((error = xfs_inobt_lookup_le(cur, agino, 0, 0, &i)))
+               if ((error = xfs_inobt_lookup_le(cur, agino, 0, 0, &i))) {
+#ifdef DEBUG
+                       xfs_fs_cmn_err(CE_ALERT, mp, "xfs_dilocate: "
+                                       "xfs_inobt_lookup_le() failed");
+#endif /* DEBUG */
                        goto error0;
+               }
                if ((error = xfs_inobt_get_rec(cur, &chunk_agino, &chunk_cnt,
-                               &chunk_free, &i, ARCH_NOCONVERT)))
+                               &chunk_free, &i, ARCH_NOCONVERT))) {
+#ifdef DEBUG
+                       xfs_fs_cmn_err(CE_ALERT, mp, "xfs_dilocate: "
+                                       "xfs_inobt_get_rec() failed");
+#endif /* DEBUG */
                        goto error0;
-               if (i == 0)
+               }
+               if (i == 0) {
+#ifdef DEBUG
+                       xfs_fs_cmn_err(CE_ALERT, mp, "xfs_dilocate: "
+                                       "xfs_inobt_get_rec() failed");
+#endif /* DEBUG */
                        error = XFS_ERROR(EINVAL);
+               }
                xfs_trans_brelse(tp, agbp);
                xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR);           
                if (error)
index 1b9108ac94ef4f1691cab7480c480b997f81865c..13d24001e612ab6c25d1f29686453343343ec5bf 100644 (file)
@@ -117,6 +117,15 @@ xfs_itobp(
                 */
                if ((imap.im_blkno + imap.im_len) >
                    XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)) {
+#ifdef DEBUG
+                       xfs_fs_cmn_err(CE_ALERT, mp, "xfs_itobp: "
+                                       "(imap.im_blkno (0x%llx) "
+                                       "+ imap.im_len (0x%llx)) > "
+                                       " XFS_FSB_TO_BB(mp, "
+                                       "mp->m_sb.sb_dblocks) (0x%llx)",
+                                       imap.im_blkno, imap.im_len,
+                                       XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks));
+#endif /* DEBUG */
                        return XFS_ERROR(EINVAL);
                }
 
@@ -146,6 +155,12 @@ xfs_itobp(
                                   (int)imap.im_len, XFS_BUF_LOCK, &bp);
 
        if (error) {
+#ifdef DEBUG
+               xfs_fs_cmn_err(CE_ALERT, mp, "xfs_itobp: "
+                               "xfs_trans_read_buf() returned error %d, "
+                               "imap.im_blkno 0x%llx, imap.im_len 0x%llx",
+                               error, imap.im_blkno, imap.im_len);
+#endif /* DEBUG */
                return error;
        }
 #ifdef __KERNEL__
@@ -603,7 +618,7 @@ xfs_iread(
        xfs_trans_t     *tp,
        xfs_ino_t       ino,
        xfs_inode_t     **ipp,
-       xfs_daddr_t             bno)
+       xfs_daddr_t     bno)
 {
        xfs_buf_t       *bp;
        xfs_dinode_t    *dip;
@@ -662,6 +677,13 @@ xfs_iread(
         if (INT_GET(dip->di_core.di_magic, ARCH_CONVERT) != XFS_DINODE_MAGIC) {
                kmem_zone_free(xfs_inode_zone, ip);
                xfs_trans_brelse(tp, bp);
+#ifdef DEBUG
+               xfs_fs_cmn_err(CE_ALERT, mp, "xfs_iread: "
+                               "dip->di_core.di_magic (0x%llx) != "
+                               "XFS_DINODE_MAGIC (0x%llx)",
+                               INT_GET(dip->di_core.di_magic, ARCH_CONVERT),
+                               XFS_DINODE_MAGIC);
+#endif /* DEBUG */
                return XFS_ERROR(EINVAL);
        }
 
@@ -679,6 +701,11 @@ xfs_iread(
                if (error)  {
                        kmem_zone_free(xfs_inode_zone, ip);
                        xfs_trans_brelse(tp, bp);
+#ifdef DEBUG
+                       xfs_fs_cmn_err(CE_ALERT, mp, "xfs_iread: "
+                                       "xfs_iformat() returned error %d",
+                                       error);
+#endif /* DEBUG */
                        return error;
                }
        } else {