Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+45 -25
+1 -1
MAINTAINERS
··· 9525 9525 9526 9526 XFS FILESYSTEM 9527 9527 P: Silicon Graphics Inc 9528 + M: Dave Chinner <dchinner@fromorbit.com> 9528 9529 M: Ben Myers <bpm@sgi.com> 9529 - M: Alex Elder <elder@kernel.org> 9530 9530 M: xfs@oss.sgi.com 9531 9531 L: xfs@oss.sgi.com 9532 9532 W: http://oss.sgi.com/projects/xfs
+22 -18
fs/xfs/xfs_bmap.c
··· 1137 1137 int committed; /* xaction was committed */ 1138 1138 int logflags; /* logging flags */ 1139 1139 int error; /* error return value */ 1140 + int cancel_flags = 0; 1140 1141 1141 1142 ASSERT(XFS_IFORK_Q(ip) == 0); 1142 1143 ··· 1148 1147 if (rsvd) 1149 1148 tp->t_flags |= XFS_TRANS_RESERVE; 1150 1149 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_addafork, blks, 0); 1151 - if (error) 1152 - goto error0; 1150 + if (error) { 1151 + xfs_trans_cancel(tp, 0); 1152 + return error; 1153 + } 1154 + cancel_flags = XFS_TRANS_RELEASE_LOG_RES; 1153 1155 xfs_ilock(ip, XFS_ILOCK_EXCL); 1154 1156 error = xfs_trans_reserve_quota_nblks(tp, ip, blks, 0, rsvd ? 1155 1157 XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_FORCE_RES : 1156 1158 XFS_QMOPT_RES_REGBLKS); 1157 - if (error) { 1158 - xfs_iunlock(ip, XFS_ILOCK_EXCL); 1159 - xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES); 1160 - return error; 1161 - } 1159 + if (error) 1160 + goto trans_cancel; 1161 + cancel_flags |= XFS_TRANS_ABORT; 1162 1162 if (XFS_IFORK_Q(ip)) 1163 - goto error1; 1163 + goto trans_cancel; 1164 1164 if (ip->i_d.di_aformat != XFS_DINODE_FMT_EXTENTS) { 1165 1165 /* 1166 1166 * For inodes coming from pre-6.2 filesystems. ··· 1171 1169 } 1172 1170 ASSERT(ip->i_d.di_anextents == 0); 1173 1171 1174 - xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); 1172 + xfs_trans_ijoin(tp, ip, 0); 1175 1173 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); 1176 1174 1177 1175 switch (ip->i_d.di_format) { ··· 1193 1191 default: 1194 1192 ASSERT(0); 1195 1193 error = XFS_ERROR(EINVAL); 1196 - goto error1; 1194 + goto trans_cancel; 1197 1195 } 1198 1196 1199 1197 ASSERT(ip->i_afp == NULL); ··· 1221 1219 if (logflags) 1222 1220 xfs_trans_log_inode(tp, ip, logflags); 1223 1221 if (error) 1224 - goto error2; 1222 + goto bmap_cancel; 1225 1223 if (!xfs_sb_version_hasattr(&mp->m_sb) || 1226 1224 (!xfs_sb_version_hasattr2(&mp->m_sb) && version == 2)) { 1227 1225 __int64_t sbfields = 0; ··· 1244 1242 1245 1243 error = xfs_bmap_finish(&tp, &flist, &committed); 1246 1244 if (error) 1247 - goto error2; 1248 - return xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); 1249 - error2: 1250 - xfs_bmap_cancel(&flist); 1251 - error1: 1245 + goto bmap_cancel; 1246 + error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); 1252 1247 xfs_iunlock(ip, XFS_ILOCK_EXCL); 1253 - error0: 1254 - xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT); 1248 + return error; 1249 + 1250 + bmap_cancel: 1251 + xfs_bmap_cancel(&flist); 1252 + trans_cancel: 1253 + xfs_trans_cancel(tp, cancel_flags); 1254 + xfs_iunlock(ip, XFS_ILOCK_EXCL); 1255 1255 return error; 1256 1256 } 1257 1257
+15
fs/xfs/xfs_mount.c
··· 41 41 #include "xfs_fsops.h" 42 42 #include "xfs_trace.h" 43 43 #include "xfs_icache.h" 44 + #include "xfs_dinode.h" 44 45 45 46 46 47 #ifdef HAVE_PERCPU_SB ··· 719 718 * Set the inode cluster size. 720 719 * This may still be overridden by the file system 721 720 * block size if it is larger than the chosen cluster size. 721 + * 722 + * For v5 filesystems, scale the cluster size with the inode size to 723 + * keep a constant ratio of inode per cluster buffer, but only if mkfs 724 + * has set the inode alignment value appropriately for larger cluster 725 + * sizes. 722 726 */ 723 727 mp->m_inode_cluster_size = XFS_INODE_BIG_CLUSTER_SIZE; 728 + if (xfs_sb_version_hascrc(&mp->m_sb)) { 729 + int new_size = mp->m_inode_cluster_size; 730 + 731 + new_size *= mp->m_sb.sb_inodesize / XFS_DINODE_MIN_SIZE; 732 + if (mp->m_sb.sb_inoalignmt >= XFS_B_TO_FSBT(mp, new_size)) 733 + mp->m_inode_cluster_size = new_size; 734 + xfs_info(mp, "Using inode cluster size of %d bytes", 735 + mp->m_inode_cluster_size); 736 + } 724 737 725 738 /* 726 739 * Set inode alignment fields
+1 -1
fs/xfs/xfs_mount.h
··· 112 112 __uint8_t m_blkbb_log; /* blocklog - BBSHIFT */ 113 113 __uint8_t m_agno_log; /* log #ag's */ 114 114 __uint8_t m_agino_log; /* #bits for agino in inum */ 115 - __uint16_t m_inode_cluster_size;/* min inode buf size */ 115 + uint m_inode_cluster_size;/* min inode buf size */ 116 116 uint m_blockmask; /* sb_blocksize-1 */ 117 117 uint m_blockwsize; /* sb_blocksize in words */ 118 118 uint m_blockwmask; /* blockwsize-1 */
+5 -3
fs/xfs/xfs_trans_inode.c
··· 111 111 112 112 /* 113 113 * First time we log the inode in a transaction, bump the inode change 114 - * counter if it is configured for this to occur. 114 + * counter if it is configured for this to occur. We don't use 115 + * inode_inc_version() because there is no need for extra locking around 116 + * i_version as we already hold the inode locked exclusively for 117 + * metadata modification. 115 118 */ 116 119 if (!(ip->i_itemp->ili_item.li_desc->lid_flags & XFS_LID_DIRTY) && 117 120 IS_I_VERSION(VFS_I(ip))) { 118 - inode_inc_iversion(VFS_I(ip)); 119 - ip->i_d.di_changecount = VFS_I(ip)->i_version; 121 + ip->i_d.di_changecount = ++VFS_I(ip)->i_version; 120 122 flags |= XFS_ILOG_CORE; 121 123 } 122 124
+1 -2
fs/xfs/xfs_trans_resv.c
··· 385 385 xfs_calc_inode_res(mp, 1) + 386 386 xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) + 387 387 xfs_calc_buf_res(1, XFS_FSB_TO_B(mp, 1)) + 388 - MAX((__uint16_t)XFS_FSB_TO_B(mp, 1), 389 - XFS_INODE_CLUSTER_SIZE(mp)) + 388 + max_t(uint, XFS_FSB_TO_B(mp, 1), XFS_INODE_CLUSTER_SIZE(mp)) + 390 389 xfs_calc_buf_res(1, 0) + 391 390 xfs_calc_buf_res(2 + XFS_IALLOC_BLOCKS(mp) + 392 391 mp->m_in_maxlevels, 0) +