[PATCH 12/12] xfs: Remove the macro XFS_BUFTARG_NAME
Alex Elder
aelder at sgi.com
Fri Jul 22 14:49:41 CDT 2011
On Thu, 2011-07-21 at 17:34 -0700, Chandra Seetharaman wrote:
> Remove the definition and usages of the macro XFS_BUFTARG_NAME.
>
> Signed-off-by: Chandra Seetharaman <sekharan at us.ibm.com>
> Reviewed-by: Christoph Hellwig <hch at lst.de>
Wow, I hadn't looked at the definition of
xfs_buf_target_name() before. It's not safe
(using a pointer to since-released stack space),
though in practice it's going to be fine.
Defining it as an inline function with a static
buffer would at least avoid that, though it
means it's not reentrant either.
I would personally prefer doing it that way though.
/* NB: returns pointer to buffer reused on each call */
static inline char *
xfs_buf_target_name(struct xfs_buftarg *target)
{
static char __b[BDEVNAME_SIZE];
return bdevname(target->bt_bdev, __b);
}
Anyway, you didn't change this, but you're touching
the code that uses it. So unless others object I
would like to see this changed along with the
rest of what you do here (which is all good, by
the way).
Either way:
Reviewed-by: Alex Elder <aelder at sgi.com>
More information about the xfs
mailing list