Commit 5d69a029 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6

* 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6:
  [XFS] Ensure "both" features2 slots are consistent
  [XFS] Fix superblock features2 field alignment problem
  [XFS] remove shouting-indirection macros from xfs_sb.h
parents 999646e3 e6957ea4
...@@ -732,7 +732,7 @@ xfs_ioctl( ...@@ -732,7 +732,7 @@ xfs_ioctl(
* Only allow the sys admin to reserve space unless * Only allow the sys admin to reserve space unless
* unwritten extents are enabled. * unwritten extents are enabled.
*/ */
if (!XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb) && if (!xfs_sb_version_hasextflgbit(&mp->m_sb) &&
!capable(CAP_SYS_ADMIN)) !capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
......
...@@ -1405,13 +1405,13 @@ xfs_qm_qino_alloc( ...@@ -1405,13 +1405,13 @@ xfs_qm_qino_alloc(
#if defined(DEBUG) && defined(XFS_LOUD_RECOVERY) #if defined(DEBUG) && defined(XFS_LOUD_RECOVERY)
unsigned oldv = mp->m_sb.sb_versionnum; unsigned oldv = mp->m_sb.sb_versionnum;
#endif #endif
ASSERT(!XFS_SB_VERSION_HASQUOTA(&mp->m_sb)); ASSERT(!xfs_sb_version_hasquota(&mp->m_sb));
ASSERT((sbfields & (XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | ASSERT((sbfields & (XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO |
XFS_SB_GQUOTINO | XFS_SB_QFLAGS)) == XFS_SB_GQUOTINO | XFS_SB_QFLAGS)) ==
(XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | (XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO |
XFS_SB_GQUOTINO | XFS_SB_QFLAGS)); XFS_SB_GQUOTINO | XFS_SB_QFLAGS));
XFS_SB_VERSION_ADDQUOTA(&mp->m_sb); xfs_sb_version_addquota(&mp->m_sb);
mp->m_sb.sb_uquotino = NULLFSINO; mp->m_sb.sb_uquotino = NULLFSINO;
mp->m_sb.sb_gquotino = NULLFSINO; mp->m_sb.sb_gquotino = NULLFSINO;
...@@ -1954,7 +1954,7 @@ xfs_qm_init_quotainos( ...@@ -1954,7 +1954,7 @@ xfs_qm_init_quotainos(
/* /*
* Get the uquota and gquota inodes * Get the uquota and gquota inodes
*/ */
if (XFS_SB_VERSION_HASQUOTA(&mp->m_sb)) { if (xfs_sb_version_hasquota(&mp->m_sb)) {
if (XFS_IS_UQUOTA_ON(mp) && if (XFS_IS_UQUOTA_ON(mp) &&
mp->m_sb.sb_uquotino != NULLFSINO) { mp->m_sb.sb_uquotino != NULLFSINO) {
ASSERT(mp->m_sb.sb_uquotino > 0); ASSERT(mp->m_sb.sb_uquotino > 0);
......
...@@ -118,7 +118,7 @@ xfs_qm_newmount( ...@@ -118,7 +118,7 @@ xfs_qm_newmount(
*quotaflags = 0; *quotaflags = 0;
*needquotamount = B_FALSE; *needquotamount = B_FALSE;
quotaondisk = XFS_SB_VERSION_HASQUOTA(&mp->m_sb) && quotaondisk = xfs_sb_version_hasquota(&mp->m_sb) &&
(mp->m_sb.sb_qflags & XFS_ALL_QUOTA_ACCT); (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_ACCT);
if (quotaondisk) { if (quotaondisk) {
......
...@@ -377,7 +377,7 @@ xfs_qm_scall_trunc_qfiles( ...@@ -377,7 +377,7 @@ xfs_qm_scall_trunc_qfiles(
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return XFS_ERROR(EPERM); return XFS_ERROR(EPERM);
error = 0; error = 0;
if (!XFS_SB_VERSION_HASQUOTA(&mp->m_sb) || flags == 0) { if (!xfs_sb_version_hasquota(&mp->m_sb) || flags == 0) {
qdprintk("qtrunc flags=%x m_qflags=%x\n", flags, mp->m_qflags); qdprintk("qtrunc flags=%x m_qflags=%x\n", flags, mp->m_qflags);
return XFS_ERROR(EINVAL); return XFS_ERROR(EINVAL);
} }
...@@ -522,7 +522,7 @@ xfs_qm_scall_getqstat( ...@@ -522,7 +522,7 @@ xfs_qm_scall_getqstat(
memset(out, 0, sizeof(fs_quota_stat_t)); memset(out, 0, sizeof(fs_quota_stat_t));
out->qs_version = FS_QSTAT_VERSION; out->qs_version = FS_QSTAT_VERSION;
if (! XFS_SB_VERSION_HASQUOTA(&mp->m_sb)) { if (!xfs_sb_version_hasquota(&mp->m_sb)) {
out->qs_uquota.qfs_ino = NULLFSINO; out->qs_uquota.qfs_ino = NULLFSINO;
out->qs_gquota.qfs_ino = NULLFSINO; out->qs_gquota.qfs_ino = NULLFSINO;
return (0); return (0);
......
...@@ -227,10 +227,10 @@ STATIC void ...@@ -227,10 +227,10 @@ STATIC void
xfs_sbversion_add_attr2(xfs_mount_t *mp, xfs_trans_t *tp) xfs_sbversion_add_attr2(xfs_mount_t *mp, xfs_trans_t *tp)
{ {
if ((mp->m_flags & XFS_MOUNT_ATTR2) && if ((mp->m_flags & XFS_MOUNT_ATTR2) &&
!(XFS_SB_VERSION_HASATTR2(&mp->m_sb))) { !(xfs_sb_version_hasattr2(&mp->m_sb))) {
spin_lock(&mp->m_sb_lock); spin_lock(&mp->m_sb_lock);
if (!XFS_SB_VERSION_HASATTR2(&mp->m_sb)) { if (!xfs_sb_version_hasattr2(&mp->m_sb)) {
XFS_SB_VERSION_ADDATTR2(&mp->m_sb); xfs_sb_version_addattr2(&mp->m_sb);
spin_unlock(&mp->m_sb_lock); spin_unlock(&mp->m_sb_lock);
xfs_mod_sb(tp, XFS_SB_VERSIONNUM | XFS_SB_FEATURES2); xfs_mod_sb(tp, XFS_SB_VERSIONNUM | XFS_SB_FEATURES2);
} else } else
......
...@@ -4047,17 +4047,17 @@ xfs_bmap_add_attrfork( ...@@ -4047,17 +4047,17 @@ xfs_bmap_add_attrfork(
xfs_trans_log_inode(tp, ip, logflags); xfs_trans_log_inode(tp, ip, logflags);
if (error) if (error)
goto error2; goto error2;
if (!XFS_SB_VERSION_HASATTR(&mp->m_sb) || if (!xfs_sb_version_hasattr(&mp->m_sb) ||
(!XFS_SB_VERSION_HASATTR2(&mp->m_sb) && version == 2)) { (!xfs_sb_version_hasattr2(&mp->m_sb) && version == 2)) {
__int64_t sbfields = 0; __int64_t sbfields = 0;
spin_lock(&mp->m_sb_lock); spin_lock(&mp->m_sb_lock);
if (!XFS_SB_VERSION_HASATTR(&mp->m_sb)) { if (!xfs_sb_version_hasattr(&mp->m_sb)) {
XFS_SB_VERSION_ADDATTR(&mp->m_sb); xfs_sb_version_addattr(&mp->m_sb);
sbfields |= XFS_SB_VERSIONNUM; sbfields |= XFS_SB_VERSIONNUM;
} }
if (!XFS_SB_VERSION_HASATTR2(&mp->m_sb) && version == 2) { if (!xfs_sb_version_hasattr2(&mp->m_sb) && version == 2) {
XFS_SB_VERSION_ADDATTR2(&mp->m_sb); xfs_sb_version_addattr2(&mp->m_sb);
sbfields |= (XFS_SB_VERSIONNUM | XFS_SB_FEATURES2); sbfields |= (XFS_SB_VERSIONNUM | XFS_SB_FEATURES2);
} }
if (sbfields) { if (sbfields) {
...@@ -5043,7 +5043,7 @@ xfs_bmapi( ...@@ -5043,7 +5043,7 @@ xfs_bmapi(
* A wasdelay extent has been initialized, so * A wasdelay extent has been initialized, so
* shouldn't be flagged as unwritten. * shouldn't be flagged as unwritten.
*/ */
if (wr && XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb)) { if (wr && xfs_sb_version_hasextflgbit(&mp->m_sb)) {
if (!wasdelay && (flags & XFS_BMAPI_PREALLOC)) if (!wasdelay && (flags & XFS_BMAPI_PREALLOC))
got.br_state = XFS_EXT_UNWRITTEN; got.br_state = XFS_EXT_UNWRITTEN;
} }
...@@ -5483,7 +5483,7 @@ xfs_bunmapi( ...@@ -5483,7 +5483,7 @@ xfs_bunmapi(
* get rid of part of a realtime extent. * get rid of part of a realtime extent.
*/ */
if (del.br_state == XFS_EXT_UNWRITTEN || if (del.br_state == XFS_EXT_UNWRITTEN ||
!XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb)) { !xfs_sb_version_hasextflgbit(&mp->m_sb)) {
/* /*
* This piece is unwritten, or we're not * This piece is unwritten, or we're not
* using unwritten extents. Skip over it. * using unwritten extents. Skip over it.
...@@ -5535,7 +5535,7 @@ xfs_bunmapi( ...@@ -5535,7 +5535,7 @@ xfs_bunmapi(
} else if ((del.br_startoff == start && } else if ((del.br_startoff == start &&
(del.br_state == XFS_EXT_UNWRITTEN || (del.br_state == XFS_EXT_UNWRITTEN ||
xfs_trans_get_block_res(tp) == 0)) || xfs_trans_get_block_res(tp) == 0)) ||
!XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb)) { !xfs_sb_version_hasextflgbit(&mp->m_sb)) {
/* /*
* Can't make it unwritten. There isn't * Can't make it unwritten. There isn't
* a full extent here so just skip it. * a full extent here so just skip it.
......
...@@ -120,7 +120,7 @@ typedef enum { ...@@ -120,7 +120,7 @@ typedef enum {
* Extent state and extent format macros. * Extent state and extent format macros.
*/ */
#define XFS_EXTFMT_INODE(x) \ #define XFS_EXTFMT_INODE(x) \
(XFS_SB_VERSION_HASEXTFLGBIT(&((x)->i_mount->m_sb)) ? \ (xfs_sb_version_hasextflgbit(&((x)->i_mount->m_sb)) ? \
XFS_EXTFMT_HASSTATE : XFS_EXTFMT_NOSTATE) XFS_EXTFMT_HASSTATE : XFS_EXTFMT_NOSTATE)
#define ISUNWRITTEN(x) ((x)->br_state == XFS_EXT_UNWRITTEN) #define ISUNWRITTEN(x) ((x)->br_state == XFS_EXT_UNWRITTEN)
......
...@@ -49,7 +49,7 @@ void ...@@ -49,7 +49,7 @@ void
xfs_dir_mount( xfs_dir_mount(
xfs_mount_t *mp) xfs_mount_t *mp)
{ {
ASSERT(XFS_SB_VERSION_HASDIRV2(&mp->m_sb)); ASSERT(xfs_sb_version_hasdirv2(&mp->m_sb));
ASSERT((1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog)) <= ASSERT((1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog)) <=
XFS_MAX_BLOCKSIZE); XFS_MAX_BLOCKSIZE);
mp->m_dirblksize = 1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog); mp->m_dirblksize = 1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog);
......
...@@ -77,36 +77,36 @@ xfs_fs_geometry( ...@@ -77,36 +77,36 @@ xfs_fs_geometry(
if (new_version >= 3) { if (new_version >= 3) {
geo->version = XFS_FSOP_GEOM_VERSION; geo->version = XFS_FSOP_GEOM_VERSION;
geo->flags = geo->flags =
(XFS_SB_VERSION_HASATTR(&mp->m_sb) ? (xfs_sb_version_hasattr(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_ATTR : 0) | XFS_FSOP_GEOM_FLAGS_ATTR : 0) |
(XFS_SB_VERSION_HASNLINK(&mp->m_sb) ? (xfs_sb_version_hasnlink(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_NLINK : 0) | XFS_FSOP_GEOM_FLAGS_NLINK : 0) |
(XFS_SB_VERSION_HASQUOTA(&mp->m_sb) ? (xfs_sb_version_hasquota(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_QUOTA : 0) | XFS_FSOP_GEOM_FLAGS_QUOTA : 0) |
(XFS_SB_VERSION_HASALIGN(&mp->m_sb) ? (xfs_sb_version_hasalign(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_IALIGN : 0) | XFS_FSOP_GEOM_FLAGS_IALIGN : 0) |
(XFS_SB_VERSION_HASDALIGN(&mp->m_sb) ? (xfs_sb_version_hasdalign(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_DALIGN : 0) | XFS_FSOP_GEOM_FLAGS_DALIGN : 0) |
(XFS_SB_VERSION_HASSHARED(&mp->m_sb) ? (xfs_sb_version_hasshared(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_SHARED : 0) | XFS_FSOP_GEOM_FLAGS_SHARED : 0) |
(XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb) ? (xfs_sb_version_hasextflgbit(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_EXTFLG : 0) | XFS_FSOP_GEOM_FLAGS_EXTFLG : 0) |
(XFS_SB_VERSION_HASDIRV2(&mp->m_sb) ? (xfs_sb_version_hasdirv2(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_DIRV2 : 0) | XFS_FSOP_GEOM_FLAGS_DIRV2 : 0) |
(XFS_SB_VERSION_HASSECTOR(&mp->m_sb) ? (xfs_sb_version_hassector(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_SECTOR : 0) | XFS_FSOP_GEOM_FLAGS_SECTOR : 0) |
(xfs_sb_version_haslazysbcount(&mp->m_sb) ? (xfs_sb_version_haslazysbcount(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_LAZYSB : 0) | XFS_FSOP_GEOM_FLAGS_LAZYSB : 0) |
(XFS_SB_VERSION_HASATTR2(&mp->m_sb) ? (xfs_sb_version_hasattr2(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_ATTR2 : 0); XFS_FSOP_GEOM_FLAGS_ATTR2 : 0);
geo->logsectsize = XFS_SB_VERSION_HASSECTOR(&mp->m_sb) ? geo->logsectsize = xfs_sb_version_hassector(&mp->m_sb) ?
mp->m_sb.sb_logsectsize : BBSIZE; mp->m_sb.sb_logsectsize : BBSIZE;
geo->rtsectsize = mp->m_sb.sb_blocksize; geo->rtsectsize = mp->m_sb.sb_blocksize;
geo->dirblocksize = mp->m_dirblksize; geo->dirblocksize = mp->m_dirblksize;
} }
if (new_version >= 4) { if (new_version >= 4) {
geo->flags |= geo->flags |=
(XFS_SB_VERSION_HASLOGV2(&mp->m_sb) ? (xfs_sb_version_haslogv2(&mp->m_sb) ?
XFS_FSOP_GEOM_FLAGS_LOGV2 : 0); XFS_FSOP_GEOM_FLAGS_LOGV2 : 0);
geo->logsunit = mp->m_sb.sb_logsunit; geo->logsunit = mp->m_sb.sb_logsunit;
} }
......
...@@ -191,7 +191,7 @@ xfs_ialloc_ag_alloc( ...@@ -191,7 +191,7 @@ xfs_ialloc_ag_alloc(
ASSERT(!(args.mp->m_flags & XFS_MOUNT_NOALIGN)); ASSERT(!(args.mp->m_flags & XFS_MOUNT_NOALIGN));
args.alignment = args.mp->m_dalign; args.alignment = args.mp->m_dalign;
isaligned = 1; isaligned = 1;
} else if (XFS_SB_VERSION_HASALIGN(&args.mp->m_sb) && } else if (xfs_sb_version_hasalign(&args.mp->m_sb) &&
args.mp->m_sb.sb_inoalignmt >= args.mp->m_sb.sb_inoalignmt >=
XFS_B_TO_FSBT(args.mp, XFS_B_TO_FSBT(args.mp,
XFS_INODE_CLUSTER_SIZE(args.mp))) XFS_INODE_CLUSTER_SIZE(args.mp)))
...@@ -230,7 +230,7 @@ xfs_ialloc_ag_alloc( ...@@ -230,7 +230,7 @@ xfs_ialloc_ag_alloc(
args.agbno = be32_to_cpu(agi->agi_root); args.agbno = be32_to_cpu(agi->agi_root);
args.fsbno = XFS_AGB_TO_FSB(args.mp, args.fsbno = XFS_AGB_TO_FSB(args.mp,
be32_to_cpu(agi->agi_seqno), args.agbno); be32_to_cpu(agi->agi_seqno), args.agbno);
if (XFS_SB_VERSION_HASALIGN(&args.mp->m_sb) && if (xfs_sb_version_hasalign(&args.mp->m_sb) &&
args.mp->m_sb.sb_inoalignmt >= args.mp->m_sb.sb_inoalignmt >=
XFS_B_TO_FSBT(args.mp, XFS_INODE_CLUSTER_SIZE(args.mp))) XFS_B_TO_FSBT(args.mp, XFS_INODE_CLUSTER_SIZE(args.mp)))
args.alignment = args.mp->m_sb.sb_inoalignmt; args.alignment = args.mp->m_sb.sb_inoalignmt;
...@@ -271,7 +271,7 @@ xfs_ialloc_ag_alloc( ...@@ -271,7 +271,7 @@ xfs_ialloc_ag_alloc(
* use the old version so that old kernels will continue to be * use the old version so that old kernels will continue to be
* able to use the file system. * able to use the file system.
*/ */
if (XFS_SB_VERSION_HASNLINK(&args.mp->m_sb)) if (xfs_sb_version_hasnlink(&args.mp->m_sb))
version = XFS_DINODE_VERSION_2; version = XFS_DINODE_VERSION_2;
else else
version = XFS_DINODE_VERSION_1; version = XFS_DINODE_VERSION_1;
......
...@@ -1147,7 +1147,7 @@ xfs_ialloc( ...@@ -1147,7 +1147,7 @@ xfs_ialloc(
* the inode version number now. This way we only do the conversion * the inode version number now. This way we only do the conversion
* here rather than here and in the flush/logging code. * here rather than here and in the flush/logging code.
*/ */
if (XFS_SB_VERSION_HASNLINK(&tp->t_mountp->m_sb) && if (xfs_sb_version_hasnlink(&tp->t_mountp->m_sb) &&
ip->i_d.di_version == XFS_DINODE_VERSION_1) { ip->i_d.di_version == XFS_DINODE_VERSION_1) {
ip->i_d.di_version = XFS_DINODE_VERSION_2; ip->i_d.di_version = XFS_DINODE_VERSION_2;
/* /*
...@@ -3434,9 +3434,9 @@ xfs_iflush_int( ...@@ -3434,9 +3434,9 @@ xfs_iflush_int(
* has been updated, then make the conversion permanent. * has been updated, then make the conversion permanent.
*/ */
ASSERT(ip->i_d.di_version == XFS_DINODE_VERSION_1 || ASSERT(ip->i_d.di_version == XFS_DINODE_VERSION_1 ||
XFS_SB_VERSION_HASNLINK(&mp->m_sb)); xfs_sb_version_hasnlink(&mp->m_sb));
if (ip->i_d.di_version == XFS_DINODE_VERSION_1) { if (ip->i_d.di_version == XFS_DINODE_VERSION_1) {
if (!XFS_SB_VERSION_HASNLINK(&mp->m_sb)) { if (!xfs_sb_version_hasnlink(&mp->m_sb)) {
/* /*
* Convert it back. * Convert it back.
*/ */
......
...@@ -296,9 +296,9 @@ xfs_inode_item_format( ...@@ -296,9 +296,9 @@ xfs_inode_item_format(
*/ */
mp = ip->i_mount; mp = ip->i_mount;
ASSERT(ip->i_d.di_version == XFS_DINODE_VERSION_1 || ASSERT(ip->i_d.di_version == XFS_DINODE_VERSION_1 ||
XFS_SB_VERSION_HASNLINK(&mp->m_sb)); xfs_sb_version_hasnlink(&mp->m_sb));
if (ip->i_d.di_version == XFS_DINODE_VERSION_1) { if (ip->i_d.di_version == XFS_DINODE_VERSION_1) {
if (!XFS_SB_VERSION_HASNLINK(&mp->m_sb)) { if (!xfs_sb_version_hasnlink(&mp->m_sb)) {
/* /*
* Convert it back. * Convert it back.
*/ */
......
...@@ -45,7 +45,7 @@ xfs_internal_inum( ...@@ -45,7 +45,7 @@ xfs_internal_inum(
xfs_ino_t ino) xfs_ino_t ino)
{ {
return (ino == mp->m_sb.sb_rbmino || ino == mp->m_sb.sb_rsumino || return (ino == mp->m_sb.sb_rbmino || ino == mp->m_sb.sb_rsumino ||
(XFS_SB_VERSION_HASQUOTA(&mp->m_sb) && (xfs_sb_version_hasquota(&mp->m_sb) &&
(ino == mp->m_sb.sb_uquotino || ino == mp->m_sb.sb_gquotino))); (ino == mp->m_sb.sb_uquotino || ino == mp->m_sb.sb_gquotino)));
} }
......
...@@ -1090,7 +1090,7 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp, ...@@ -1090,7 +1090,7 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp,
size >>= 1; size >>= 1;
} }
if (XFS_SB_VERSION_HASLOGV2(&mp->m_sb)) { if (xfs_sb_version_haslogv2(&mp->m_sb)) {
/* # headers = size / 32K /* # headers = size / 32K
* one header holds cycles from 32K of data * one header holds cycles from 32K of data
*/ */
...@@ -1186,13 +1186,13 @@ xlog_alloc_log(xfs_mount_t *mp, ...@@ -1186,13 +1186,13 @@ xlog_alloc_log(xfs_mount_t *mp,
log->l_grant_reserve_cycle = 1; log->l_grant_reserve_cycle = 1;
log->l_grant_write_cycle = 1; log->l_grant_write_cycle = 1;
if (XFS_SB_VERSION_HASSECTOR(&mp->m_sb)) { if (xfs_sb_version_hassector(&mp->m_sb)) {
log->l_sectbb_log = mp->m_sb.sb_logsectlog - BBSHIFT; log->l_sectbb_log = mp->m_sb.sb_logsectlog - BBSHIFT;
ASSERT(log->l_sectbb_log <= mp->m_sectbb_log); ASSERT(log->l_sectbb_log <= mp->m_sectbb_log);
/* for larger sector sizes, must have v2 or external log */ /* for larger sector sizes, must have v2 or external log */
ASSERT(log->l_sectbb_log == 0 || ASSERT(log->l_sectbb_log == 0 ||
log->l_logBBstart == 0 || log->l_logBBstart == 0 ||
XFS_SB_VERSION_HASLOGV2(&mp->m_sb)); xfs_sb_version_haslogv2(&mp->m_sb));
ASSERT(mp->m_sb.sb_logsectlog >= BBSHIFT); ASSERT(mp->m_sb.sb_logsectlog >= BBSHIFT);
} }
log->l_sectbb_mask = (1 << log->l_sectbb_log) - 1; log->l_sectbb_mask = (1 << log->l_sectbb_log) - 1;
...@@ -1247,7 +1247,7 @@ xlog_alloc_log(xfs_mount_t *mp, ...@@ -1247,7 +1247,7 @@ xlog_alloc_log(xfs_mount_t *mp,
memset(head, 0, sizeof(xlog_rec_header_t)); memset(head, 0, sizeof(xlog_rec_header_t));
head->h_magicno = cpu_to_be32(XLOG_HEADER_MAGIC_NUM); head->h_magicno = cpu_to_be32(XLOG_HEADER_MAGIC_NUM);
head->h_version = cpu_to_be32( head->h_version = cpu_to_be32(
XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb) ? 2 : 1); xfs_sb_version_haslogv2(&log->l_mp->m_sb) ? 2 : 1);
head->h_size = cpu_to_be32(log->l_iclog_size); head->h_size = cpu_to_be32(log->l_iclog_size);
/* new fields */ /* new fields */
head->h_fmt = cpu_to_be32(XLOG_FMT); head->h_fmt = cpu_to_be32(XLOG_FMT);
...@@ -1402,7 +1402,7 @@ xlog_sync(xlog_t *log, ...@@ -1402,7 +1402,7 @@ xlog_sync(xlog_t *log,
int roundoff; /* roundoff to BB or stripe */ int roundoff; /* roundoff to BB or stripe */
int split = 0; /* split write into two regions */ int split = 0; /* split write into two regions */
int error; int error;
int v2 = XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb); int v2 = xfs_sb_version_haslogv2(&log->l_mp->m_sb);
XFS_STATS_INC(xs_log_writes); XFS_STATS_INC(xs_log_writes);
ASSERT(iclog->ic_refcnt == 0); ASSERT(iclog->ic_refcnt == 0);
...@@ -2881,7 +2881,7 @@ xlog_state_switch_iclogs(xlog_t *log, ...@@ -2881,7 +2881,7 @@ xlog_state_switch_iclogs(xlog_t *log,
log->l_curr_block += BTOBB(eventual_size)+BTOBB(log->l_iclog_hsize); log->l_curr_block += BTOBB(eventual_size)+BTOBB(log->l_iclog_hsize);
/* Round up to next log-sunit */ /* Round up to next log-sunit */
if (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb) && if (xfs_sb_version_haslogv2(&log->l_mp->m_sb) &&
log->l_mp->m_sb.sb_logsunit > 1) { log->l_mp->m_sb.sb_logsunit > 1) {
__uint32_t sunit_bb = BTOBB(log->l_mp->m_sb.sb_logsunit); __uint32_t sunit_bb = BTOBB(log->l_mp->m_sb.sb_logsunit);
log->l_curr_block = roundup(log->l_curr_block, sunit_bb); log->l_curr_block = roundup(log->l_curr_block, sunit_bb);
...@@ -3334,7 +3334,7 @@ xlog_ticket_get(xlog_t *log, ...@@ -3334,7 +3334,7 @@ xlog_ticket_get(xlog_t *log,
unit_bytes += sizeof(xlog_op_header_t) * num_headers; unit_bytes += sizeof(xlog_op_header_t) * num_headers;
/* for roundoff padding for transaction data and one for commit record */ /* for roundoff padding for transaction data and one for commit record */
if (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb) && if (xfs_sb_version_haslogv2(&log->l_mp->m_sb) &&
log->l_mp->m_sb.sb_logsunit > 1) { log->l_mp->m_sb.sb_logsunit > 1) {
/* log su roundoff */ /* log su roundoff */
unit_bytes += 2*log->l_mp->m_sb.sb_logsunit; unit_bytes += 2*log->l_mp->m_sb.sb_logsunit;
......
...@@ -49,10 +49,10 @@ struct xfs_mount; ...@@ -49,10 +49,10 @@ struct xfs_mount;
#define XLOG_HEADER_SIZE 512 #define XLOG_HEADER_SIZE 512
#define XLOG_REC_SHIFT(log) \ #define XLOG_REC_SHIFT(log) \
BTOBB(1 << (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb) ? \ BTOBB(1 << (xfs_sb_version_haslogv2(&log->l_mp->m_sb) ? \
XLOG_MAX_RECORD_BSHIFT : XLOG_BIG_RECORD_BSHIFT)) XLOG_MAX_RECORD_BSHIFT : XLOG_BIG_RECORD_BSHIFT))
#define XLOG_TOTAL_REC_SHIFT(log) \ #define XLOG_TOTAL_REC_SHIFT(log) \
BTOBB(XLOG_MAX_ICLOGS << (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb) ? \ BTOBB(XLOG_MAX_ICLOGS << (xfs_sb_version_haslogv2(&log->l_mp->m_sb) ? \
XLOG_MAX_RECORD_BSHIFT : XLOG_BIG_RECORD_BSHIFT)) XLOG_MAX_RECORD_BSHIFT : XLOG_BIG_RECORD_BSHIFT))
......
...@@ -478,7 +478,7 @@ xlog_find_verify_log_record( ...@@ -478,7 +478,7 @@ xlog_find_verify_log_record(
* reset last_blk. Only when last_blk points in the middle of a log * reset last_blk. Only when last_blk points in the middle of a log
* record do we update last_blk. * record do we update last_blk.
*/ */
if (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb)) { if (xfs_sb_version_haslogv2(&log->l_mp->m_sb)) {
uint h_size = be32_to_cpu(head->h_size); uint h_size = be32_to_cpu(head->h_size);
xhdrs = h_size / XLOG_HEADER_CYCLE_SIZE; xhdrs = h_size / XLOG_HEADER_CYCLE_SIZE;
...@@ -888,7 +888,7 @@ xlog_find_tail( ...@@ -888,7 +888,7 @@ xlog_find_tail(
* unmount record if there is one, so we pass the lsn of the * unmount record if there is one, so we pass the lsn of the
* unmount record rather than the block after it. * unmount record rather than the block after it.
*/ */
if (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb)) { if (xfs_sb_version_haslogv2(&log->l_mp->m_sb)) {
int h_size = be32_to_cpu(rhead->h_size); int h_size = be32_to_cpu(rhead->h_size);
int h_version = be32_to_cpu(rhead->h_version); int h_version = be32_to_cpu(rhead->h_version);
...@@ -1101,7 +1101,7 @@ xlog_add_record( ...@@ -1101,7 +1101,7 @@ xlog_add_record(
recp->h_magicno = cpu_to_be32(XLOG_HEADER_MAGIC_NUM); recp->h_magicno = cpu_to_be32(XLOG_HEADER_MAGIC_NUM);
recp->h_cycle = cpu_to_be32(cycle); recp->h_cycle = cpu_to_be32(cycle);
recp->h_version = cpu_to_be32( recp->h_version = cpu_to_be32(
XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb) ? 2 : 1); xfs_sb_version_haslogv2(&log->l_mp->m_sb) ? 2 : 1);
recp->h_lsn = cpu_to_be64(xlog_assign_lsn(cycle, block)); recp->h_lsn = cpu_to_be64(xlog_assign_lsn(cycle, block));
recp->h_tail_lsn = cpu_to_be64(xlog_assign_lsn(tail_cycle, tail_block)); recp->h_tail_lsn = cpu_to_be64(xlog_assign_lsn(tail_cycle, tail_block));
recp->h_fmt = cpu_to_be32(XLOG_FMT); recp->h_fmt = cpu_to_be32(XLOG_FMT);
...@@ -3348,7 +3348,7 @@ xlog_pack_data( ...@@ -3348,7 +3348,7 @@ xlog_pack_data(
dp += BBSIZE; dp += BBSIZE;
} }
if (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb)) { if (xfs_sb_version_haslogv2(&log->l_mp->m_sb)) {
xhdr = (xlog_in_core_2_t *)&iclog->ic_header; xhdr = (xlog_in_core_2_t *)&iclog->ic_header;
for ( ; i < BTOBB(size); i++) { for ( ; i < BTOBB(size); i++) {
j = i / (XLOG_HEADER_CYCLE_SIZE / BBSIZE); j = i / (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
...@@ -3388,7 +3388,7 @@ xlog_unpack_data_checksum( ...@@ -3388,7 +3388,7 @@ xlog_unpack_data_checksum(
be32_to_cpu(rhead->h_chksum), chksum); be32_to_cpu(rhead->h_chksum), chksum);
cmn_err(CE_DEBUG, cmn_err(CE_DEBUG,
"XFS: Disregard message if filesystem was created with non-DEBUG kernel"); "XFS: Disregard message if filesystem was created with non-DEBUG kernel");
if (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb)) { if (xfs_sb_version_haslogv2(&log->l_mp->m_sb)) {
cmn_err(CE_DEBUG, cmn_err(CE_DEBUG,
"XFS: LogR this is a LogV2 filesystem\n"); "XFS: LogR this is a LogV2 filesystem\n");
} }
...@@ -3415,7 +3415,7 @@ xlog_unpack_data( ...@@ -3415,7 +3415,7 @@ xlog_unpack_data(
dp += BBSIZE; dp += BBSIZE;
} }
if (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb)) { if (xfs_sb_version_haslogv2(&log->l_mp->m_sb)) {
xhdr = (xlog_in_core_2_t *)rhead; xhdr = (xlog_in_core_2_t *)rhead;
for ( ; i < BTOBB(be32_to_cpu(rhead->h_len)); i++) { for ( ; i < BTOBB(be32_to_cpu(rhead->h_len)); i++) {
j = i / (XLOG_HEADER_CYCLE_SIZE / BBSIZE); j = i / (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
...@@ -3494,7 +3494,7 @@ xlog_do_recovery_pass( ...@@ -3494,7 +3494,7 @@ xlog_do_recovery_pass(
* Read the header of the tail block and get the iclog buffer size from * Read the header of the tail block and get the iclog buffer size from
* h_size. Use this to tell how many sectors make up the log header. * h_size. Use this to tell how many sectors make up the log header.
*/ */
if (XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb)) { if (xfs_sb_version_haslogv2(&log->l_mp->m_sb)) {
/* /*
* When using variable length iclogs, read first sector of * When using variable length iclogs, read first sector of
* iclog header and extract the header size from it. Get a * iclog header and extract the header size from it. Get a
...@@ -3838,7 +3838,7 @@ xlog_do_recover( ...@@ -3838,7 +3838,7 @@ xlog_do_recover(
sbp = &log->l_mp->m_sb; sbp = &log->l_mp->m_sb;
xfs_sb_from_disk(sbp, XFS_BUF_TO_SBP(bp)); xfs_sb_from_disk(sbp, XFS_BUF_TO_SBP(bp));
ASSERT(sbp->sb_magicnum == XFS_SB_MAGIC); ASSERT(sbp->sb_magicnum == XFS_SB_MAGIC);
ASSERT(XFS_SB_GOOD_VERSION(sbp)); ASSERT(xfs_sb_good_version(sbp));
xfs_buf_relse(bp); xfs_buf_relse(bp);
/* We've re-read the superblock so re-initialize per-cpu counters */ /* We've re-read the superblock so re-initialize per-cpu counters */
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#include "xfs_quota.h" #include "xfs_quota.h"
#include "xfs_fsops.h" #include "xfs_fsops.h"
STATIC void xfs_mount_log_sbunit(xfs_mount_t *, __int64_t); STATIC void xfs_mount_log_sb(xfs_mount_t *, __int64_t);
STATIC int xfs_uuid_mount(xfs_mount_t *); STATIC int xfs_uuid_mount(xfs_mount_t *);
STATIC void xfs_uuid_unmount(xfs_mount_t *mp); STATIC void xfs_uuid_unmount(xfs_mount_t *mp);
STATIC void xfs_unmountfs_wait(xfs_mount_t *); STATIC void xfs_unmountfs_wait(xfs_mount_t *);
...@@ -119,6 +119,7 @@ static const struct { ...@@ -119,6 +119,7 @@ static const struct {
{ offsetof(xfs_sb_t, sb_logsectsize),0 }, { offsetof(xfs_sb_t, sb_logsectsize),0 },
{ offsetof(xfs_sb_t, sb_logsunit), 0 }, { offsetof(xfs_sb_t, sb_logsunit), 0 },
{ offsetof(xfs_sb_t, sb_features2), 0 }, { offsetof(xfs_sb_t, sb_features2), 0 },
{ offsetof(xfs_sb_t, sb_bad_features2), 0 },
{ sizeof(xfs_sb_t), 0 } { sizeof(xfs_sb_t), 0 }
}; };
...@@ -225,7 +226,7 @@ xfs_mount_validate_sb( ...@@ -225,7 +226,7 @@ xfs_mount_validate_sb(
return XFS_ERROR(EWRONGFS); return XFS_ERROR(EWRONGFS);
} }
if (!XFS_SB_GOOD_VERSION(sbp)) { if (!xfs_sb_good_version(sbp)) {
xfs_fs_mount_cmn_err(flags, "bad version"); xfs_fs_mount_cmn_err(flags, "bad version");
return XFS_ERROR(EWRONGFS); return XFS_ERROR(EWRONGFS);
} }
...@@ -300,7 +301,7 @@ xfs_mount_validate_sb( ...@@ -300,7 +301,7 @@ xfs_mount_validate_sb(
/* /*
* Version 1 directory format has never worked on Linux. * Version 1 directory format has never worked on Linux.
*/ */
if (unlikely(!XFS_SB_VERSION_HASDIRV2(sbp))) { if (unlikely(!xfs_sb_version_hasdirv2(sbp))) {
xfs_fs_mount_cmn_err(flags, xfs_fs_mount_cmn_err(flags,
"file system using version 1 directory format"); "file system using version 1 directory format");
return XFS_ERROR(ENOSYS); return XFS_ERROR(ENOSYS);
...@@ -449,6 +450,7 @@ xfs_sb_from_disk( ...@@ -449,6 +450,7 @@ xfs_sb_from_disk(
to->sb_logsectsize = be16_to_cpu(from->sb_logsectsize); to->sb_logsectsize = be16_to_cpu(from->sb_logsectsize);
to->sb_logsunit = be32_to_cpu(from->sb_logsunit); to->sb_logsunit = be32_to_cpu(from->sb_logsunit);
to->sb_features2 = be32_to_cpu(from->sb_features2); to->sb_features2 = be32_to_cpu(from->sb_features2);
to->sb_bad_features2 = be32_to_cpu(from->sb_bad_features2);
} }
/* /*
...@@ -781,7 +783,7 @@ xfs_update_alignment(xfs_mount_t *mp, int mfsi_flags, __uint64_t *update_flags) ...@@ -781,7 +783,7 @@ xfs_update_alignment(xfs_mount_t *mp, int mfsi_flags, __uint64_t *update_flags)
* Update superblock with new values * Update superblock with new values
* and log changes * and log changes
*/ */
if (XFS_SB_VERSION_HASDALIGN(sbp)) { if (xfs_sb_version_hasdalign(sbp)) {
if (sbp->sb_unit != mp->m_dalign) { if (sbp->sb_unit != mp->m_dalign) {
sbp->sb_unit = mp->m_dalign; sbp->sb_unit = mp->m_dalign;
*update_flags |= XFS_SB_UNIT; *update_flags |= XFS_SB_UNIT;
...@@ -792,7 +794,7 @@ xfs_update_alignment(xfs_mount_t *mp, int mfsi_flags, __uint64_t *update_flags) ...@@ -792,7 +794,7 @@ xfs_update_alignment(xfs_mount_t *mp, int mfsi_flags, __uint64_t *update_flags)
} }
} }
} else if ((mp->m_flags & XFS_MOUNT_NOALIGN) != XFS_MOUNT_NOALIGN && } else if ((mp->m_flags & XFS_MOUNT_NOALIGN) != XFS_MOUNT_NOALIGN &&
XFS_SB_VERSION_HASDALIGN(&mp->m_sb)) { xfs_sb_version_hasdalign(&mp->m_sb)) {
mp->m_dalign = sbp->sb_unit; mp->m_dalign = sbp->sb_unit;
mp->m_swidth = sbp->sb_width; mp->m_swidth = sbp->sb_width;
} }
...@@ -869,7 +871,7 @@ xfs_set_rw_sizes(xfs_mount_t *mp) ...@@ -869,7 +871,7 @@ xfs_set_rw_sizes(xfs_mount_t *mp)
STATIC void STATIC void
xfs_set_inoalignment(xfs_mount_t *mp) xfs_set_inoalignment(xfs_mount_t *mp)
{ {
if (XFS_SB_VERSION_HASALIGN(&mp->m_sb) && if (xfs_sb_version_hasalign(&mp->m_sb) &&
mp->m_sb.sb_inoalignmt >= mp->m_sb.sb_inoalignmt >=
XFS_B_TO_FSBT(mp, mp->m_inode_cluster_size)) XFS_B_TO_FSBT(mp, mp->m_inode_cluster_size))
mp->m_inoalign_mask = mp->m_sb.sb_inoalignmt - 1; mp->m_inoalign_mask = mp->m_sb.sb_inoalignmt - 1;
...@@ -969,6 +971,38 @@ xfs_mountfs( ...@@ -969,6 +971,38 @@ xfs_mountfs(
} }
xfs_mount_common(mp, sbp); xfs_mount_common(mp, sbp);
/*
* Check for a mismatched features2 values. Older kernels
* read & wrote into the wrong sb offset for sb_features2
* on some platforms due to xfs_sb_t not being 64bit size aligned
* when sb_features2 was added, which made older superblock
* reading/writing routines swap it as a 64-bit value.
*
* For backwards compatibility, we make both slots equal.
*
* If we detect a mismatched field, we OR the set bits into the
* existing features2 field in case it has already been modified; we
* don't want to lose any features. We then update the bad location
* with the ORed value so that older kernels will see any features2
* flags, and mark the two fields as needing updates once the
* transaction subsystem is online.
*/
if (xfs_sb_has_mismatched_features2(sbp)) {
cmn_err(CE_WARN,
"XFS: correcting sb_features alignment problem");
sbp->sb_features2 |= sbp->sb_bad_features2;
sbp->sb_bad_features2 = sbp->sb_features2;
update_flags |= XFS_SB_FEATURES2 | XFS_SB_BAD_FEATURES2;
/*
* Re-check for ATTR2 in case it was found in bad_features2
* slot.
*/
if (xfs_sb_version_hasattr2(&mp->m_sb))
mp->m_flags |= XFS_MOUNT_ATTR2;
}
/* /*
* Check if sb_agblocks is aligned at stripe boundary * Check if sb_agblocks is aligned at stripe boundary
* If sb_agblocks is NOT aligned turn off m_dalign since * If sb_agblocks is NOT aligned turn off m_dalign since
...@@ -1159,11 +1193,10 @@ xfs_mountfs( ...@@ -1159,11 +1193,10 @@ xfs_mountfs(
} }
/* /*
* If fs is not mounted readonly, then update the superblock * If fs is not mounted readonly, then update the superblock changes.
* unit and width changes.
*/ */
if (update_flags && !(mp->m_flags & XFS_MOUNT_RDONLY)) if (update_flags && !(mp->m_flags & XFS_MOUNT_RDONLY))
xfs_mount_log_sbunit(mp, update_flags); xfs_mount_log_sb(mp, update_flags);
/* /*
* Initialise the XFS quota management subsystem for this mount * Initialise the XFS quota management subsystem for this mount
...@@ -1875,16 +1908,18 @@ xfs_uuid_unmount( ...@@ -1875,16 +1908,18 @@ xfs_uuid_unmount(
/* /*
* Used to log changes to the superblock unit and width fields which could * Used to log changes to the superblock unit and width fields which could
* be altered by the mount options. Only the first superblock is updated. * be altered by the mount options, as well as any potential sb_features2
* fixup. Only the first superblock is updated.
*/ */
STATIC void STATIC void
xfs_mount_log_sbunit( xfs_mount_log_sb(
xfs_mount_t *mp, xfs_mount_t *mp,
__int64_t fields) __int64_t fields)
{ {
xfs_trans_t *tp; xfs_trans_t *tp;
ASSERT(fields & (XFS_SB_UNIT|XFS_SB_WIDTH|XFS_SB_UUID)); ASSERT(fields & (XFS_SB_UNIT | XFS_SB_WIDTH | XFS_SB_UUID |
XFS_SB_FEATURES2 | XFS_SB_BAD_FEATURES2));
tp = xfs_trans_alloc(mp, XFS_TRANS_SB_UNIT); tp = xfs_trans_alloc(mp, XFS_TRANS_SB_UNIT);
if (xfs_trans_reserve(tp, 0, mp->m_sb.sb_sectsize + 128, 0, 0, if (xfs_trans_reserve(tp, 0, mp->m_sb.sb_sectsize + 128, 0, 0,
......
...@@ -89,6 +89,7 @@ struct xfs_mount; ...@@ -89,6 +89,7 @@ struct xfs_mount;
/* /*
* Superblock - in core version. Must match the ondisk version below. * Superblock - in core version. Must match the ondisk version below.
* Must be padded to 64 bit alignment.
*/ */
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 */
...@@ -145,10 +146,21 @@ typedef struct xfs_sb { ...@@ -145,10 +146,21 @@ typedef struct xfs_sb {
__uint16_t sb_logsectsize; /* sector size for the log, bytes */ __uint16_t sb_logsectsize; /* sector size for the log, bytes */
__uint32_t sb_logsunit; /* stripe unit size for the log */ __uint32_t sb_logsunit; /* stripe unit size for the log */
__uint32_t sb_features2; /* additional feature bits */ __uint32_t sb_features2; /* additional feature bits */
/*
* bad features2 field as a result of failing to pad the sb
* structure to 64 bits. Some machines will be using this field
* for features2 bits. Easiest just to mark it bad and not use
* it for anything else.
*/
__uint32_t sb_bad_features2;
/* must be padded to 64 bit alignment */
} xfs_sb_t; } xfs_sb_t;
/* /*
* Superblock - on disk version. Must match the in core version below. * Superblock - on disk version. Must match the in core version above.
* Must be padded to 64 bit alignment.
*/ */
typedef struct xfs_dsb { typedef struct xfs_dsb {
__be32 sb_magicnum; /* magic number == XFS_SB_MAGIC */ __be32 sb_magicnum; /* magic number == XFS_SB_MAGIC */
...@@ -205,6 +217,15 @@ typedef struct xfs_dsb { ...@@ -205,6 +217,15 @@ typedef struct xfs_dsb {
__be16 sb_logsectsize; /* sector size for the log, bytes */ __be16 sb_logsectsize; /* sector size for the log, bytes */
__be32 sb_logsunit; /* stripe unit size for the log */ __be32 sb_logsunit; /* stripe unit size for the log */
__be32 sb_features2; /* additional feature bits */ __be32 sb_features2; /* additional feature bits */
/*
* bad features2 field as a result of failing to pad the sb
* structure to 64 bits. Some machines will be using this field
* for features2 bits. Easiest just to mark it bad and not use
* it for anything else.
*/
__be32 sb_bad_features2;
/* must be padded to 64 bit alignment */
} xfs_dsb_t; } xfs_dsb_t;
/* /*
...@@ -223,7 +244,7 @@ typedef enum { ...@@ -223,7 +244,7 @@ typedef enum {
XFS_SBS_GQUOTINO, XFS_SBS_QFLAGS, XFS_SBS_FLAGS, XFS_SBS_SHARED_VN, XFS_SBS_GQUOTINO, XFS_SBS_QFLAGS, XFS_SBS_FLAGS, XFS_SBS_SHARED_VN,
XFS_SBS_INOALIGNMT, XFS_SBS_UNIT, XFS_SBS_WIDTH, XFS_SBS_DIRBLKLOG, XFS_SBS_INOALIGNMT, XFS_SBS_UNIT, XFS_SBS_WIDTH, XFS_SBS_DIRBLKLOG,
XFS_SBS_LOGSECTLOG, XFS_SBS_LOGSECTSIZE, XFS_SBS_LOGSUNIT, XFS_SBS_LOGSECTLOG, XFS_SBS_LOGSECTSIZE, XFS_SBS_LOGSUNIT,
XFS_SBS_FEATURES2, XFS_SBS_FEATURES2, XFS_SBS_BAD_FEATURES2,
XFS_SBS_FIELDCOUNT XFS_SBS_FIELDCOUNT
} xfs_sb_field_t; } xfs_sb_field_t;
...@@ -248,13 +269,15 @@ typedef enum { ...@@ -248,13 +269,15 @@ typedef enum {
#define XFS_SB_IFREE XFS_SB_MVAL(IFREE) #define XFS_SB_IFREE XFS_SB_MVAL(IFREE)
#define XFS_SB_FDBLOCKS XFS_SB_MVAL(FDBLOCKS) #define XFS_SB_FDBLOCKS XFS_SB_MVAL(FDBLOCKS)
#define XFS_SB_FEATURES2 XFS_SB_MVAL(FEATURES2) #define XFS_SB_FEATURES2 XFS_SB_MVAL(FEATURES2)
#define XFS_SB_BAD_FEATURES2 XFS_SB_MVAL(BAD_FEATURES2)
#define XFS_SB_NUM_BITS ((int)XFS_SBS_FIELDCOUNT) #define XFS_SB_NUM_BITS ((int)XFS_SBS_FIELDCOUNT)
#define XFS_SB_ALL_BITS ((1LL << XFS_SB_NUM_BITS) - 1) #define XFS_SB_ALL_BITS ((1LL << XFS_SB_NUM_BITS) - 1)
#define XFS_SB_MOD_BITS \ #define XFS_SB_MOD_BITS \
(XFS_SB_UUID | XFS_SB_ROOTINO | XFS_SB_RBMINO | XFS_SB_RSUMINO | \ (XFS_SB_UUID | XFS_SB_ROOTINO | XFS_SB_RBMINO | XFS_SB_RSUMINO | \
XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | XFS_SB_GQUOTINO | \ XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | XFS_SB_GQUOTINO | \
XFS_SB_QFLAGS | XFS_SB_SHARED_VN | XFS_SB_UNIT | XFS_SB_WIDTH | \ XFS_SB_QFLAGS | XFS_SB_SHARED_VN | XFS_SB_UNIT | XFS_SB_WIDTH | \
XFS_SB_ICOUNT | XFS_SB_IFREE | XFS_SB_FDBLOCKS | XFS_SB_FEATURES2) XFS_SB_ICOUNT | XFS_SB_IFREE | XFS_SB_FDBLOCKS | XFS_SB_FEATURES2 | \
XFS_SB_BAD_FEATURES2)
/* /*
...@@ -271,7 +294,6 @@ typedef enum { ...@@ -271,7 +294,6 @@ typedef enum {
#define XFS_SB_VERSION_NUM(sbp) ((sbp)->sb_versionnum & XFS_SB_VERSION_NUMBITS) #define XFS_SB_VERSION_NUM(sbp) ((sbp)->sb_versionnum & XFS_SB_VERSION_NUMBITS)
#define XFS_SB_GOOD_VERSION(sbp) xfs_sb_good_version(sbp)
#ifdef __KERNEL__ #ifdef __KERNEL__
static inline int xfs_sb_good_version(xfs_sb_t *sbp) static inline int xfs_sb_good_version(xfs_sb_t *sbp)
{ {
...@@ -297,7 +319,15 @@ static inline int xfs_sb_good_version(xfs_sb_t *sbp) ...@@ -297,7 +319,15 @@ static inline int xfs_sb_good_version(xfs_sb_t *sbp)
} }
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#define XFS_SB_VERSION_TONEW(v) xfs_sb_version_tonew(v) /*
* Detect a mismatched features2 field. Older kernels read/wrote
* this into the wrong slot, so to be safe we keep them in sync.
*/
static inline int xfs_sb_has_mismatched_features2(xfs_sb_t *sbp)
{
return (sbp->sb_bad_features2 != sbp->sb_features2);
}
static inline unsigned xfs_sb_version_tonew(unsigned v) static inline unsigned xfs_sb_version_tonew(unsigned v)
{ {
return ((((v) == XFS_SB_VERSION_1) ? \ return ((((v) == XFS_SB_VERSION_1) ? \
...@@ -308,7 +338,6 @@ static inline unsigned xfs_sb_version_tonew(unsigned v) ...@@ -308,7 +338,6 @@ static inline unsigned xfs_sb_version_tonew(unsigned v)
XFS_SB_VERSION_4); XFS_SB_VERSION_4);
} }
#define XFS_SB_VERSION_TOOLD(v) xfs_sb_version_toold(v)
static inline unsigned xfs_sb_version_toold(unsigned v) static inline unsigned xfs_sb_version_toold(unsigned v)
{ {
return (((v) & (XFS_SB_VERSION_QUOTABIT | XFS_SB_VERSION_ALIGNBIT)) ? \ return (((v) & (XFS_SB_VERSION_QUOTABIT | XFS_SB_VERSION_ALIGNBIT)) ? \
...@@ -320,7 +349,6 @@ static inline unsigned xfs_sb_version_toold(unsigned v) ...@@ -320,7 +349,6 @@ static inline unsigned xfs_sb_version_toold(unsigned v)
XFS_SB_VERSION_1))); XFS_SB_VERSION_1)));
} }
#define XFS_SB_VERSION_HASATTR(sbp) xfs_sb_version_hasattr(sbp)
static inline int xfs_sb_version_hasattr(xfs_sb_t *sbp) static inline int xfs_sb_version_hasattr(xfs_sb_t *sbp)
{ {
return ((sbp)->sb_versionnum == XFS_SB_VERSION_2) || \ return ((sbp)->sb_versionnum == XFS_SB_VERSION_2) || \
...@@ -329,7 +357,6 @@ static inline int xfs_sb_version_hasattr(xfs_sb_t *sbp) ...@@ -329,7 +357,6 @@ static inline int xfs_sb_version_hasattr(xfs_sb_t *sbp)
((sbp)->sb_versionnum & XFS_SB_VERSION_ATTRBIT)); ((sbp)->sb_versionnum & XFS_SB_VERSION_ATTRBIT));
} }
#define XFS_SB_VERSION_ADDATTR(sbp) xfs_sb_version_addattr(sbp)
static inline void xfs_sb_version_addattr(xfs_sb_t *sbp) static inline void xfs_sb_version_addattr(xfs_sb_t *sbp)
{ {
(sbp)->sb_versionnum = (((sbp)->sb_versionnum == XFS_SB_VERSION_1) ? \ (sbp)->sb_versionnum = (((sbp)->sb_versionnum == XFS_SB_VERSION_1) ? \
...@@ -339,7 +366,6 @@ static inline void xfs_sb_version_addattr(xfs_sb_t *sbp) ...@@ -339,7 +366,6 @@ static inline void xfs_sb_version_addattr(xfs_sb_t *sbp)
(XFS_SB_VERSION_4 | XFS_SB_VERSION_ATTRBIT))); (XFS_SB_VERSION_4 | XFS_SB_VERSION_ATTRBIT)));
} }
#define XFS_SB_VERSION_HASNLINK(sbp) xfs_sb_version_hasnlink(sbp)
static inline int xfs_sb_version_hasnlink(xfs_sb_t *sbp) static inline int xfs_sb_version_hasnlink(xfs_sb_t *sbp)
{ {
return ((sbp)->sb_versionnum == XFS_SB_VERSION_3) || \ return ((sbp)->sb_versionnum == XFS_SB_VERSION_3) || \
...@@ -347,7 +373,6 @@ static inline int xfs_sb_version_hasnlink(xfs_sb_t *sbp) ...@@ -347,7 +373,6 @@ static inline int xfs_sb_version_hasnlink(xfs_sb_t *sbp)
((sbp)->sb_versionnum & XFS_SB_VERSION_NLINKBIT)); ((sbp)->sb_versionnum & XFS_SB_VERSION_NLINKBIT));
} }
#define XFS_SB_VERSION_ADDNLINK(sbp) xfs_sb_version_addnlink(sbp)
static inline void xfs_sb_version_addnlink(xfs_sb_t *sbp) static inline void xfs_sb_version_addnlink(xfs_sb_t *sbp)
{ {
(sbp)->sb_versionnum = ((sbp)->sb_versionnum <= XFS_SB_VERSION_2 ? \ (sbp)->sb_versionnum = ((sbp)->sb_versionnum <= XFS_SB_VERSION_2 ? \
...@@ -355,115 +380,63 @@ static inline void xfs_sb_version_addnlink(xfs_sb_t *sbp) ...@@ -355,115 +380,63 @@ static inline void xfs_sb_version_addnlink(xfs_sb_t *sbp)
((sbp)->sb_versionnum | XFS_SB_VERSION_NLINKBIT)); ((sbp)->sb_versionnum | XFS_SB_VERSION_NLINKBIT));
} }
#define XFS_SB_VERSION_HASQUOTA(sbp) xfs_sb_version_hasquota(sbp)
static inline int xfs_sb_version_hasquota(xfs_sb_t *sbp) static inline int xfs_sb_version_hasquota(xfs_sb_t *sbp)
{ {
return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
((sbp)->sb_versionnum & XFS_SB_VERSION_QUOTABIT); ((sbp)->sb_versionnum & XFS_SB_VERSION_QUOTABIT);
} }
#define XFS_SB_VERSION_ADDQUOTA(sbp) xfs_sb_version_addquota(sbp)
static inline void xfs_sb_version_addquota(xfs_sb_t *sbp) static inline void xfs_sb_version_addquota(xfs_sb_t *sbp)
{ {
(sbp)->sb_versionnum = \ (sbp)->sb_versionnum = \
(XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 ? \ (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4 ? \
((sbp)->sb_versionnum | XFS_SB_VERSION_QUOTABIT) : \ ((sbp)->sb_versionnum | XFS_SB_VERSION_QUOTABIT) : \
(XFS_SB_VERSION_TONEW((sbp)->sb_versionnum) | \ (xfs_sb_version_tonew((sbp)->sb_versionnum) | \
XFS_SB_VERSION_QUOTABIT)); XFS_SB_VERSION_QUOTABIT));
} }
#define XFS_SB_VERSION_HASALIGN(sbp) xfs_sb_version_hasalign(sbp)
static inline int xfs_sb_version_hasalign(xfs_sb_t *sbp) static inline int xfs_sb_version_hasalign(xfs_sb_t *sbp)
{ {
return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
((sbp)->sb_versionnum & XFS_SB_VERSION_ALIGNBIT); ((sbp)->sb_versionnum & XFS_SB_VERSION_ALIGNBIT);
} }
#define XFS_SB_VERSION_SUBALIGN(sbp) xfs_sb_version_subalign(sbp)
static inline void xfs_sb_version_subalign(xfs_sb_t *sbp)
{
(sbp)->sb_versionnum = \
XFS_SB_VERSION_TOOLD((sbp)->sb_versionnum & ~XFS_SB_VERSION_ALIGNBIT);
}
#define XFS_SB_VERSION_HASDALIGN(sbp) xfs_sb_version_hasdalign(sbp)
static inline int xfs_sb_version_hasdalign(xfs_sb_t *sbp) static inline int xfs_sb_version_hasdalign(xfs_sb_t *sbp)
{ {
return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
((sbp)->sb_versionnum & XFS_SB_VERSION_DALIGNBIT); ((sbp)->sb_versionnum & XFS_SB_VERSION_DALIGNBIT);
} }
#define XFS_SB_VERSION_ADDDALIGN(sbp) xfs_sb_version_adddalign(sbp)
static inline int xfs_sb_version_adddalign(xfs_sb_t *sbp)
{
return (sbp)->sb_versionnum = \
((sbp)->sb_versionnum | XFS_SB_VERSION_DALIGNBIT);
}
#define XFS_SB_VERSION_HASSHARED(sbp) xfs_sb_version_hasshared(sbp)
static inline int xfs_sb_version_hasshared(xfs_sb_t *sbp) static inline int xfs_sb_version_hasshared(xfs_sb_t *sbp)
{ {
return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
((sbp)->sb_versionnum & XFS_SB_VERSION_SHAREDBIT); ((sbp)->sb_versionnum & XFS_SB_VERSION_SHAREDBIT);
} }
#define XFS_SB_VERSION_ADDSHARED(sbp) xfs_sb_version_addshared(sbp)
static inline int xfs_sb_version_addshared(xfs_sb_t *sbp)
{
return (sbp)->sb_versionnum = \
((sbp)->sb_versionnum | XFS_SB_VERSION_SHAREDBIT);
}
#define XFS_SB_VERSION_SUBSHARED(sbp) xfs_sb_version_subshared(sbp)
static inline int xfs_sb_version_subshared(xfs_sb_t *sbp)
{
return (sbp)->sb_versionnum = \
((sbp)->sb_versionnum & ~XFS_SB_VERSION_SHAREDBIT);
}
#define XFS_SB_VERSION_HASDIRV2(sbp) xfs_sb_version_hasdirv2(sbp)
static inline int xfs_sb_version_hasdirv2(xfs_sb_t *sbp) static inline int xfs_sb_version_hasdirv2(xfs_sb_t *sbp)
{ {
return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
((sbp)->sb_versionnum & XFS_SB_VERSION_DIRV2BIT); ((sbp)->sb_versionnum & XFS_SB_VERSION_DIRV2BIT);
} }
#define XFS_SB_VERSION_HASLOGV2(sbp) xfs_sb_version_haslogv2(sbp)
static inline int xfs_sb_version_haslogv2(xfs_sb_t *sbp) static inline int xfs_sb_version_haslogv2(xfs_sb_t *sbp)
{ {
return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
((sbp)->sb_versionnum & XFS_SB_VERSION_LOGV2BIT); ((sbp)->sb_versionnum & XFS_SB_VERSION_LOGV2BIT);
} }
#define XFS_SB_VERSION_HASEXTFLGBIT(sbp) xfs_sb_version_hasextflgbit(sbp)
static inline int xfs_sb_version_hasextflgbit(xfs_sb_t *sbp) static inline int xfs_sb_version_hasextflgbit(xfs_sb_t *sbp)
{ {
return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
((sbp)->sb_versionnum & XFS_SB_VERSION_EXTFLGBIT); ((sbp)->sb_versionnum & XFS_SB_VERSION_EXTFLGBIT);
} }
#define XFS_SB_VERSION_ADDEXTFLGBIT(sbp) xfs_sb_version_addextflgbit(sbp)
static inline int xfs_sb_version_addextflgbit(xfs_sb_t *sbp)
{
return (sbp)->sb_versionnum = \
((sbp)->sb_versionnum | XFS_SB_VERSION_EXTFLGBIT);
}
#define XFS_SB_VERSION_SUBEXTFLGBIT(sbp) xfs_sb_version_subextflgbit(sbp)
static inline int xfs_sb_version_subextflgbit(xfs_sb_t *sbp)
{
return (sbp)->sb_versionnum = \
((sbp)->sb_versionnum & ~XFS_SB_VERSION_EXTFLGBIT);
}
#define XFS_SB_VERSION_HASSECTOR(sbp) xfs_sb_version_hassector(sbp)
static inline int xfs_sb_version_hassector(xfs_sb_t *sbp) static inline int xfs_sb_version_hassector(xfs_sb_t *sbp)
{ {
return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
((sbp)->sb_versionnum & XFS_SB_VERSION_SECTORBIT); ((sbp)->sb_versionnum & XFS_SB_VERSION_SECTORBIT);
} }
#define XFS_SB_VERSION_HASMOREBITS(sbp) xfs_sb_version_hasmorebits(sbp)
static inline int xfs_sb_version_hasmorebits(xfs_sb_t *sbp) static inline int xfs_sb_version_hasmorebits(xfs_sb_t *sbp)
{ {
return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \
...@@ -476,24 +449,22 @@ static inline int xfs_sb_version_hasmorebits(xfs_sb_t *sbp) ...@@ -476,24 +449,22 @@ static inline int xfs_sb_version_hasmorebits(xfs_sb_t *sbp)
* For example, for a bit defined as XFS_SB_VERSION2_FUNBIT, has a macro: * For example, for a bit defined as XFS_SB_VERSION2_FUNBIT, has a macro:
* *
* SB_VERSION_HASFUNBIT(xfs_sb_t *sbp) * SB_VERSION_HASFUNBIT(xfs_sb_t *sbp)
* ((XFS_SB_VERSION_HASMOREBITS(sbp) && * ((xfs_sb_version_hasmorebits(sbp) &&
* ((sbp)->sb_features2 & XFS_SB_VERSION2_FUNBIT) * ((sbp)->sb_features2 & XFS_SB_VERSION2_FUNBIT)
*/ */
static inline int xfs_sb_version_haslazysbcount(xfs_sb_t *sbp) static inline int xfs_sb_version_haslazysbcount(xfs_sb_t *sbp)
{ {
return (XFS_SB_VERSION_HASMOREBITS(sbp) && \ return (xfs_sb_version_hasmorebits(sbp) && \
((sbp)->sb_features2 & XFS_SB_VERSION2_LAZYSBCOUNTBIT)); ((sbp)->sb_features2 & XFS_SB_VERSION2_LAZYSBCOUNTBIT));
} }
#define XFS_SB_VERSION_HASATTR2(sbp) xfs_sb_version_hasattr2(sbp)
static inline int xfs_sb_version_hasattr2(xfs_sb_t *sbp) static inline int xfs_sb_version_hasattr2(xfs_sb_t *sbp)
{ {
return (XFS_SB_VERSION_HASMOREBITS(sbp)) && \ return (xfs_sb_version_hasmorebits(sbp)) && \
((sbp)->sb_features2 & XFS_SB_VERSION2_ATTR2BIT); ((sbp)->sb_features2 & XFS_SB_VERSION2_ATTR2BIT);
} }
#define XFS_SB_VERSION_ADDATTR2(sbp) xfs_sb_version_addattr2(sbp)
static inline void xfs_sb_version_addattr2(xfs_sb_t *sbp) static inline void xfs_sb_version_addattr2(xfs_sb_t *sbp)
{ {
((sbp)->sb_versionnum = \ ((sbp)->sb_versionnum = \
......
...@@ -339,10 +339,10 @@ xfs_bump_ino_vers2( ...@@ -339,10 +339,10 @@ xfs_bump_ino_vers2(
ip->i_d.di_onlink = 0; ip->i_d.di_onlink = 0;
memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad)); memset(&(ip->i_d.di_pad[0]), 0, sizeof(ip->i_d.di_pad));
mp = tp->t_mountp; mp = tp->t_mountp;
if (!XFS_SB_VERSION_HASNLINK(&mp->m_sb)) { if (!xfs_sb_version_hasnlink(&mp->m_sb)) {
spin_lock(&mp->m_sb_lock); spin_lock(&mp->m_sb_lock);
if (!XFS_SB_VERSION_HASNLINK(&mp->m_sb)) { if (!xfs_sb_version_hasnlink(&mp->m_sb)) {
XFS_SB_VERSION_ADDNLINK(&mp->m_sb); xfs_sb_version_addnlink(&mp->m_sb);
spin_unlock(&mp->m_sb_lock); spin_unlock(&mp->m_sb_lock);
xfs_mod_sb(tp, XFS_SB_VERSIONNUM); xfs_mod_sb(tp, XFS_SB_VERSIONNUM);
} else { } else {
......
...@@ -330,7 +330,7 @@ xfs_finish_flags( ...@@ -330,7 +330,7 @@ xfs_finish_flags(
int ronly = (mp->m_flags & XFS_MOUNT_RDONLY); int ronly = (mp->m_flags & XFS_MOUNT_RDONLY);
/* Fail a mount where the logbuf is smaller then the log stripe */ /* Fail a mount where the logbuf is smaller then the log stripe */
if (XFS_SB_VERSION_HASLOGV2(&mp->m_sb)) { if (xfs_sb_version_haslogv2(&mp->m_sb)) {
if ((ap->logbufsize <= 0) && if ((ap->logbufsize <= 0) &&
(mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE)) { (mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE)) {
mp->m_logbsize = mp->m_sb.sb_logsunit; mp->m_logbsize = mp->m_sb.sb_logsunit;
...@@ -349,9 +349,8 @@ xfs_finish_flags( ...@@ -349,9 +349,8 @@ xfs_finish_flags(
} }
} }
if (XFS_SB_VERSION_HASATTR2(&mp->m_sb)) { if (xfs_sb_version_hasattr2(&mp->m_sb))
mp->m_flags |= XFS_MOUNT_ATTR2; mp->m_flags |= XFS_MOUNT_ATTR2;
}
/* /*
* prohibit r/w mounts of read-only filesystems * prohibit r/w mounts of read-only filesystems
...@@ -366,7 +365,7 @@ xfs_finish_flags( ...@@ -366,7 +365,7 @@ xfs_finish_flags(
* check for shared mount. * check for shared mount.
*/ */
if (ap->flags & XFSMNT_SHARED) { if (ap->flags & XFSMNT_SHARED) {
if (!XFS_SB_VERSION_HASSHARED(&mp->m_sb)) if (!xfs_sb_version_hasshared(&mp->m_sb))
return XFS_ERROR(EINVAL); return XFS_ERROR(EINVAL);
/* /*
...@@ -512,7 +511,7 @@ xfs_mount( ...@@ -512,7 +511,7 @@ xfs_mount(
if (!error && logdev && logdev != ddev) { if (!error && logdev && logdev != ddev) {
unsigned int log_sector_size = BBSIZE; unsigned int log_sector_size = BBSIZE;
if (XFS_SB_VERSION_HASSECTOR(&mp->m_sb)) if (xfs_sb_version_hassector(&mp->m_sb))
log_sector_size = mp->m_sb.sb_logsectsize; log_sector_size = mp->m_sb.sb_logsectsize;
error = xfs_setsize_buftarg(mp->m_logdev_targp, error = xfs_setsize_buftarg(mp->m_logdev_targp,
mp->m_sb.sb_blocksize, mp->m_sb.sb_blocksize,
......
...@@ -4132,7 +4132,7 @@ xfs_free_file_space( ...@@ -4132,7 +4132,7 @@ xfs_free_file_space(
* actually need to zero the extent edges. Otherwise xfs_bunmapi * actually need to zero the extent edges. Otherwise xfs_bunmapi
* will take care of it for us. * will take care of it for us.
*/ */
if (rt && !XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb)) { if (rt && !xfs_sb_version_hasextflgbit(&mp->m_sb)) {
nimap = 1; nimap = 1;
error = xfs_bmapi(NULL, ip, startoffset_fsb, error = xfs_bmapi(NULL, ip, startoffset_fsb,
1, 0, NULL, 0, &imap, &nimap, NULL, NULL); 1, 0, NULL, 0, &imap, &nimap, NULL, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment