···440 ASSERT(btp == bp->b_target);441 if (bp->b_file_offset == range_base &&442 bp->b_buffer_length == range_length) {443- /*444- * If we look at something, bring it to the445- * front of the list for next time.446- */447 atomic_inc(&bp->b_hold);448- list_move(&bp->b_hash_list, &hash->bh_list);449 goto found;450 }451 }···1438{1439 unsigned int i;14401441- btp->bt_hashshift = external ? 3 : 8; /* 8 or 256 buckets */1442- btp->bt_hashmask = (1 << btp->bt_hashshift) - 1;1443 btp->bt_hash = kmem_zalloc_large((1 << btp->bt_hashshift) *1444 sizeof(xfs_bufhash_t));1445 for (i = 0; i < (1 << btp->bt_hashshift); i++) {
···440 ASSERT(btp == bp->b_target);441 if (bp->b_file_offset == range_base &&442 bp->b_buffer_length == range_length) {0000443 atomic_inc(&bp->b_hold);0444 goto found;445 }446 }···1443{1444 unsigned int i;14451446+ btp->bt_hashshift = external ? 3 : 12; /* 8 or 4096 buckets */01447 btp->bt_hash = kmem_zalloc_large((1 << btp->bt_hashshift) *1448 sizeof(xfs_bufhash_t));1449 for (i = 0; i < (1 << btp->bt_hashshift); i++) {
···2299 e = allocatesize_fsb;2300 }23012302+ /*2303+ * The transaction reservation is limited to a 32-bit block2304+ * count, hence we need to limit the number of blocks we are2305+ * trying to reserve to avoid an overflow. We can't allocate2306+ * more than @nimaps extents, and an extent is limited on disk2307+ * to MAXEXTLEN (21 bits), so use that to enforce the limit.2308+ */2309+ resblks = min_t(xfs_fileoff_t, (e - s), (MAXEXTLEN * nimaps));2310 if (unlikely(rt)) {2311+ resrtextents = qblocks = resblks;2312 resrtextents /= mp->m_sb.sb_rextsize;2313 resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0);2314 quota_flag = XFS_QMOPT_RES_RTBLKS;2315 } else {2316 resrtextents = 0;2317+ resblks = qblocks = XFS_DIOSTRAT_SPACE_RES(mp, resblks);02318 quota_flag = XFS_QMOPT_RES_REGBLKS;2319 }2320