Commit 47a43f2f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'xfs-4.21-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull XFS updates from Darrick Wong:

 - Fix CoW remapping of extremely fragmented file areas

 - Fix a zero-length symlink verifier error

 - Constify some of the rmap owner structures for per-AG metadata

 - Precalculate inode geometry for later use

 - Fix scrub counting problems

 - Don't crash when rtsummary inode is null

 - Fix x32 ioctl operation

 - Fix enum->string mappings for ftrace output

 - Cache realtime summary information in memory

* tag 'xfs-4.21-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (24 commits)
  xfs: reallocate realtime summary cache on growfs
  xfs: stringify scrub types in ftrace output
  xfs: stringify btree cursor types in ftrace output
  xfs: move XFS_INODE_FORMAT_STR mappings to libxfs
  xfs: move XFS_AG_BTREE_CMP_FORMAT_STR mappings to libxfs
  xfs: fix symbolic enum printing in ftrace output
  xfs: fix function pointer type in ftrace format
  xfs: Fix x32 ioctls when cmd numbers differ from ia32.
  xfs: Fix bulkstat compat ioctls on x32 userspace.
  xfs: Align compat attrlist_by_handle with native implementation.
  xfs: require both realtime inodes to mount
  xfs: cache minimum realtime summary level
  xfs: count inode blocks correctly in inobt scrub
  xfs: precalculate cluster alignment in inodes and blocks
  xfs: precalculate inodes and blocks per inode cluster
  xfs: add a block to inode count converter
  xfs: remove xfs_rmap_ag_owner and friends
  xfs: const-ify xfs_owner_info arguments
  xfs: streamline defer op type handling
  xfs: idiotproof defer op type configuration
  ...
