diff options
author | Christoph Hellwig <hch@lst.de> | 2008-11-27 22:23:39 -0500 |
---|---|---|
committer | Niv Sardi <xaiki@sgi.com> | 2008-11-30 19:37:42 -0500 |
commit | 51ce16d519da0bc3c548e0facef7cb3aab1ac8cc (patch) | |
tree | ef01910a32368377514f0d61022b1d9b1de7c41d /fs/xfs | |
parent | 81591fe2db19d0fc1ec2aaaa6a790a5ab97ac3ab (diff) |
[XFS] kill XFS_DINODE_VERSION_ defines
These names don't add any value at all over just using the numerical
values.
(First sent on October 9th)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_dinode.h | 7 | ||||
-rw-r--r-- | fs/xfs/xfs_ialloc.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 17 | ||||
-rw-r--r-- | fs/xfs/xfs_inode_item.c | 7 | ||||
-rw-r--r-- | fs/xfs/xfs_itable.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_utils.c | 6 |
7 files changed, 20 insertions, 25 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c index d59705999534..534b175f3a41 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c | |||
@@ -1131,7 +1131,7 @@ xfs_ioctl_setattr( | |||
1131 | * the superblock version number since projids didn't | 1131 | * the superblock version number since projids didn't |
1132 | * exist before DINODE_VERSION_2 and SB_VERSION_NLINK. | 1132 | * exist before DINODE_VERSION_2 and SB_VERSION_NLINK. |
1133 | */ | 1133 | */ |
1134 | if (ip->i_d.di_version == XFS_DINODE_VERSION_1) | 1134 | if (ip->i_d.di_version == 1) |
1135 | xfs_bump_ino_vers2(tp, ip); | 1135 | xfs_bump_ino_vers2(tp, ip); |
1136 | } | 1136 | } |
1137 | 1137 | ||
diff --git a/fs/xfs/xfs_dinode.h b/fs/xfs/xfs_dinode.h index 0b7ebf922aff..162e8726df5e 100644 --- a/fs/xfs/xfs_dinode.h +++ b/fs/xfs/xfs_dinode.h | |||
@@ -18,11 +18,8 @@ | |||
18 | #ifndef __XFS_DINODE_H__ | 18 | #ifndef __XFS_DINODE_H__ |
19 | #define __XFS_DINODE_H__ | 19 | #define __XFS_DINODE_H__ |
20 | 20 | ||
21 | #define XFS_DINODE_VERSION_1 1 | 21 | #define XFS_DINODE_MAGIC 0x494e /* 'IN' */ |
22 | #define XFS_DINODE_VERSION_2 2 | 22 | #define XFS_DINODE_GOOD_VERSION(v) (((v) == 1 || (v) == 2)) |
23 | #define XFS_DINODE_GOOD_VERSION(v) \ | ||
24 | (((v) == XFS_DINODE_VERSION_1 || (v) == XFS_DINODE_VERSION_2)) | ||
25 | #define XFS_DINODE_MAGIC 0x494e /* 'IN' */ | ||
26 | 23 | ||
27 | typedef struct xfs_timestamp { | 24 | typedef struct xfs_timestamp { |
28 | __be32 t_sec; /* timestamp seconds */ | 25 | __be32 t_sec; /* timestamp seconds */ |
diff --git a/fs/xfs/xfs_ialloc.c b/fs/xfs/xfs_ialloc.c index 47e94288fcbf..16eda31fe797 100644 --- a/fs/xfs/xfs_ialloc.c +++ b/fs/xfs/xfs_ialloc.c | |||
@@ -321,9 +321,9 @@ xfs_ialloc_ag_alloc( | |||
321 | * able to use the file system. | 321 | * able to use the file system. |
322 | */ | 322 | */ |
323 | if (xfs_sb_version_hasnlink(&args.mp->m_sb)) | 323 | if (xfs_sb_version_hasnlink(&args.mp->m_sb)) |
324 | version = XFS_DINODE_VERSION_2; | 324 | version = 2; |
325 | else | 325 | else |
326 | version = XFS_DINODE_VERSION_1; | 326 | version = 1; |
327 | 327 | ||
328 | /* | 328 | /* |
329 | * Seed the new inode cluster with a random generation number. This | 329 | * Seed the new inode cluster with a random generation number. This |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 1d2912dc5226..083395cd675b 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -965,7 +965,7 @@ xfs_iread( | |||
965 | * the new format. We don't change the version number so that we | 965 | * the new format. We don't change the version number so that we |
966 | * can distinguish this from a real new format inode. | 966 | * can distinguish this from a real new format inode. |
967 | */ | 967 | */ |
968 | if (ip->i_d.di_version == XFS_DINODE_VERSION_1) { | 968 | if (ip->i_d.di_version == 1) { |
969 | ip->i_d.di_nlink = ip->i_d.di_onlink; | 969 | ip->i_d.di_nlink = ip->i_d.di_onlink; |
970 | ip->i_d.di_onlink = 0; | 970 | ip->i_d.di_onlink = 0; |
971 | ip->i_d.di_projid = 0; | 971 | ip->i_d.di_projid = 0; |
@@ -1139,8 +1139,8 @@ xfs_ialloc( | |||
1139 | * here rather than here and in the flush/logging code. | 1139 | * here rather than here and in the flush/logging code. |
1140 | */ | 1140 | */ |
1141 | if (xfs_sb_version_hasnlink(&tp->t_mountp->m_sb) && | 1141 | if (xfs_sb_version_hasnlink(&tp->t_mountp->m_sb) && |
1142 | ip->i_d.di_version == XFS_DINODE_VERSION_1) { | 1142 | ip->i_d.di_version == 1) { |
1143 | ip->i_d.di_version = XFS_DINODE_VERSION_2; | 1143 | ip->i_d.di_version = 2; |
1144 | /* | 1144 | /* |
1145 | * We've already zeroed the old link count, the projid field, | 1145 | * We've already zeroed the old link count, the projid field, |
1146 | * and the pad field. | 1146 | * and the pad field. |
@@ -1150,7 +1150,7 @@ xfs_ialloc( | |||
1150 | /* | 1150 | /* |
1151 | * Project ids won't be stored on disk if we are using a version 1 inode. | 1151 | * Project ids won't be stored on disk if we are using a version 1 inode. |
1152 | */ | 1152 | */ |
1153 | if ((prid != 0) && (ip->i_d.di_version == XFS_DINODE_VERSION_1)) | 1153 | if ((prid != 0) && (ip->i_d.di_version == 1)) |
1154 | xfs_bump_ino_vers2(tp, ip); | 1154 | xfs_bump_ino_vers2(tp, ip); |
1155 | 1155 | ||
1156 | if (pip && XFS_INHERIT_GID(pip)) { | 1156 | if (pip && XFS_INHERIT_GID(pip)) { |
@@ -3373,9 +3373,8 @@ xfs_iflush_int( | |||
3373 | * convert back to the old inode format. If the superblock version | 3373 | * convert back to the old inode format. If the superblock version |
3374 | * has been updated, then make the conversion permanent. | 3374 | * has been updated, then make the conversion permanent. |
3375 | */ | 3375 | */ |
3376 | ASSERT(ip->i_d.di_version == XFS_DINODE_VERSION_1 || | 3376 | ASSERT(ip->i_d.di_version == 1 || xfs_sb_version_hasnlink(&mp->m_sb)); |
3377 | xfs_sb_version_hasnlink(&mp->m_sb)); | 3377 | if (ip->i_d.di_version == 1) { |
3378 | if (ip->i_d.di_version == XFS_DINODE_VERSION_1) { | ||
3379 | if (!xfs_sb_version_hasnlink(&mp->m_sb)) { | 3378 | if (!xfs_sb_version_hasnlink(&mp->m_sb)) { |
3380 | /* | 3379 | /* |
3381 | * Convert it back. | 3380 | * Convert it back. |
@@ -3388,8 +3387,8 @@ xfs_iflush_int( | |||
3388 | * so just make the conversion to the new inode | 3387 | * so just make the conversion to the new inode |
3389 | * format permanent. | 3388 | * format permanent. |
3390 | */ | 3389 | */ |
3391 | ip->i_d.di_version = XFS_DINODE_VERSION_2; | 3390 | ip->i_d.di_version = 2; |
3392 | dip->di_version = XFS_DINODE_VERSION_2; | 3391 | dip->di_version = 2; |
3393 | ip->i_d.di_onlink = 0; | 3392 | ip->i_d.di_onlink = 0; |
3394 | dip->di_onlink = 0; | 3393 | dip->di_onlink = 0; |
3395 | memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); | 3394 | memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); |
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 27f18c15e167..c43118148e6c 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c | |||
@@ -296,9 +296,8 @@ xfs_inode_item_format( | |||
296 | * has a new version number, then we don't bother converting back. | 296 | * has a new version number, then we don't bother converting back. |
297 | */ | 297 | */ |
298 | mp = ip->i_mount; | 298 | mp = ip->i_mount; |
299 | ASSERT(ip->i_d.di_version == XFS_DINODE_VERSION_1 || | 299 | ASSERT(ip->i_d.di_version == 1 || xfs_sb_version_hasnlink(&mp->m_sb)); |
300 | xfs_sb_version_hasnlink(&mp->m_sb)); | 300 | if (ip->i_d.di_version == 1) { |
301 | if (ip->i_d.di_version == XFS_DINODE_VERSION_1) { | ||
302 | if (!xfs_sb_version_hasnlink(&mp->m_sb)) { | 301 | if (!xfs_sb_version_hasnlink(&mp->m_sb)) { |
303 | /* | 302 | /* |
304 | * Convert it back. | 303 | * Convert it back. |
@@ -311,7 +310,7 @@ xfs_inode_item_format( | |||
311 | * so just make the conversion to the new inode | 310 | * so just make the conversion to the new inode |
312 | * format permanent. | 311 | * format permanent. |
313 | */ | 312 | */ |
314 | ip->i_d.di_version = XFS_DINODE_VERSION_2; | 313 | ip->i_d.di_version = 2; |
315 | ip->i_d.di_onlink = 0; | 314 | ip->i_d.di_onlink = 0; |
316 | memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); | 315 | memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); |
317 | } | 316 | } |
diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index b3578cdc33dd..2cf16f4695ea 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c | |||
@@ -139,7 +139,7 @@ xfs_bulkstat_one_dinode( | |||
139 | * the new format. We don't change the version number so that we | 139 | * the new format. We don't change the version number so that we |
140 | * can distinguish this from a real new format inode. | 140 | * can distinguish this from a real new format inode. |
141 | */ | 141 | */ |
142 | if (dic->di_version == XFS_DINODE_VERSION_1) { | 142 | if (dic->di_version == 1) { |
143 | buf->bs_nlink = be16_to_cpu(dic->di_onlink); | 143 | buf->bs_nlink = be16_to_cpu(dic->di_onlink); |
144 | buf->bs_projid = 0; | 144 | buf->bs_projid = 0; |
145 | } else { | 145 | } else { |
diff --git a/fs/xfs/xfs_utils.c b/fs/xfs/xfs_utils.c index 771144932ab4..fcc2285d03ed 100644 --- a/fs/xfs/xfs_utils.c +++ b/fs/xfs/xfs_utils.c | |||
@@ -274,9 +274,9 @@ xfs_bump_ino_vers2( | |||
274 | xfs_mount_t *mp; | 274 | xfs_mount_t *mp; |
275 | 275 | ||
276 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); | 276 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); |
277 | ASSERT(ip->i_d.di_version == XFS_DINODE_VERSION_1); | 277 | ASSERT(ip->i_d.di_version == 1); |
278 | 278 | ||
279 | ip->i_d.di_version = XFS_DINODE_VERSION_2; | 279 | ip->i_d.di_version = 2; |
280 | ip->i_d.di_onlink = 0; | 280 | ip->i_d.di_onlink = 0; |
281 | memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); | 281 | memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); |
282 | mp = tp->t_mountp; | 282 | mp = tp->t_mountp; |
@@ -308,7 +308,7 @@ xfs_bumplink( | |||
308 | ASSERT(ip->i_d.di_nlink > 0); | 308 | ASSERT(ip->i_d.di_nlink > 0); |
309 | ip->i_d.di_nlink++; | 309 | ip->i_d.di_nlink++; |
310 | inc_nlink(VFS_I(ip)); | 310 | inc_nlink(VFS_I(ip)); |
311 | if ((ip->i_d.di_version == XFS_DINODE_VERSION_1) && | 311 | if ((ip->i_d.di_version == 1) && |
312 | (ip->i_d.di_nlink > XFS_MAXLINK_1)) { | 312 | (ip->i_d.di_nlink > XFS_MAXLINK_1)) { |
313 | /* | 313 | /* |
314 | * The inode has increased its number of links beyond | 314 | * The inode has increased its number of links beyond |