public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Cc: XFS Mailing List <xfs@oss.sgi.com>
Subject: Re: [PATCH] XFS: random cleanups of xfs_swap_extents
Date: Wed, 12 Nov 2008 05:09:58 -0500	[thread overview]
Message-ID: <20081112100958.GB32567@infradead.org> (raw)
In-Reply-To: <20081107230054.GH26208@josefsipek.net>

On Fri, Nov 07, 2008 at 06:00:54PM -0500, Josef 'Jeff' Sipek wrote:
> XFS: random cleanups of xfs_swap_extents
> 
> From: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
> 
> 1) remove lock_flags var since it's never modified and only obfuscates the
> code
> 
> 2) calling kfree/vfree on a NULL is valid

Looks good to me, but I'd go even further and kill the stupid locked
variable by having the exit path structured as:

 out_trans_cancel:
	xfs_trans_cancel(tp, 0);
 out_unlock:
	xfs_iunlock(ip,  XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
	xfs_iunlock(tip, XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL);
 out_free:
	kmem_free(tempifp);
 out:
	return error;
}

With the one case that does a trans_cancel with partially unlocked
inodes handcoding most of it.

  reply	other threads:[~2008-11-12 10:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-07 23:00 [PATCH] XFS: random cleanups of xfs_swap_extents Josef 'Jeff' Sipek
2008-11-12 10:09 ` Christoph Hellwig [this message]
2008-11-12 15:39   ` Josef 'Jeff' Sipek
2008-12-22 13:02     ` Christoph Hellwig
2008-12-22 14:58       ` Josef 'Jeff' Sipek
2008-12-22 14:59         ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081112100958.GB32567@infradead.org \
    --to=hch@infradead.org \
    --cc=jeffpc@josefsipek.net \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox