]> err.no Git - linux-2.6/commitdiff
[XFS] Sort out cosmetic differences between user and kernel copies of some
authorNathan Scott <nathans@sgi.com>
Wed, 11 Jan 2006 04:33:02 +0000 (15:33 +1100)
committerNathan Scott <nathans@sgi.com>
Wed, 11 Jan 2006 04:33:02 +0000 (15:33 +1100)
sources.

SGI-PV: 907752
SGI-Modid: xfs-linux-melb:xfs-kern:24659a

Signed-off-by: Nathan Scott <nathans@sgi.com>
fs/xfs/xfs_arch.h
fs/xfs/xfs_bmap.c
fs/xfs/xfs_dinode.h
fs/xfs/xfs_dir.h
fs/xfs/xfs_dir2.h
fs/xfs/xfs_fs.h
fs/xfs/xfs_iomap.c
fs/xfs/xfs_sb.h
fs/xfs/xfs_trans.h
fs/xfs/xfs_vnodeops.c

index f1aeda599eb109f98dec6e6b7cd71275d4eab0aa..71de20cedb5cbd9937b2a7b943bb85d8460e8b9a 100644 (file)
@@ -202,7 +202,7 @@ static inline void be64_add(__be64 *a, __s64 b)
  */ 
 
 #define XFS_GET_DIR_INO4(di) \
