Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa2925cf authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

* 'for-linus' of git://oss.sgi.com/xfs/xfs:
  xfs: Make fiemap work with sparse files
  xfs: prevent 32bit overflow in space reservation
  xfs: Disallow 32bit project quota id
  xfs: improve buffer cache hash scalability
parents 98e52c37 cb7a9341
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -440,12 +440,7 @@ _xfs_buf_find(
		ASSERT(btp == bp->b_target);
		if (bp->b_file_offset == range_base &&
		    bp->b_buffer_length == range_length) {
			/*
			 * If we look at something, bring it to the
			 * front of the list for next time.
			 */
			atomic_inc(&bp->b_hold);
			list_move(&bp->b_hash_list, &hash->bh_list);
			goto found;
		}
	}
@@ -1443,8 +1438,7 @@ xfs_alloc_bufhash(
{
	unsigned int		i;

	btp->bt_hashshift = external ? 3 : 8;	/* 8 or 256 buckets */
	btp->bt_hashmask = (1 << btp->bt_hashshift) - 1;
	btp->bt_hashshift = external ? 3 : 12;	/* 8 or 4096 buckets */
	btp->bt_hash = kmem_zalloc_large((1 << btp->bt_hashshift) *
					 sizeof(xfs_bufhash_t));
	for (i = 0; i < (1 << btp->bt_hashshift); i++) {
+0 −1
Original line number Diff line number Diff line
@@ -137,7 +137,6 @@ typedef struct xfs_buftarg {
	size_t			bt_smask;

	/* per device buffer hash table */
	uint			bt_hashmask;
	uint			bt_hashshift;
	xfs_bufhash_t		*bt_hash;

+7 −0
Original line number Diff line number Diff line
@@ -906,6 +906,13 @@ xfs_ioctl_setattr(
	if (XFS_FORCED_SHUTDOWN(mp))
		return XFS_ERROR(EIO);

	/*
	 * Disallow 32bit project ids because on-disk structure
	 * is 16bit only.
	 */
	if ((mask & FSX_PROJID) && (fa->fsx_projid > (__uint16_t)-1))
		return XFS_ERROR(EINVAL);

	/*
	 * If disk quotas is on, we make sure that the dquots do exist on disk,
	 * before we start any other transactions. Trying to do this later
+1 −1
Original line number Diff line number Diff line
@@ -664,7 +664,7 @@ xfs_vn_fiemap(
					fieinfo->fi_extents_max + 1;
	bm.bmv_count = min_t(__s32, bm.bmv_count,
			     (PAGE_SIZE * 16 / sizeof(struct getbmapx)));
	bm.bmv_iflags = BMV_IF_PREALLOC;
	bm.bmv_iflags = BMV_IF_PREALLOC | BMV_IF_NO_HOLES;
	if (fieinfo->fi_flags & FIEMAP_FLAG_XATTR)
		bm.bmv_iflags |= BMV_IF_ATTRFORK;
	if (!(fieinfo->fi_flags & FIEMAP_FLAG_SYNC))
+13 −1
Original line number Diff line number Diff line
@@ -5533,12 +5533,24 @@ xfs_getbmap(
					map[i].br_startblock))
				goto out_free_map;

			nexleft--;
			bmv->bmv_offset =
				out[cur_ext].bmv_offset +
				out[cur_ext].bmv_length;
			bmv->bmv_length =
				max_t(__int64_t, 0, bmvend - bmv->bmv_offset);

			/*
			 * In case we don't want to return the hole,
			 * don't increase cur_ext so that we can reuse
			 * it in the next loop.
			 */
			if ((iflags & BMV_IF_NO_HOLES) &&
			    map[i].br_startblock == HOLESTARTBLOCK) {
				memset(&out[cur_ext], 0, sizeof(out[cur_ext]));
				continue;
			}

			nexleft--;
			bmv->bmv_entries++;
			cur_ext++;
		}
Loading