Here we have a performance fix for inode iversion, increased inode cluster size
 for v5 superblock filesystems, a fix for error handling in
 xfs_bmap_add_attrfork, and a MAINTAINERS update to add Dave.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (GNU/Linux)
 
 iQIcBAABAgAGBQJSjjbHAAoJENaLyazVq6ZO/l4QAIajqdOy56MDDCaE1ocNRMej
 oPXqxMZpi+YAFRXIWQK/evjXjYE4hcCjiLI0tAKzQM0FGRHd1GgQQJvWKjvHBrLG
 rlrHWDcKq+3bsJ6KIw+JvLnhsOxxKXbRovIG1PI4frOeFtS3DCtzMZ4FGBErh+BV
 PkFjf5Lxe7VnegDL4eNpkAfSM/2/pEtn2gIMMj8eeKemTPAbDplMAk4UUxp18R7F
 FCr6mOKETWthHdBgkLB1xA6OVGUuYcleWvluFc5PONJN1VPSutEHJaRw01lY1VLY
 4COUt7MjLAqlAu24LTD1aNszhUlajYq0AL+nmd4gULZI2fpu+meUIGCHQG4BpVZl
 ds9isn80SmKiLT4ZQCbJAv4XMEXn6p41+uxdKP6ZkYXso4zJmVw0TyGLg/ZOJpw0
 9mNcaJG1s57ronN07dMCSMqsyNFLuLtX7+mVa5liO3sEkXv7hEK7EB9qojQ9Qn/p
 xC2r4jrE0//xgcbOE+uKOyIad3L0IBM6TXuy58xVPi5l0dpM69z4LCyUGZ+L1G8x
 0QhkA7NL3xI2tNgehzJBsBuxjtEePtm/jCIS1HfDSIRQZR3y+PxVEjgO4naS4vm2
 xKwo5dBodsxgXeSMUY3miMuEX7ZQse+xVDK1q0Zk4VXZyC2+erNS5hxs313yzeLD
 7X2ZESfIJaMrkLSKOVUe
 =w0M3
 -----END PGP SIGNATURE-----

Merge tag 'xfs-for-linus-v3.13-rc1-2' of git://oss.sgi.com/xfs/xfs

Pull second xfs update from Ben Myers:
 "There are a couple of patches that I wasn't quite sure about in time
  for our initial 3.13 pull request, a bugfix, and an update to add Dave
  to MAINTAINERS:

  Here we have a performance fix for inode iversion, increased inode
  cluster size for v5 superblock filesystems, a fix for error handling
  in xfs_bmap_add_attrfork, and a MAINTAINERS update to add Dave"

* tag 'xfs-for-linus-v3.13-rc1-2' of git://oss.sgi.com/xfs/xfs:
  xfs: open code inc_inode_iversion when logging an inode
  xfs: increase inode cluster size for v5 filesystems
  xfs: fix unlock in xfs_bmap_add_attrfork
  xfs: update maintainers
This commit is contained in:
Linus Torvalds 2013-11-22 08:37:47 -08:00
Родитель 24f971abbd 2fe8c1c08b
Коммит 6ea9786e76
6 изменённых файлов: 45 добавлений и 25 удалений

Просмотреть файл