parents e01799ac 65eed012
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -414,7 +414,6 @@ xfs_ag_extend_space(
	struct aghdr_init_data	*id,
	xfs_extlen_t		len)
{
	struct xfs_owner_info	oinfo;
	struct xfs_buf		*bp;
	struct xfs_agi		*agi;
	struct xfs_agf		*agf;
@@ -448,17 +447,17 @@ xfs_ag_extend_space(
	/*
	 * Free the new space.
	 *
	 * XFS_RMAP_OWN_NULL is used here to tell the rmap btree that
	 * XFS_RMAP_OINFO_SKIP_UPDATE is used here to tell the rmap btree that
	 * this doesn't actually exist in the rmap btree.
	 */
	xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_NULL);
	error = xfs_rmap_free(tp, bp, id->agno,
				be32_to_cpu(agf->agf_length) - len,
				len, &oinfo);
				len, &XFS_RMAP_OINFO_SKIP_UPDATE);
	if (error)
		return error;

	return  xfs_free_extent(tp, XFS_AGB_TO_FSB(mp, id->agno,
					be32_to_cpu(agf->agf_length) - len),
				len, &oinfo, XFS_AG_RESV_NONE);
				len, &XFS_RMAP_OINFO_SKIP_UPDATE,
				XFS_AG_RESV_NONE);
}
+39 −40
Original line number Diff line number Diff line
@@ -1594,7 +1594,6 @@ xfs_alloc_ag_vextent_small(
	xfs_extlen_t	*flenp,	/* result length */
	int		*stat)	/* status: 0-freelist, 1-normal/none */
{
	struct xfs_owner_info	oinfo;
	int		error;
	xfs_agblock_t	fbno;
	xfs_extlen_t	flen;
@@ -1648,9 +1647,8 @@ xfs_alloc_ag_vextent_small(
			 * doesn't live in the free space, we need to clear
			 * out the OWN_AG rmap.
			 */
			xfs_rmap_ag_owner(&oinfo, XFS_RMAP_OWN_AG);
			error = xfs_rmap_free(args->tp, args->agbp, args->agno,
					fbno, 1, &oinfo);
					fbno, 1, &XFS_RMAP_OINFO_AG);
			if (error)
				goto error0;

@@ -1694,28 +1692,28 @@ error0:
 */
STATIC int
xfs_free_ag_extent(
	xfs_trans_t		*tp,
	xfs_buf_t		*agbp,
	struct xfs_trans		*tp,
	struct xfs_buf			*agbp,
	xfs_agnumber_t			agno,
	xfs_agblock_t			bno,
	xfs_extlen_t			len,
	struct xfs_owner_info	*oinfo,
	const struct xfs_owner_info	*oinfo,
	enum xfs_ag_resv_type		type)
{
	xfs_btree_cur_t	*bno_cur;	/* cursor for by-block btree */
	xfs_btree_cur_t	*cnt_cur;	/* cursor for by-size btree */
	int		error;		/* error return value */
	xfs_agblock_t	gtbno;		/* start of right neighbor block */
	xfs_extlen_t	gtlen;		/* length of right neighbor block */
	int		haveleft;	/* have a left neighbor block */
	int		haveright;	/* have a right neighbor block */
	int		i;		/* temp, result code */
	xfs_agblock_t	ltbno;		/* start of left neighbor block */
	xfs_extlen_t	ltlen;		/* length of left neighbor block */
	xfs_mount_t	*mp;		/* mount point struct for filesystem */
	xfs_agblock_t	nbno;		/* new starting block of freespace */
	struct xfs_mount		*mp;
	struct xfs_perag		*pag;
	struct xfs_btree_cur		*bno_cur;
	struct xfs_btree_cur		*cnt_cur;
	xfs_agblock_t			gtbno; /* start of right neighbor */
	xfs_extlen_t			gtlen; /* length of right neighbor */
	xfs_agblock_t			ltbno; /* start of left neighbor */
	xfs_extlen_t			ltlen; /* length of left neighbor */
	xfs_agblock_t			nbno; /* new starting block of freesp */
	xfs_extlen_t			nlen; /* new length of freespace */
	xfs_perag_t	*pag;		/* per allocation group data */
	int				haveleft; /* have a left neighbor */
	int				haveright; /* have a right neighbor */
	int				i;
	int				error;

	bno_cur = cnt_cur = NULL;
	mp = tp->t_mountp;
@@ -2314,10 +2312,11 @@ xfs_alloc_fix_freelist(
	 * repair/rmap.c in xfsprogs for details.
	 */
	memset(&targs, 0, sizeof(targs));
	/* struct copy below */
	if (flags & XFS_ALLOC_FLAG_NORMAP)
		xfs_rmap_skip_owner_update(&targs.oinfo);
		targs.oinfo = XFS_RMAP_OINFO_SKIP_UPDATE;
	else
		xfs_rmap_ag_owner(&targs.oinfo, XFS_RMAP_OWN_AG);
		targs.oinfo = XFS_RMAP_OINFO_AG;
	while (!(flags & XFS_ALLOC_FLAG_NOSHRINK) && pag->pagf_flcount > need) {
		error = xfs_alloc_get_freelist(tp, agbp, &bno, 0);
		if (error)
@@ -2435,7 +2434,6 @@ xfs_alloc_get_freelist(
	be32_add_cpu(&agf->agf_flcount, -1);
	xfs_trans_agflist_delta(tp, -1);
	pag->pagf_flcount--;
	xfs_perag_put(pag);

	logflags = XFS_AGF_FLFIRST | XFS_AGF_FLCOUNT;
	if (btreeblk) {
@@ -2443,6 +2441,7 @@ xfs_alloc_get_freelist(
		pag->pagf_btreeblks++;
		logflags |= XFS_AGF_BTREEBLKS;
	}
	xfs_perag_put(pag);

	xfs_alloc_log_agf(tp, agbp, logflags);
	*bnop = bno;
@@ -3008,13 +3007,13 @@ out:
 * Just break up the extent address and hand off to xfs_free_ag_extent
 * after fixing up the freelist.
 */
int				/* error */
int
__xfs_free_extent(
	struct xfs_trans	*tp,	/* transaction pointer */
	xfs_fsblock_t		bno,	/* starting block number of extent */
	xfs_extlen_t		len,	/* length of extent */
	struct xfs_owner_info	*oinfo,	/* extent owner */
	enum xfs_ag_resv_type	type,	/* block reservation type */
	struct xfs_trans		*tp,
	xfs_fsblock_t			bno,
	xfs_extlen_t			len,
	const struct xfs_owner_info	*oinfo,
	enum xfs_ag_resv_type		type,
	bool				skip_discard)
{
	struct xfs_mount		*mp = tp->t_mountp;
+2 −2
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ __xfs_free_extent(
	struct xfs_trans	*tp,	/* transaction pointer */
	xfs_fsblock_t		bno,	/* starting block number of extent */
	xfs_extlen_t		len,	/* length of extent */
	struct xfs_owner_info	*oinfo,	/* extent owner */
	const struct xfs_owner_info	*oinfo,	/* extent owner */
	enum xfs_ag_resv_type	type,	/* block reservation type */
	bool			skip_discard);

@@ -191,7 +191,7 @@ xfs_free_extent(
	struct xfs_trans	*tp,
	xfs_fsblock_t		bno,
	xfs_extlen_t		len,
	struct xfs_owner_info	*oinfo,
	const struct xfs_owner_info	*oinfo,
	enum xfs_ag_resv_type	type)
{
	return __xfs_free_extent(tp, bno, len, oinfo, type, false);
+3 −3
Original line number Diff line number Diff line
@@ -536,7 +536,7 @@ __xfs_bmap_add_free(
	struct xfs_trans		*tp,
	xfs_fsblock_t			bno,
	xfs_filblks_t			len,
	struct xfs_owner_info		*oinfo,
	const struct xfs_owner_info	*oinfo,
	bool				skip_discard)
{
	struct xfs_extent_free_item	*new;		/* new element */
@@ -564,7 +564,7 @@ __xfs_bmap_add_free(
	if (oinfo)
		new->xefi_oinfo = *oinfo;
	else
		xfs_rmap_skip_owner_update(&new->xefi_oinfo);
		new->xefi_oinfo = XFS_RMAP_OINFO_SKIP_UPDATE;
	new->xefi_skip_discard = skip_discard;
	trace_xfs_bmap_free_defer(tp->t_mountp,
			XFS_FSB_TO_AGNO(tp->t_mountp, bno), 0,
@@ -3453,7 +3453,7 @@ xfs_bmap_btalloc(
	args.tp = ap->tp;
	args.mp = mp;
	args.fsbno = ap->blkno;
	xfs_rmap_skip_owner_update(&args.oinfo);
	args.oinfo = XFS_RMAP_OINFO_SKIP_UPDATE;

	/* Trim the allocation back to the maximum an AG can fit. */
	args.maxlen = min(ap->length, mp->m_ag_max_usable);
+2 −2
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ int xfs_bmap_add_attrfork(struct xfs_inode *ip, int size, int rsvd);
int	xfs_bmap_set_attrforkoff(struct xfs_inode *ip, int size, int *version);
void	xfs_bmap_local_to_extents_empty(struct xfs_inode *ip, int whichfork);
void	__xfs_bmap_add_free(struct xfs_trans *tp, xfs_fsblock_t bno,
		xfs_filblks_t len, struct xfs_owner_info *oinfo,
		xfs_filblks_t len, const struct xfs_owner_info *oinfo,
		bool skip_discard);
void	xfs_bmap_compute_maxlevels(struct xfs_mount *mp, int whichfork);
int	xfs_bmap_first_unused(struct xfs_trans *tp, struct xfs_inode *ip,
@@ -234,7 +234,7 @@ xfs_bmap_add_free(
	struct xfs_trans		*tp,
	xfs_fsblock_t			bno,
	xfs_filblks_t			len,
	struct xfs_owner_info		*oinfo)
	const struct xfs_owner_info	*oinfo)
{
	__xfs_bmap_add_free(tp, bno, len, oinfo, false);
}
Loading