Skip to content

Commit

Permalink
xfs: Convert linux-2.6/ files to new logging interface
Browse files Browse the repository at this point in the history
Convert the files in fs/xfs/linux-2.6/ to use the new xfs_<level>
logging format that replaces the old Irix inherited cmn_err()
interfaces. While there, also convert naked printk calls to use the
relevant xfs logging function to standardise output format.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Dave Chinner authored and Dave Chinner committed Mar 6, 2011
1 parent 10e3839 commit 4f10700
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 90 deletions.
9 changes: 5 additions & 4 deletions fs/xfs/linux-2.6/kmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/backing-dev.h>
#include "time.h"
#include "kmem.h"
#include "xfs_message.h"

/*
* Greedy allocation. May fail and may return vmalloced memory.
Expand Down Expand Up @@ -56,8 +57,8 @@ kmem_alloc(size_t size, unsigned int __nocast flags)
if (ptr || (flags & (KM_MAYFAIL|KM_NOSLEEP)))
return ptr;
if (!(++retries % 100))
printk(KERN_ERR "XFS: possible memory allocation "
"deadlock in %s (mode:0x%x)\n",
xfs_err(NULL,
"possible memory allocation deadlock in %s (mode:0x%x)",
__func__, lflags);
congestion_wait(BLK_RW_ASYNC, HZ/50);
} while (1);
Expand Down Expand Up @@ -112,8 +113,8 @@ kmem_zone_alloc(kmem_zone_t *zone, unsigned int __nocast flags)
if (ptr || (flags & (KM_MAYFAIL|KM_NOSLEEP)))
return ptr;
if (!(++retries % 100))
printk(KERN_ERR "XFS: possible memory allocation "
"deadlock in %s (mode:0x%x)\n",
xfs_err(NULL,
"possible memory allocation deadlock in %s (mode:0x%x)",
__func__, lflags);
congestion_wait(BLK_RW_ASYNC, HZ/50);
} while (1);
Expand Down
6 changes: 3 additions & 3 deletions fs/xfs/linux-2.6/xfs_aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ xfs_aops_discard_page(
if (XFS_FORCED_SHUTDOWN(ip->i_mount))
goto out_invalidate;

xfs_fs_cmn_err(CE_ALERT, ip->i_mount,
xfs_alert(ip->i_mount,
"page discard on page %p, inode 0x%llx, offset %llu.",
page, ip->i_ino, offset);

Expand All @@ -872,7 +872,7 @@ xfs_aops_discard_page(
if (error) {
/* something screwed, just bail */
if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) {
xfs_fs_cmn_err(CE_ALERT, ip->i_mount,
xfs_alert(ip->i_mount,
"page discard unable to remove delalloc mapping.");
}
break;
Expand Down Expand Up @@ -1411,7 +1411,7 @@ xfs_vm_write_failed(
if (error) {
/* something screwed, just bail */
if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) {
xfs_fs_cmn_err(CE_ALERT, ip->i_mount,
xfs_alert(ip->i_mount,
"xfs_vm_write_failed: unable to clean up ino %lld",
ip->i_ino);
}
Expand Down
17 changes: 8 additions & 9 deletions fs/xfs/linux-2.6/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,8 @@ _xfs_buf_lookup_pages(
* handle buffer allocation failures we can't do much.
*/
if (!(++retries % 100))
printk(KERN_ERR
"XFS: possible memory allocation "
"deadlock in %s (mode:0x%x)\n",
xfs_err(NULL,
"possible memory allocation deadlock in %s (mode:0x%x)",
__func__, gfp_mask);

XFS_STATS_INC(xb_page_retries);
Expand Down Expand Up @@ -615,8 +614,8 @@ xfs_buf_get(
if (!(bp->b_flags & XBF_MAPPED)) {
error = _xfs_buf_map_pages(bp, flags);
if (unlikely(error)) {
printk(KERN_WARNING "%s: failed to map pages\n",
__func__);
xfs_warn(target->bt_mount,
"%s: failed to map pages\n", __func__);
goto no_buffer;
}
}
Expand Down Expand Up @@ -850,8 +849,8 @@ xfs_buf_get_uncached(

error = _xfs_buf_map_pages(bp, XBF_MAPPED);
if (unlikely(error)) {
printk(KERN_WARNING "%s: failed to map pages\n",
__func__);
xfs_warn(target->bt_mount,
"%s: failed to map pages\n", __func__);
goto fail_free_mem;
}

Expand Down Expand Up @@ -1617,8 +1616,8 @@ xfs_setsize_buftarg_flags(
btp->bt_smask = sectorsize - 1;

if (set_blocksize(btp->bt_bdev, sectorsize)) {
printk(KERN_WARNING
"XFS: Cannot set_blocksize to %u on device %s\n",
xfs_warn(btp->bt_mount,
"Cannot set_blocksize to %u on device %s\n",
sectorsize, XFS_BUFTARG_NAME(btp));
return EINVAL;
}
Expand Down
Loading

0 comments on commit 4f10700

Please sign in to comment.