浏览代码

[XFS] Sort out cosmetic differences between user and kernel copies of some
sources.

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

Signed-off-by: Nathan Scott <nathans@sgi.com>

Nathan Scott 19 年之前
父节点
当前提交
3ddb8fa98c
共有 10 个文件被更改,包括 32 次插入42 次删除
  1. 3 3
      fs/xfs/xfs_arch.h
  2. 12 11
      fs/xfs/xfs_bmap.c
  3. 9 2
      fs/xfs/xfs_dinode.h
  4. 2 0
      fs/xfs/xfs_dir.h
  5. 0 3
      fs/xfs/xfs_dir2.h
  6. 4 4
      fs/xfs/xfs_fs.h
  7. 1 0
      fs/xfs/xfs_iomap.c
  8. 0 17
      fs/xfs/xfs_sb.h
  9. 0 1
      fs/xfs/xfs_trans.h
  10. 1 1
      fs/xfs/xfs_vnodeops.c

+ 3 - 3
fs/xfs/xfs_arch.h

@@ -202,7 +202,7 @@ static inline void be64_add(__be64 *a, __s64 b)
  */ 
  */ 
 
 
 #define XFS_GET_DIR_INO4(di) \
 #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) \
 #define XFS_PUT_DIR_INO4(from, di) \
 do { \
 do { \
@@ -213,9 +213,9 @@ do { \
 } while (0)
 } while (0)
 
 
 #define XFS_DI_HI(di) \
 #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) \
 #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)        \
 #define XFS_GET_DIR_INO8(di)        \
 	(((xfs_ino_t)XFS_DI_LO(di) & 0xffffffffULL) | \
 	(((xfs_ino_t)XFS_DI_LO(di) & 0xffffffffULL) | \

+ 12 - 11
fs/xfs/xfs_bmap.c

@@ -3653,14 +3653,16 @@ xfs_bmap_search_extents(
 
 
 	ep = xfs_bmap_do_search_extents(base, lastx, nextents, bno, eofp,
 	ep = xfs_bmap_do_search_extents(base, lastx, nextents, bno, eofp,
 					  lastxp, gotp, prevp);
 					  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 "
                 cmn_err(CE_PANIC,"Access to block zero: fs: <%s> inode: %lld "
 			"start_block : %llx start_off : %llx blkcnt : %llx "
 			"start_block : %llx start_off : %llx blkcnt : %llx "
 			"extent-state : %x \n",
 			"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;
         return ep;
 }
 }
@@ -4883,19 +4885,18 @@ xfs_bmapi(
 					error = xfs_mod_incore_sb(mp,
 					error = xfs_mod_incore_sb(mp,
 							XFS_SBS_FDBLOCKS,
 							XFS_SBS_FDBLOCKS,
 							-(indlen), rsvd);
 							-(indlen), rsvd);
-					if (error && rt) {
-						xfs_mod_incore_sb(ip->i_mount,
+					if (error && rt)
+						xfs_mod_incore_sb(mp,
 							XFS_SBS_FREXTENTS,
 							XFS_SBS_FREXTENTS,
 							extsz, rsvd);
 							extsz, rsvd);
-					} else if (error) {
-						xfs_mod_incore_sb(ip->i_mount,
+					else if (error)
+						xfs_mod_incore_sb(mp,
 							XFS_SBS_FDBLOCKS,
 							XFS_SBS_FDBLOCKS,
 							alen, rsvd);
 							alen, rsvd);
-					}
 				}
 				}
 
 
 				if (error) {
 				if (error) {
-					if (XFS_IS_QUOTA_ON(ip->i_mount))
+					if (XFS_IS_QUOTA_ON(mp))
 						/* unreserve the blocks now */
 						/* unreserve the blocks now */
 						(void)
 						(void)
 						XFS_TRANS_UNRESERVE_QUOTA_NBLKS(
 						XFS_TRANS_UNRESERVE_QUOTA_NBLKS(

+ 9 - 2
fs/xfs/xfs_dinode.h

@@ -199,10 +199,16 @@ typedef enum xfs_dinode_fmt
 
 
 #define XFS_DFORK_DSIZE(dip,mp) \
 #define XFS_DFORK_DSIZE(dip,mp) \
 	XFS_CFORK_DSIZE_DISK(&(dip)->di_core, 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) \
 #define XFS_DFORK_ASIZE(dip,mp) \
 	XFS_CFORK_ASIZE_DISK(&(dip)->di_core, 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) \
 #define	XFS_DFORK_SIZE(dip,mp,w) \
 	XFS_CFORK_SIZE_DISK(&(dip)->di_core, 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_Q(dip)                    XFS_CFORK_Q_DISK(&(dip)->di_core)
 #define	XFS_DFORK_BOFF(dip)		    XFS_CFORK_BOFF_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) \
 #define	XFS_CFORK_FMT_SET(dcp,w,n) \
 	((w) == XFS_DATA_FORK ? \
 	((w) == XFS_DATA_FORK ? \
 		((dcp)->di_format = (n)) : ((dcp)->di_aformat = (n)))
 		((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) \
 #define	XFS_CFORK_NEXTENTS_DISK(dcp,w) \
 	((w) == XFS_DATA_FORK ? \
 	((w) == XFS_DATA_FORK ? \
@@ -223,13 +230,13 @@ typedef enum xfs_dinode_fmt
 	 	INT_GET((dcp)->di_anextents, ARCH_CONVERT))
 	 	INT_GET((dcp)->di_anextents, ARCH_CONVERT))
 #define XFS_CFORK_NEXTENTS(dcp,w) \
 #define XFS_CFORK_NEXTENTS(dcp,w) \
 	((w) == XFS_DATA_FORK ? (dcp)->di_nextents : (dcp)->di_anextents)
 	((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) \
 #define	XFS_CFORK_NEXT_SET(dcp,w,n) \
 	((w) == XFS_DATA_FORK ? \
 	((w) == XFS_DATA_FORK ? \
 		((dcp)->di_nextents = (n)) : ((dcp)->di_anextents = (n)))
 		((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))
 #define	XFS_BUF_TO_DINODE(bp)	((xfs_dinode_t *)XFS_BUF_PTR(bp))
 
 
 /*
 /*

+ 2 - 0
fs/xfs/xfs_dir.h

@@ -135,6 +135,8 @@ void	xfs_dir_startup(void);	/* called exactly once */
 	((mp)->m_dirops.xd_shortform_to_single(args))
 	((mp)->m_dirops.xd_shortform_to_single(args))
 
 
 #define	XFS_DIR_IS_V1(mp)	((mp)->m_dirversion == 1)
 #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 xfsv1_dirops;
+extern xfs_dirops_t xfsv2_dirops;
 
 
 #endif	/* __XFS_DIR_H__ */
 #endif	/* __XFS_DIR_H__ */

+ 0 - 3
fs/xfs/xfs_dir2.h

@@ -72,9 +72,6 @@ typedef struct xfs_dir2_put_args {
 	struct uio	*uio;		/* uio control structure */
 	struct uio	*uio;		/* uio control structure */
 } xfs_dir2_put_args_t;
 } 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.
  * Other interfaces used by the rest of the dir v2 code.
  */
  */

+ 4 - 4
fs/xfs/xfs_fs.h

@@ -3,15 +3,15 @@
  * All Rights Reserved.
  * All Rights Reserved.
  *
  *
  * This program is free software; you can redistribute it and/or
  * 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,
  * This program is distributed in the hope that it would be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * 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,
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
  */

+ 1 - 0
fs/xfs/xfs_iomap.c

@@ -608,6 +608,7 @@ xfs_iomap_eof_want_preallocate(
 	count_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp));
 	count_fsb = XFS_B_TO_FSB(mp, (xfs_ufsize_t)XFS_MAXIOFFSET(mp));
 	while (count_fsb > 0) {
 	while (count_fsb > 0) {
 		imaps = nimaps;
 		imaps = nimaps;
+		firstblock = NULLFSBLOCK;
 		error = XFS_BMAPI(mp, NULL, io, start_fsb, count_fsb,
 		error = XFS_BMAPI(mp, NULL, io, start_fsb, count_fsb,
 				  0, &firstblock, 0, imap, &imaps, NULL);
 				  0, &firstblock, 0, imap, &imaps, NULL);
 		if (error)
 		if (error)

+ 0 - 17
fs/xfs/xfs_sb.h

@@ -68,18 +68,6 @@ struct xfs_mount;
 	(XFS_SB_VERSION_NUMBITS | \
 	(XFS_SB_VERSION_NUMBITS | \
 	 XFS_SB_VERSION_OKREALFBITS | \
 	 XFS_SB_VERSION_OKREALFBITS | \
 	 XFS_SB_VERSION_OKSASHFBITS)
 	 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
  * 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_OKREALFBITS |	\
 	 XFS_SB_VERSION2_OKSASHFBITS )
 	 XFS_SB_VERSION2_OKSASHFBITS )
 
 
-/*
- * mkfs macro to set up sb_features2 word
- */
-#define	XFS_SB_VERSION2_MKFS(resvd1, sbcntr)	0
-
 typedef struct xfs_sb
 typedef struct xfs_sb
 {
 {
 	__uint32_t	sb_magicnum;	/* magic number == XFS_SB_MAGIC */
 	__uint32_t	sb_magicnum;	/* magic number == XFS_SB_MAGIC */

+ 0 - 1
fs/xfs/xfs_trans.h

@@ -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_bhold_release(xfs_trans_t *, struct xfs_buf *);
 void		xfs_trans_binval(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_inode_buf(xfs_trans_t *, struct xfs_buf *);
 void		xfs_trans_stale_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_dquot_buf(xfs_trans_t *, struct xfs_buf *, uint);
 void		xfs_trans_inode_alloc_buf(xfs_trans_t *, struct xfs_buf *);
 void		xfs_trans_inode_alloc_buf(xfs_trans_t *, struct xfs_buf *);

+ 1 - 1
fs/xfs/xfs_vnodeops.c

@@ -4056,7 +4056,7 @@ retry:
 		xfs_fileoff_t	s, e;
 		xfs_fileoff_t	s, e;
 
 
 		/*
 		/*
-		 * Determine space reservations for data/realtime,
+		 * Determine space reservations for data/realtime.
 		 */
 		 */
 		if (unlikely(extsz)) {
 		if (unlikely(extsz)) {
 			s = startoffset_fsb;
 			s = startoffset_fsb;