@ -9525,8 +9525,8 @@ F: drivers/xen/*swiotlb*
XFS FILESYSTEM XFS FILESYSTEM
P: Silicon Graphics Inc P: Silicon Graphics Inc
M: Dave Chinner <dchinner@fromorbit.com>
M: Ben Myers <bpm@sgi.com> M: Ben Myers <bpm@sgi.com>
M: Alex Elder <elder@kernel.org>
M: xfs@oss.sgi.com M: xfs@oss.sgi.com
L: xfs@oss.sgi.com L: xfs@oss.sgi.com
W: http://oss.sgi.com/projects/xfs W: http://oss.sgi.com/projects/xfs

Просмотреть файл

@ -1137,6 +1137,7 @@ xfs_bmap_add_attrfork(
int committed; /* xaction was committed */ int committed; /* xaction was committed */
int logflags; /* logging flags */ int logflags; /* logging flags */
int error; /* error return value */ int error; /* error return value */
int cancel_flags = 0;
ASSERT(XFS_IFORK_Q(ip) == 0); ASSERT(XFS_IFORK_Q(ip) == 0);
@ -1147,19 +1148,20 @@ xfs_bmap_add_attrfork(
if (rsvd) if (rsvd)
tp->t_flags |= XFS_TRANS_RESERVE; tp->t_flags |= XFS_TRANS_RESERVE;
error = xfs_trans_reserve(tp, &M_RES(mp)->tr_addafork, blks, 0); error = xfs_trans_reserve(tp, &M_RES(mp)->tr_addafork, blks, 0);
if (error) if (error) {
goto error0; xfs_trans_cancel(tp, 0);
return error;
}
cancel_flags = XFS_TRANS_RELEASE_LOG_RES;
xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_ilock(ip, XFS_ILOCK_EXCL);
error = xfs_trans_reserve_quota_nblks(tp, ip, blks, 0, rsvd ? error = xfs_trans_reserve_quota_nblks(tp, ip, blks, 0, rsvd ?
XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_FORCE_RES : XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_FORCE_RES :
XFS_QMOPT_RES_REGBLKS); XFS_QMOPT_RES_REGBLKS);
if (error) { if (error)
xfs_iunlock(ip, XFS_ILOCK_EXCL); goto trans_cancel;
xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES); cancel_flags |= XFS_TRANS_ABORT;
return error;
}
if (XFS_IFORK_Q(ip)) if (XFS_IFORK_Q(ip))
goto error1; goto trans_cancel;
if (ip->i_d.di_aformat != XFS_DINODE_FMT_EXTENTS) { if (ip->i_d.di_aformat != XFS_DINODE_FMT_EXTENTS) {
/* /*
* For inodes coming from pre-6.2 filesystems. * For inodes coming from pre-6.2 filesystems.
@ -1169,7 +1171,7 @@ xfs_bmap_add_attrfork(
} }
ASSERT(ip->i_d.di_anextents == 0); ASSERT(ip->i_d.di_anextents == 0);
xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); xfs_trans_ijoin(tp, ip, 0);
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
switch (ip->i_d.di_format) { switch (ip->i_d.di_format) {
@ -1191,7 +1193,7 @@ xfs_bmap_add_attrfork(
default: default:
ASSERT(0); ASSERT(0);
error = XFS_ERROR(EINVAL); error = XFS_ERROR(EINVAL);
goto error1; goto trans_cancel;
} }
ASSERT(ip->i_afp == NULL); ASSERT(ip->i_afp == NULL);
@ -1219,7 +1221,7 @@ xfs_bmap_add_attrfork(
if (logflags) if (logflags)
xfs_trans_log_inode(tp, ip, logflags); xfs_trans_log_inode(tp, ip, logflags);
if (error) if (error)
goto error2; goto bmap_cancel;
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;
@ -1242,14 +1244,16 @@ xfs_bmap_add_attrfork(
error = xfs_bmap_finish(&tp, &flist, &committed); error = xfs_bmap_finish(&tp, &flist, &committed);
if (error) if (error)
goto error2; goto bmap_cancel;
return xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES);
error2: xfs_iunlock(ip, XFS_ILOCK_EXCL);
xfs_bmap_cancel(&flist); return error;
error1:
bmap_cancel:
xfs_bmap_cancel(&flist);
trans_cancel:
xfs_trans_cancel(tp, cancel_flags);
xfs_iunlock(ip, XFS_ILOCK_EXCL); xfs_iunlock(ip, XFS_ILOCK_EXCL);
error0:
xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT);
return error; return error;
} }

Просмотреть файл

@ -41,6 +41,7 @@
#include "xfs_fsops.h" #include "xfs_fsops.h"
#include "xfs_trace.h" #include "xfs_trace.h"
#include "xfs_icache.h" #include "xfs_icache.h"
#include "xfs_dinode.h"
#ifdef HAVE_PERCPU_SB #ifdef HAVE_PERCPU_SB
@ -718,8 +719,22 @@ xfs_mountfs(
* Set the inode cluster size. * Set the inode cluster size.
* This may still be overridden by the file system * This may still be overridden by the file system
* block size if it is larger than the chosen cluster size. * block size if it is larger than the chosen cluster size.
*
* For v5 filesystems, scale the cluster size with the inode size to
* keep a constant ratio of inode per cluster buffer, but only if mkfs
* has set the inode alignment value appropriately for larger cluster
* sizes.
*/ */
mp->m_inode_cluster_size = XFS_INODE_BIG_CLUSTER_SIZE; mp->m_inode_cluster_size = XFS_INODE_BIG_CLUSTER_SIZE;
if (xfs_sb_version_hascrc(&mp->m_sb)) {
int new_size = mp->m_inode_cluster_size;
new_size *= mp->m_sb.sb_inodesize / XFS_DINODE_MIN_SIZE;
if (mp->m_sb.sb_inoalignmt >= XFS_B_TO_FSBT(mp, new_size))
mp->m_inode_cluster_size = new_size;
xfs_info(mp, "Using inode cluster size of %d bytes",
mp->m_inode_cluster_size);
}
/* /*
* Set inode alignment fields * Set inode alignment fields

Просмотреть файл

@ -112,7 +112,7 @@ typedef struct xfs_mount {
__uint8_t m_blkbb_log; /* blocklog - BBSHIFT */ __uint8_t m_blkbb_log; /* blocklog - BBSHIFT */
__uint8_t m_agno_log; /* log #ag's */ __uint8_t m_agno_log; /* log #ag's */
__uint8_t m_agino_log; /* #bits for agino in inum */ __uint8_t m_agino_log; /* #bits for agino in inum */
__uint16_t m_inode_cluster_size;/* min inode buf size */ uint m_inode_cluster_size;/* min inode buf size */
uint m_blockmask; /* sb_blocksize-1 */ uint m_blockmask; /* sb_blocksize-1 */
uint m_blockwsize; /* sb_blocksize in words */ uint m_blockwsize; /* sb_blocksize in words */
uint m_blockwmask; /* blockwsize-1 */ uint m_blockwmask; /* blockwsize-1 */

Просмотреть файл

@ -111,12 +111,14 @@ xfs_trans_log_inode(
/* /*
* First time we log the inode in a transaction, bump the inode change * First time we log the inode in a transaction, bump the inode change
* counter if it is configured for this to occur. * counter if it is configured for this to occur. We don't use
* inode_inc_version() because there is no need for extra locking around
* i_version as we already hold the inode locked exclusively for
* metadata modification.
*/ */
if (!(ip->i_itemp->ili_item.li_desc->lid_flags & XFS_LID_DIRTY) && if (!(ip->i_itemp->ili_item.li_desc->lid_flags & XFS_LID_DIRTY) &&
IS_I_VERSION(VFS_I(ip))) { IS_I_VERSION(VFS_I(ip))) {
inode_inc_iversion(VFS_I(ip)); ip->i_d.di_changecount = ++VFS_I(ip)->i_version;
ip->i_d.di_changecount = VFS_I(ip)->i_version;
flags |= XFS_ILOG_CORE; flags |= XFS_ILOG_CORE;
} }

Просмотреть файл

@ -385,8 +385,7 @@ xfs_calc_ifree_reservation(
xfs_calc_inode_res(mp, 1) + xfs_calc_inode_res(mp, 1) +
xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) + xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) +
xfs_calc_buf_res(1, XFS_FSB_TO_B(mp, 1)) + xfs_calc_buf_res(1, XFS_FSB_TO_B(mp, 1)) +
MAX((__uint16_t)XFS_FSB_TO_B(mp, 1), max_t(uint, XFS_FSB_TO_B(mp, 1), XFS_INODE_CLUSTER_SIZE(mp)) +
XFS_INODE_CLUSTER_SIZE(mp)) +
xfs_calc_buf_res(1, 0) + xfs_calc_buf_res(1, 0) +
xfs_calc_buf_res(2 + XFS_IALLOC_BLOCKS(mp) + xfs_calc_buf_res(2 + XFS_IALLOC_BLOCKS(mp) +
mp->m_in_maxlevels, 0) + mp->m_in_maxlevels, 0) +