aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.h11
-rw-r--r--fs/xfs/xfs_buf_item.c2
-rw-r--r--fs/xfs/xfs_rw.c2
4 files changed, 10 insertions, 7 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index 5e929f0e57f7..6bddce40de72 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -1480,7 +1480,7 @@ xfs_setsize_buftarg_flags(
1480 if (set_blocksize(btp->bt_bdev, sectorsize)) { 1480 if (set_blocksize(btp->bt_bdev, sectorsize)) {
1481 xfs_warn(btp->bt_mount, 1481 xfs_warn(btp->bt_mount,
1482 "Cannot set_blocksize to %u on device %s\n", 1482 "Cannot set_blocksize to %u on device %s\n",
1483 sectorsize, XFS_BUFTARG_NAME(btp)); 1483 sectorsize, xfs_buf_target_name(btp));
1484 return EINVAL; 1484 return EINVAL;
1485 } 1485 }
1486 1486
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
index 4b304990a799..620972b8094d 100644
--- a/fs/xfs/linux-2.6/xfs_buf.h
+++ b/fs/xfs/linux-2.6/xfs_buf.h
@@ -228,8 +228,13 @@ extern void xfs_buf_delwri_promote(xfs_buf_t *);
228extern int xfs_buf_init(void); 228extern int xfs_buf_init(void);
229extern void xfs_buf_terminate(void); 229extern void xfs_buf_terminate(void);
230 230
231#define xfs_buf_target_name(target) \ 231static inline const char *
232 ({ char __b[BDEVNAME_SIZE]; bdevname((target)->bt_bdev, __b); __b; }) 232xfs_buf_target_name(struct xfs_buftarg *target)
233{
234 static char __b[BDEVNAME_SIZE];
235
236 return bdevname(target->bt_bdev, __b);
237}
233 238
234 239
235#define XFS_BUF_ZEROFLAGS(bp) \ 240#define XFS_BUF_ZEROFLAGS(bp) \
@@ -292,8 +297,6 @@ static inline int xfs_buf_ispinned(struct xfs_buf *bp)
292 297
293#define XFS_BUF_FINISH_IOWAIT(bp) complete(&bp->b_iowait); 298#define XFS_BUF_FINISH_IOWAIT(bp) complete(&bp->b_iowait);
294 299
295#define XFS_BUFTARG_NAME(target) xfs_buf_target_name(target)
296
297static inline void xfs_buf_relse(xfs_buf_t *bp) 300static inline void xfs_buf_relse(xfs_buf_t *bp)
298{ 301{
299 xfs_buf_unlock(bp); 302 xfs_buf_unlock(bp);
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index 5c2b5549e14e..0402173e79e9 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -975,7 +975,7 @@ xfs_buf_iodone_callbacks(
975 time_after(jiffies, (lasttime + 5*HZ))) { 975 time_after(jiffies, (lasttime + 5*HZ))) {
976 lasttime = jiffies; 976 lasttime = jiffies;
977 xfs_alert(mp, "Device %s: metadata write error block 0x%llx", 977 xfs_alert(mp, "Device %s: metadata write error block 0x%llx",
978 XFS_BUFTARG_NAME(bp->b_target), 978 xfs_buf_target_name(bp->b_target),
979 (__uint64_t)XFS_BUF_ADDR(bp)); 979 (__uint64_t)XFS_BUF_ADDR(bp));
980 } 980 }
981 lasttarg = bp->b_target; 981 lasttarg = bp->b_target;
diff --git a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c
index 7382bfe40fbd..c96a8a05ac03 100644
--- a/fs/xfs/xfs_rw.c
+++ b/fs/xfs/xfs_rw.c
@@ -104,7 +104,7 @@ xfs_ioerror_alert(
104 xfs_alert(mp, 104 xfs_alert(mp,
105 "I/O error occurred: meta-data dev %s block 0x%llx" 105 "I/O error occurred: meta-data dev %s block 0x%llx"
106 " (\"%s\") error %d buf count %zd", 106 " (\"%s\") error %d buf count %zd",
107 XFS_BUFTARG_NAME(bp->b_target), 107 xfs_buf_target_name(bp->b_target),
108 (__uint64_t)blkno, func, 108 (__uint64_t)blkno, func,
109 bp->b_error, XFS_BUF_COUNT(bp)); 109 bp->b_error, XFS_BUF_COUNT(bp));
110} 110}