-       (((u32)(di).i[0] << 24) | ((di).i[1] << 16) | ((di).i[2] << 8) | ((di).i[3]))
+       (((__u32)(di).i[0] << 24) | ((di).i[1] << 16) | ((di).i[2] << 8) | ((di).i[3]))
 
 #define XFS_PUT_DIR_INO4(from, di) \
 do { \
@@ -213,9 +213,9 @@ do { \
 } while (0)
 
 #define XFS_DI_HI(di) \
-       (((u32)(di).i[1] << 16) | ((di).i[2] << 8) | ((di).i[3]))
+       (((__u32)(di).i[1] << 16) | ((di).i[2] << 8) | ((di).i[3]))
 #define XFS_DI_LO(di) \
-       (((u32)(di).i[4] << 24) | ((di).i[5] << 16) | ((di).i[6] << 8) | ((di).i[7]))
+       (((__u32)(di).i[4] << 24) | ((di).i[5] << 16) | ((di).i[6] << 8) | ((di).i[7]))
 
 #define XFS_GET_DIR_INO8(di)        \
        (((xfs_ino_t)XFS_DI_LO(di) & 0xffffffffULL) | \
index 8ac170b828f57110e283aa4f7cedde0103f300cc..34bfb8ad0a25af7a5779f6d57ffcdf9463579538 100644 (file)
@@ -3653,14 +3653,16 @@ xfs_bmap_search_extents(
 
        ep = xfs_bmap_do_search_extents(base, lastx, nextents, bno, eofp,
                                          lastxp, gotp, prevp);
-       rt = ip->i_d.di_flags & XFS_DIFLAG_REALTIME;
-       if(!rt && !gotp->br_startblock && (*lastxp != NULLEXTNUM)) {
+       rt = (whichfork == XFS_DATA_FORK) && XFS_IS_REALTIME_INODE(ip);
+       if (unlikely(!rt && !gotp->br_startblock && (*lastxp != NULLEXTNUM))) {
                 cmn_err(CE_PANIC,"Access to block zero: fs: <%s> inode: %lld "
                        "start_block : %llx start_off : %llx blkcnt : %llx "
                        "extent-state : %x \n",
-                       (ip->i_mount)->m_fsname,(long long)ip->i_ino,
-                       gotp->br_startblock, gotp->br_startoff,
-                       gotp->br_blockcount,gotp->br_state);
+                       (ip->i_mount)->m_fsname, (long long)ip->i_ino,
+                       (unsigned long long)gotp->br_startblock,
+                       (unsigned long long)gotp->br_startoff,
+                       (unsigned long long)gotp->br_blockcount,
+                       gotp->br_state);
         }
         return ep;
 }
@@ -4883,19 +4885,18 @@ xfs_bmapi(
                                        error = xfs_mod_incore_sb(mp,
                                                        XFS_SBS_FDBLOCKS,
                                                        -(indlen), rsvd);
-                                       if (error && rt) {
-                                               xfs_mod_incore_sb(ip->i_mount,
+                                       if (error && rt)
+                                               xfs_mod_incore_sb(mp,
                                                        XFS_SBS_FREXTENTS,
                                                        extsz, rsvd);
-                                       } else if (error) {
-                                               xfs_mod_incore_sb(ip->i_mount,
+                                       else if (error)
+                                               xfs_mod_incore_sb(mp,
                                                        XFS_SBS_FDBLOCKS,
                                                        alen, rsvd);
-                                       }
                                }
 
                                if (error) {
-                                       if (XFS_IS_QUOTA_ON(ip->i_mount))
+                                       if (XFS_IS_QUOTA_ON(mp))
                                                /* unreserve the blocks now */
                                                (void)
                                                XFS_TRANS_UNRESERVE_QUOTA_NBLKS(
index f697aab8a3d2708c6f2045a0179c8402bf7bf7cd..79d0d9e1fbabc8d4f38061c1191dd978fc447791 100644 (file)
@@ -199,10 +199,16 @@ typedef enum xfs_dinode_fmt
 
 #define XFS_DFORK_DSIZE(dip,mp) \
        XFS_CFORK_DSIZE_DISK(&(dip)->di_core, mp)
+#define XFS_DFORK_DSIZE_HOST(dip,mp) \
+       XFS_CFORK_DSIZE(&(dip)->di_core, mp)
 #define XFS_DFORK_ASIZE(dip,mp) \
        XFS_CFORK_ASIZE_DISK(&(dip)->di_core, mp)
+#define XFS_DFORK_ASIZE_HOST(dip,mp) \
+       XFS_CFORK_ASIZE(&(dip)->di_core, mp)
 #define        XFS_DFORK_SIZE(dip,mp,w) \
        XFS_CFORK_SIZE_DISK(&(dip)->di_core, mp, w)
+#define        XFS_DFORK_SIZE_HOST(dip,mp,w) \
+       XFS_CFORK_SIZE(&(dip)->di_core, mp, w)
 
 #define        XFS_DFORK_Q(dip)                    XFS_CFORK_Q_DISK(&(dip)->di_core)
 #define        XFS_DFORK_BOFF(dip)                 XFS_CFORK_BOFF_DISK(&(dip)->di_core)
@@ -216,6 +222,7 @@ typedef enum xfs_dinode_fmt
 #define        XFS_CFORK_FMT_SET(dcp,w,n) \
        ((w) == XFS_DATA_FORK ? \
                ((dcp)->di_format = (n)) : ((dcp)->di_aformat = (n)))
+#define        XFS_DFORK_FORMAT(dip,w) XFS_CFORK_FORMAT(&(dip)->di_core, w)
 
 #define        XFS_CFORK_NEXTENTS_DISK(dcp,w) \
        ((w) == XFS_DATA_FORK ? \
@@ -223,13 +230,13 @@ typedef enum xfs_dinode_fmt
                INT_GET((dcp)->di_anextents, ARCH_CONVERT))
 #define XFS_CFORK_NEXTENTS(dcp,w) \
        ((w) == XFS_DATA_FORK ? (dcp)->di_nextents : (dcp)->di_anextents)
+#define        XFS_DFORK_NEXTENTS(dip,w) XFS_CFORK_NEXTENTS_DISK(&(dip)->di_core, w)
+#define        XFS_DFORK_NEXTENTS_HOST(dip,w) XFS_CFORK_NEXTENTS(&(dip)->di_core, w)
 
 #define        XFS_CFORK_NEXT_SET(dcp,w,n) \
        ((w) == XFS_DATA_FORK ? \
                ((dcp)->di_nextents = (n)) : ((dcp)->di_anextents = (n)))
 
-#define        XFS_DFORK_NEXTENTS(dip,w) XFS_CFORK_NEXTENTS_DISK(&(dip)->di_core, w)
-
 #define        XFS_BUF_TO_DINODE(bp)   ((xfs_dinode_t *)XFS_BUF_PTR(bp))
 
 /*
index 488defe86ba6f6af4d5e1494243a72e6d5c0a8d0..8cc8afb9f6c0396ab6dd7f76eef1f8ce562a8be2 100644 (file)
@@ -135,6 +135,8 @@ void        xfs_dir_startup(void);  /* called exactly once */
        ((mp)->m_dirops.xd_shortform_to_single(args))
 
 #define        XFS_DIR_IS_V1(mp)       ((mp)->m_dirversion == 1)
+#define        XFS_DIR_IS_V2(mp)       ((mp)->m_dirversion == 2)
 extern xfs_dirops_t xfsv1_dirops;
+extern xfs_dirops_t xfsv2_dirops;
 
 #endif /* __XFS_DIR_H__ */
index 7e24ffeda9e1f7ae92d0882d940b1fd6e11825af..3158f5dc431f3f17fbacc1f4a12ae1e52b4038d2 100644 (file)
@@ -72,9 +72,6 @@ typedef struct xfs_dir2_put_args {
        struct uio      *uio;           /* uio control structure */
 } xfs_dir2_put_args_t;
 
-#define        XFS_DIR_IS_V2(mp)       ((mp)->m_dirversion == 2)
-extern xfs_dirops_t    xfsv2_dirops;
-
 /*
  * Other interfaces used by the rest of the dir v2 code.
  */
index 3280f49496ba1b0dc8701f92a613497a99287239..14010f1fa82ffe9c2f85f84290bac1236c21fd2e 100644 (file)
@@ -3,15 +3,15 @@
  * All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation.
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation.
  *
  * This program is distributed in the hope that it would be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
+ * You should have received a copy of the GNU Lesser General Public License
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
index 5ecf3e3e86aaa4feab769541b0a7a5c1802a73cd..d72c83d22ee00c2960580728384a00dd1df3a0ac 100644 (file)
@@ -608,6 +608,7 @@ xfs_iomap_eof_want_preallocate(
        count_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp));
        while (count_fsb > 0) {
                imaps = nimaps;
+               firstblock = NULLFSBLOCK;
                error = XFS_BMAPI(mp, NULL, io, start_fsb, count_fsb,
                                  0, &firstblock, 0, imap, &imaps, NULL);
                if (error)
index 4a17d335f897684abe59bba281b1742dd1288571..bf168a91ddb83ffd4e91f7456fe83fd5bf937e8f 100644 (file)
@@ -68,18 +68,6 @@ struct xfs_mount;
        (XFS_SB_VERSION_NUMBITS | \
         XFS_SB_VERSION_OKREALFBITS | \
         XFS_SB_VERSION_OKSASHFBITS)
-#define XFS_SB_VERSION_MKFS(ia,dia,extflag,dirv2,na,sflag,morebits)    \
-       (((ia) || (dia) || (extflag) || (dirv2) || (na) || (sflag) || \
-         (morebits)) ? \
-               (XFS_SB_VERSION_4 | \
-                ((ia) ? XFS_SB_VERSION_ALIGNBIT : 0) | \
-                ((dia) ? XFS_SB_VERSION_DALIGNBIT : 0) | \
-                ((extflag) ? XFS_SB_VERSION_EXTFLGBIT : 0) | \
-                ((dirv2) ? XFS_SB_VERSION_DIRV2BIT : 0) | \
-                ((na) ? XFS_SB_VERSION_LOGV2BIT : 0) | \
-                ((sflag) ? XFS_SB_VERSION_SECTORBIT : 0) | \
-                ((morebits) ? XFS_SB_VERSION_MOREBITSBIT : 0)) : \
-               XFS_SB_VERSION_1)
 
 /*
  * There are two words to hold XFS "feature" bits: the original
@@ -105,11 +93,6 @@ struct xfs_mount;
        (XFS_SB_VERSION2_OKREALFBITS |  \
         XFS_SB_VERSION2_OKSASHFBITS )
 
-/*
- * mkfs macro to set up sb_features2 word
- */
-#define        XFS_SB_VERSION2_MKFS(resvd1, sbcntr)    0
-
 typedef struct xfs_sb
 {
        __uint32_t      sb_magicnum;    /* magic number == XFS_SB_MAGIC */
index a889963fdd142297b7a8f9879e04eb79a6403168..d77901c07f6339e5ece08a21f8ef736e3d68337d 100644 (file)
@@ -973,7 +973,6 @@ void                xfs_trans_bhold(xfs_trans_t *, struct xfs_buf *);
 void           xfs_trans_bhold_release(xfs_trans_t *, struct xfs_buf *);
 void           xfs_trans_binval(xfs_trans_t *, struct xfs_buf *);
 void           xfs_trans_inode_buf(xfs_trans_t *, struct xfs_buf *);
-void           xfs_trans_inode_buf(xfs_trans_t *, struct xfs_buf *);
 void           xfs_trans_stale_inode_buf(xfs_trans_t *, struct xfs_buf *);
 void           xfs_trans_dquot_buf(xfs_trans_t *, struct xfs_buf *, uint);
 void           xfs_trans_inode_alloc_buf(xfs_trans_t *, struct xfs_buf *);
index f6aed9ef6a613c2f8165a3a6688c7fded07915b3..15734c54952ef47438d51f213194864c45a7c750 100644 (file)
@@ -4056,7 +4056,7 @@ retry:
                xfs_fileoff_t   s, e;
 
                /*
-                * Determine space reservations for data/realtime,
+                * Determine space reservations for data/realtime.
                 */
                if (unlikely(extsz)) {
                        s = startoffset_fsb;