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

Commit 5b03ff1b authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Ben Myers
Browse files

xfs: remove xfs_trans_unlocked_item



There is no reason to wake up log space waiters when unlocking inodes or
dquots, and the commit log has no explanation for this function either.

Given that we now have exact log space wakeups everywhere we can assume
the reason for this function was to paper over log space races in earlier
XFS versions.

Reviewed-by: default avatarMark Tinguely <tinguely@sgi.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarBen Myers <bpm@sgi.com>
parent 3af1de75
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -1076,17 +1076,6 @@ xfs_qm_dqflush(

}

void
xfs_dqunlock(
	xfs_dquot_t *dqp)
{
	xfs_dqunlock_nonotify(dqp);
	if (dqp->q_logitem.qli_dquot == dqp) {
		xfs_trans_unlocked_item(dqp->q_logitem.qli_item.li_ailp,
					&dqp->q_logitem.qli_item);
	}
}

/*
 * Lock two xfs_dquot structures.
 *
+1 −2
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ static inline void xfs_dqlock(struct xfs_dquot *dqp)
	mutex_lock(&dqp->q_qlock);
}

static inline void xfs_dqunlock_nonotify(struct xfs_dquot *dqp)
static inline void xfs_dqunlock(struct xfs_dquot *dqp)
{
	mutex_unlock(&dqp->q_qlock);
}
@@ -166,7 +166,6 @@ extern int xfs_qm_dqget(xfs_mount_t *, xfs_inode_t *,
extern void		xfs_qm_dqput(xfs_dquot_t *);

extern void		xfs_dqlock2(struct xfs_dquot *, struct xfs_dquot *);
extern void		xfs_dqunlock(struct xfs_dquot *);
extern void		xfs_dqflock_pushbuf_wait(struct xfs_dquot *dqp);

static inline struct xfs_dquot *xfs_qm_dqhold(struct xfs_dquot *dqp)
+1 −12
Original line number Diff line number Diff line
@@ -642,8 +642,7 @@ xfs_iunlock(
	       (XFS_IOLOCK_SHARED | XFS_IOLOCK_EXCL));
	ASSERT((lock_flags & (XFS_ILOCK_SHARED | XFS_ILOCK_EXCL)) !=
	       (XFS_ILOCK_SHARED | XFS_ILOCK_EXCL));
	ASSERT((lock_flags & ~(XFS_LOCK_MASK | XFS_IUNLOCK_NONOTIFY |
			XFS_LOCK_DEP_MASK)) == 0);
	ASSERT((lock_flags & ~(XFS_LOCK_MASK | XFS_LOCK_DEP_MASK)) == 0);
	ASSERT(lock_flags != 0);

	if (lock_flags & XFS_IOLOCK_EXCL)
@@ -656,16 +655,6 @@ xfs_iunlock(
	else if (lock_flags & XFS_ILOCK_SHARED)
		mrunlock_shared(&ip->i_lock);

	if ((lock_flags & (XFS_ILOCK_SHARED | XFS_ILOCK_EXCL)) &&
	    !(lock_flags & XFS_IUNLOCK_NONOTIFY) && ip->i_itemp) {
		/*
		 * Let the AIL know that this item has been unlocked in case
		 * it is in the AIL and anyone is waiting on it.  Don't do
		 * this if the caller has asked us not to.
		 */
		xfs_trans_unlocked_item(ip->i_itemp->ili_item.li_ailp,
					(xfs_log_item_t*)(ip->i_itemp));
	}
	trace_xfs_iunlock(ip, lock_flags, _RET_IP_);
}

+1 −3
Original line number Diff line number Diff line
@@ -422,7 +422,6 @@ static inline int xfs_isiflocked(struct xfs_inode *ip)
#define	XFS_IOLOCK_SHARED	(1<<1)
#define	XFS_ILOCK_EXCL		(1<<2)
#define	XFS_ILOCK_SHARED	(1<<3)
#define	XFS_IUNLOCK_NONOTIFY	(1<<4)

#define XFS_LOCK_MASK		(XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED \
				| XFS_ILOCK_EXCL | XFS_ILOCK_SHARED)
@@ -431,8 +430,7 @@ static inline int xfs_isiflocked(struct xfs_inode *ip)
	{ XFS_IOLOCK_EXCL,	"IOLOCK_EXCL" }, \
	{ XFS_IOLOCK_SHARED,	"IOLOCK_SHARED" }, \
	{ XFS_ILOCK_EXCL,	"ILOCK_EXCL" }, \
	{ XFS_ILOCK_SHARED,	"ILOCK_SHARED" }, \
	{ XFS_IUNLOCK_NONOTIFY,	"IUNLOCK_NONOTIFY" }
	{ XFS_ILOCK_SHARED,	"ILOCK_SHARED" }


/*
+1 −5
Original line number Diff line number Diff line
@@ -596,11 +596,7 @@ xfs_inode_item_trylock(
	/* Stale items should force out the iclog */
	if (ip->i_flags & XFS_ISTALE) {
		xfs_ifunlock(ip);
		/*
		 * we hold the AIL lock - notify the unlock routine of this
		 * so it doesn't try to get the lock again.
		 */
		xfs_iunlock(ip, XFS_ILOCK_SHARED|XFS_IUNLOCK_NONOTIFY);
		xfs_iunlock(ip, XFS_ILOCK_SHARED);
		return XFS_ITEM_PINNED;
	}

Loading