Commit 7d7bb19c authored by Stephen Lord's avatar Stephen Lord

Merge kernel.bkbits.net:/home/repos/linux-2.5

into kernel.bkbits.net:/home/lord/xfs-2.6
parents d302b497 e818fc95
......@@ -315,8 +315,8 @@ xfs_setsize_buftarg(
if (set_blocksize(btp->pbr_bdev, sectorsize)) {
printk(KERN_WARNING
"XFS: Cannot set_blocksize to %u on device %u:%u\n",
sectorsize, MAJOR(btp->pbr_dev), MINOR(btp->pbr_dev));
"XFS: Cannot set_blocksize to %u on device %s\n",
sectorsize, XFS_BUFTARG_NAME(btp));
}
}
......
......@@ -378,7 +378,6 @@ typedef struct vattr {
mode_t va_mode; /* file access mode */
uid_t va_uid; /* owner user id */
gid_t va_gid; /* owner group id */
xfs_dev_t va_fsid; /* file system id (dev for now) */
xfs_ino_t va_nodeid; /* node id */
nlink_t va_nlink; /* number of references to file */
xfs_off_t va_size; /* file size in bytes */
......
......@@ -136,9 +136,6 @@ typedef enum page_buf_flags_e { /* pb_flags values */
#define PBF_NOT_DONE(pb) (((pb)->pb_flags & (PBF_PARTIAL|PBF_NONE)) != 0)
#define PBF_DONE(pb) (((pb)->pb_flags & (PBF_PARTIAL|PBF_NONE)) == 0)
#define PBR_SECTOR_ONLY 1 /* only use sector size buffer heads */
#define PBR_ALIGNED_ONLY 2 /* only use aligned I/O */
typedef struct pb_target {
dev_t pbr_dev;
struct block_device *pbr_bdev;
......
......@@ -87,9 +87,9 @@
STATIC void xfs_qm_dqflush_done(xfs_buf_t *, xfs_dq_logitem_t *);
#ifdef DEBUG
dev_t xfs_dqerror_dev = 0;
int xfs_do_dqerror = 0;
int xfs_dqreq_num = 0;
xfs_buftarg_t *xfs_dqerror_target;
int xfs_do_dqerror;
int xfs_dqreq_num;
int xfs_dqerror_mod = 33;
#endif
......@@ -911,7 +911,7 @@ xfs_qm_dqget(
#ifdef DEBUG
if (xfs_do_dqerror) {
if ((xfs_dqerror_dev == mp->m_dev) &&
if ((xfs_dqerror_target == mp->m_ddev_targp) &&
(xfs_dqreq_num++ % xfs_dqerror_mod) == 0) {
cmn_err(CE_DEBUG, "Returning error in dqget");
return (EIO);
......
/*
* Copyright (c) 2000, 2002 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Further, this software is distributed without any warranty that it is
* free of the rightful claim of any third person regarding infringement
* or the like. Any license provided herein, whether implied or
* otherwise, applies only to this software file. Patent licenses, if
* any, provided herein do not apply to combinations of this program with
* other software, or any other product whatsoever.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
* Mountain View, CA 94043, or:
*
* http://www.sgi.com
*
* For further information regarding this notice, see:
*
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
*/
#include "xfs.h"
#include "xfs_macros.h"
#include "xfs_types.h"
#include "xfs_inum.h"
#include "xfs_log.h"
#include "xfs_trans.h"
#include "xfs_sb.h"
#include "xfs_ag.h"
#include "xfs_dir.h"
#include "xfs_dir2.h"
#include "xfs_dmapi.h"
#include "xfs_mount.h"
#include "xfs_alloc_btree.h"
#include "xfs_bmap_btree.h"
#include "xfs_ialloc_btree.h"
#include "xfs_itable.h"
#include "xfs_btree.h"
#include "xfs_ialloc.h"
#include "xfs_alloc.h"
#include "xfs_attr_sf.h"
#include "xfs_dir_sf.h"
#include "xfs_dir2_sf.h"
#include "xfs_dinode.h"
#include "xfs_inode_item.h"
#include "xfs_inode.h"
#include "xfs_bmap.h"
#include "xfs_da_btree.h"
#include "xfs_attr.h"
#include "xfs_attr_leaf.h"
int
xfs_attr_fetch(xfs_inode_t *ip, char *name, char *value, int valuelen)
{
xfs_da_args_t args;
int error;
if (XFS_IFORK_Q(ip) == 0)
return ENOATTR;
/*
* Do the argument setup for the xfs_attr routines.
*/
memset((char *)&args, 0, sizeof(args));
args.dp = ip;
args.flags = ATTR_ROOT;
args.whichfork = XFS_ATTR_FORK;
args.name = name;
args.namelen = strlen(name);
args.value = value;
args.valuelen = valuelen;
args.hashval = xfs_da_hashname(args.name, args.namelen);
args.oknoent = 1;
/*
* Decide on what work routines to call based on the inode size.
*/
if (args.dp->i_d.di_aformat == XFS_DINODE_FMT_LOCAL)
error = xfs_attr_shortform_getvalue(&args);
else if (xfs_bmap_one_block(args.dp, XFS_ATTR_FORK))
error = xfs_attr_leaf_get(&args);
else
error = xfs_attr_node_get(&args);
if (error == EEXIST)
error = 0;
return(error);
}
......@@ -194,7 +194,10 @@ extern inline xfs_caddr_t xfs_buf_offset(page_buf_t *bp, size_t offset)
(bp)->pb_target = (target)
#define XFS_BUF_TARGET(bp) ((bp)->pb_target)
#define XFS_BUF_TARGET_DEV(bp) ((bp)->pb_target->pbr_dev)
#define XFS_BUFTARG_NAME(target) \
({ char __b[BDEVNAME_SIZE]; bdevname((target->pbr_bdev), __b); __b; })
#define XFS_BUF_SET_VTYPE_REF(bp, type, ref)
#define XFS_BUF_SET_VTYPE(bp, type)
#define XFS_BUF_SET_REF(bp, ref)
......
......@@ -1007,7 +1007,7 @@ xfs_buf_iodone_callbacks(
{
xfs_log_item_t *lip;
static ulong lasttime;
static dev_t lastdev;
static xfs_buftarg_t *lasttarg;
xfs_mount_t *mp;
ASSERT(XFS_BUF_FSPRIVATE(bp, void *) != NULL);
......@@ -1045,15 +1045,15 @@ xfs_buf_iodone_callbacks(
return;
}
if ((XFS_BUF_TARGET_DEV(bp) != lastdev) ||
if ((XFS_BUF_TARGET(bp) != lasttarg) ||
(time_after(jiffies, (lasttime + 5*HZ)))) {
lasttime = jiffies;
prdev("XFS write error in file system meta-data "
"block 0x%Lx in %s",
XFS_BUF_TARGET_DEV(bp),
XFS_BUF_TARGET(bp),
XFS_BUF_ADDR(bp), mp->m_fsname);
}
lastdev = XFS_BUF_TARGET_DEV(bp);
lasttarg = XFS_BUF_TARGET(bp);
if (XFS_BUF_ISASYNC(bp)) {
/*
......
......@@ -2450,7 +2450,7 @@ xfs_da_buf_make(int nbuf, xfs_buf_t **bps, inst_t *ra)
dabuf->dirty = 0;
#ifdef XFS_DABUF_DEBUG
dabuf->ra = ra;
dabuf->dev = XFS_BUF_TARGET_DEV(bps[0]);
dabuf->target = XFS_BUF_TARGET(bps[0]);
dabuf->blkno = XFS_BUF_ADDR(bps[0]);
#endif
if (nbuf == 1) {
......@@ -2480,7 +2480,7 @@ xfs_da_buf_make(int nbuf, xfs_buf_t **bps, inst_t *ra)
s = mutex_spinlock(&xfs_dabuf_global_lock);
for (p = xfs_dabuf_global_list; p; p = p->next) {
ASSERT(p->blkno != dabuf->blkno ||
p->dev != dabuf->dev);
p->target != dabuf->target);
}
dabuf->prev = NULL;
if (xfs_dabuf_global_list)
......
......@@ -212,7 +212,7 @@ typedef struct xfs_dabuf {
inst_t *ra; /* return address of caller to make */
struct xfs_dabuf *next; /* next in global chain */
struct xfs_dabuf *prev; /* previous in global chain */
dev_t dev; /* device for buffer */
struct xfs_buftarg *target; /* device for buffer */
xfs_daddr_t blkno; /* daddr first in bps[0] */
#endif
struct xfs_buf *bps[1]; /* actually nbuf of these */
......
......@@ -329,6 +329,7 @@ xfs_corruption_error(
int linenum,
inst_t *ra)
{
if (level <= xfs_error_level)
xfs_hex_dump(p, 16);
xfs_error_report(tag, level, mp, fname, linenum, ra);
}
......@@ -32,8 +32,8 @@
#ifndef __XFS_ERROR_H__
#define __XFS_ERROR_H__
#define prdev(fmt,dev,args...) \
printk("XFS: device %u:%u- " fmt "\n", MAJOR(dev), MINOR(dev), ## args)
#define prdev(fmt,targ,args...) \
printk("XFS: device %s- " fmt "\n", XFS_BUFTARG_NAME(targ), ## args)
#define XFS_ERECOVER 1 /* Failure to recover log */
#define XFS_ELOGSTAT 2 /* Failure to stat log in user space */
......
......@@ -408,8 +408,9 @@ xfs_itobp(
if (unlikely(XFS_TEST_ERROR(!di_ok, mp, XFS_ERRTAG_ITOBP_INOTOBP,
XFS_RANDOM_ITOBP_INOTOBP))) {
#ifdef DEBUG
prdev("bad inode magic/vsn daddr 0x%llx #%d (magic=%x)",
mp->m_dev, (unsigned long long)imap.im_blkno, i,
prdev("bad inode magic/vsn daddr %lld #%d (magic=%x)",
mp->m_ddev_targp,
(unsigned long long)imap.im_blkno, i,
INT_GET(dip->di_core.di_magic, ARCH_CONVERT));
#endif
XFS_CORRUPTION_ERROR("xfs_itobp", XFS_ERRLEVEL_HIGH,
......
......@@ -65,7 +65,7 @@ STATIC int xlog_bdstrat_cb(struct xfs_buf *);
STATIC int xlog_commit_record(xfs_mount_t *mp, xlog_ticket_t *ticket,
xlog_in_core_t **, xfs_lsn_t *);
STATIC xlog_t * xlog_alloc_log(xfs_mount_t *mp,
dev_t log_dev,
xfs_buftarg_t *log_target,
xfs_daddr_t blk_offset,
int num_bblks);
STATIC int xlog_space_left(xlog_t *log, int cycle, int bytes);
......@@ -155,7 +155,7 @@ int xlog_error_mod = 33;
*/
#if defined(XLOG_NOLOG) || defined(DEBUG)
int xlog_debug = 1;
dev_t xlog_devt = 0;
xfs_buftarg_t *xlog_target;
#endif
#if defined(XFS_LOG_TRACE)
......@@ -274,7 +274,7 @@ xfs_log_done(xfs_mount_t *mp,
xfs_lsn_t lsn = 0;
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (! xlog_debug && xlog_devt == log->l_dev)
if (!xlog_debug && xlog_target == log->l_targ)
return 0;
#endif
......@@ -339,7 +339,7 @@ xfs_log_force(xfs_mount_t *mp,
xlog_t *log = mp->m_log;
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (! xlog_debug && xlog_devt == log->l_dev)
if (!xlog_debug && xlog_target == log->l_targ)
return 0;
#endif
......@@ -378,7 +378,7 @@ xfs_log_notify(xfs_mount_t *mp, /* mount of partition */
int abortflg, spl;
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (! xlog_debug && xlog_devt == log->l_dev)
if (!xlog_debug && xlog_target == log->l_targ)
return 0;
#endif
cb->cb_next = 0;
......@@ -436,7 +436,7 @@ xfs_log_reserve(xfs_mount_t *mp,
int retval;
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (! xlog_debug && xlog_devt == log->l_dev)
if (!xlog_debug && xlog_target == log->l_targ)
return 0;
#endif
retval = 0;
......@@ -472,7 +472,7 @@ xfs_log_reserve(xfs_mount_t *mp,
* Mount a log filesystem
*
* mp - ubiquitous xfs mount point structure
* log_dev - device number of on-disk log device
* log_target - buftarg of on-disk log device
* blk_offset - Start block # where block size is 512 bytes (BBSIZE)
* num_bblocks - Number of BBSIZE blocks in on-disk log
*
......@@ -480,7 +480,7 @@ xfs_log_reserve(xfs_mount_t *mp,
*/
int
xfs_log_mount(xfs_mount_t *mp,
dev_t log_dev,
xfs_buftarg_t *log_target,
xfs_daddr_t blk_offset,
int num_bblks)
{
......@@ -493,12 +493,11 @@ xfs_log_mount(xfs_mount_t *mp,
ASSERT(XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY);
}
mp->m_log = xlog_alloc_log(mp, log_dev, blk_offset, num_bblks);
mp->m_log = xlog_alloc_log(mp, log_target, blk_offset, num_bblks);
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (! xlog_debug) {
cmn_err(CE_NOTE, "log dev: %u:%u",
MAJOR(log_dev), MINOR(log_dev));
if (!xlog_debug) {
cmn_err(CE_NOTE, "log dev: %s", XFS_BUFTARG_NAME(log_target));
return 0;
}
#endif
......@@ -606,7 +605,7 @@ xfs_log_unmount_write(xfs_mount_t *mp)
} magic = { XLOG_UNMOUNT_TYPE, 0, 0 };
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (! xlog_debug && xlog_devt == log->l_dev)
if (!xlog_debug && xlog_target == log->l_targ)
return 0;
#endif
......@@ -734,9 +733,9 @@ xfs_log_write(xfs_mount_t * mp,
{
int error;
xlog_t *log = mp->m_log;
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (! xlog_debug && xlog_devt == log->l_dev) {
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (!xlog_debug && xlog_target == log->l_targ) {
*start_lsn = 0;
return 0;
}
......@@ -761,7 +760,7 @@ xfs_log_move_tail(xfs_mount_t *mp,
SPLDECL(s);
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (!xlog_debug && xlog_devt == log->l_dev)
if (!xlog_debug && xlog_target == log->l_targ)
return;
#endif
/* XXXsup tmp */
......@@ -1059,14 +1058,14 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp,
/*
* When logbufs == 0, someone has disabled the log from the FSTAB
* file. This is not a documented feature. We need to set xlog_debug
* to zero (this deactivates the log) and set xlog_devt to the
* to zero (this deactivates the log) and set xlog_target to the
* appropriate dev_t. Only one filesystem may be affected as such
* since this is just a performance hack to test what we might be able
* to get if the log were not present.
*/
if (mp->m_logbufs == 0) {
xlog_debug = 0;
xlog_devt = log->l_dev;
xlog_target = log->l_targ;
log->l_iclog_bufs = XLOG_MIN_ICLOGS;
} else
#endif
......@@ -1089,8 +1088,8 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp,
#if defined(DEBUG) || defined(XLOG_NOLOG)
/* We are reactivating a filesystem after it was active */
if (log->l_dev == xlog_devt) {
xlog_devt = 1;
if (log->l_targ == xlog_target) {
xlog_target = 1; /* XXX(hch): WTF? */
xlog_debug = 1;
}
#endif
......@@ -1176,7 +1175,7 @@ xlog_get_iclog_buffer_size(xfs_mount_t *mp,
*/
STATIC xlog_t *
xlog_alloc_log(xfs_mount_t *mp,
dev_t log_dev,
xfs_buftarg_t *log_target,
xfs_daddr_t blk_offset,
int num_bblks)
{
......@@ -1191,7 +1190,7 @@ xlog_alloc_log(xfs_mount_t *mp,
log = (xlog_t *)kmem_zalloc(sizeof(xlog_t), KM_SLEEP);
log->l_mp = mp;
log->l_dev = log_dev;
log->l_targ = log_target;
log->l_logsize = BBTOB(num_bblks);
log->l_logBBstart = blk_offset;
log->l_logBBsize = num_bblks;
......
......@@ -154,7 +154,7 @@ int xfs_log_force(struct xfs_mount *mp,
xfs_lsn_t lsn,
uint flags);
int xfs_log_mount(struct xfs_mount *mp,
dev_t log_dev,
struct xfs_buftarg *log_target,
xfs_daddr_t start_block,
int num_bblocks);
int xfs_log_mount_finish(struct xfs_mount *mp, int);
......
......@@ -504,7 +504,7 @@ typedef struct log {
struct xfs_mount *l_mp; /* mount point */
struct xfs_buf *l_xbuf; /* extra buffer for log
* wrapping */
dev_t l_dev; /* dev_t of log */
struct xfs_buftarg *l_targ; /* buftarg of log */
xfs_daddr_t l_logBBstart; /* start block of log */
int l_logsize; /* size of log in bytes */
int l_logBBsize; /* size of log in BB chunks */
......
......@@ -2179,8 +2179,8 @@ xlog_recover_do_buffer_trans(
break;
default:
xfs_fs_cmn_err(CE_ALERT, log->l_mp,
"xfs_log_recover: unknown buffer type 0x%x, dev %u:%u",
buf_f->blf_type, MAJOR(log->l_dev), MINOR(log->l_dev));
"xfs_log_recover: unknown buffer type 0x%x, dev %s",
buf_f->blf_type, XFS_BUFTARG_NAME(log->l_targ));
XFS_ERROR_REPORT("xlog_recover_do_buffer_trans",
XFS_ERRLEVEL_LOW, log->l_mp);
return XFS_ERROR(EFSCORRUPTED);
......@@ -3889,9 +3889,8 @@ xlog_recover(
}
cmn_err(CE_NOTE,
"Starting XFS recovery on filesystem: %s (dev: %d/%d)",
log->l_mp->m_fsname, MAJOR(log->l_dev),
MINOR(log->l_dev));
"Starting XFS recovery on filesystem: %s (dev: %s)",
log->l_mp->m_fsname, XFS_BUFTARG_NAME(log->l_targ));
error = xlog_do_recover(log, head_blk, tail_blk);
log->l_flags |= XLOG_RECOVERY_NEEDED;
......@@ -3940,9 +3939,7 @@ xlog_recover_finish(
cmn_err(CE_NOTE,
"Ending XFS recovery on filesystem: %s (dev: %d/%d)",
log->l_mp->m_fsname, MAJOR(log->l_dev),
MINOR(log->l_dev));
log->l_mp->m_fsname, XFS_BUFTARG_NAME(log->l_targ));
log->l_flags &= ~XLOG_RECOVERY_NEEDED;
} else {
cmn_err(CE_DEBUG,
......
......@@ -285,9 +285,9 @@ xfs_mount_validate_sb(
#if !XFS_BIG_BLKNOS
if (unlikely(
(sbp->sb_dblocks << (__uint64_t)(sbp->sb_blocklog - BBSHIFT))
> INT_MAX ||
> UINT_MAX ||
(sbp->sb_rblocks << (__uint64_t)(sbp->sb_blocklog - BBSHIFT))
> INT_MAX)) {
> UINT_MAX)) {
cmn_err(CE_WARN,
"XFS: File system is too large to be mounted on this system.");
return XFS_ERROR(E2BIG);
......@@ -949,7 +949,7 @@ xfs_mountfs(
* log's mount-time initialization. Perform 1st part recovery if needed
*/
if (likely(sbp->sb_logblocks > 0)) { /* check for volume case */
error = xfs_log_mount(mp, mp->m_logdev_targp->pbr_dev,
error = xfs_log_mount(mp, mp->m_logdev_targp,
XFS_FSB_TO_DADDR(mp, sbp->sb_logstart),
XFS_FSB_TO_BB(mp, sbp->sb_logblocks));
if (error) {
......@@ -980,7 +980,7 @@ xfs_mountfs(
if (unlikely((rip->i_d.di_mode & IFMT) != IFDIR)) {
cmn_err(CE_WARN, "XFS: corrupted root inode");
prdev("Root inode %llu is not a directory",
mp->m_dev, (unsigned long long)rip->i_ino);
mp->m_ddev_targp, (unsigned long long)rip->i_ino);
xfs_iunlock(rip, XFS_ILOCK_EXCL);
XFS_ERROR_REPORT("xfs_mountfs_int(2)", XFS_ERRLEVEL_LOW,
mp);
......
......@@ -94,7 +94,7 @@ struct xfs_bmap_free;
typedef int (*xfs_send_data_t)(int, struct bhv_desc *,
xfs_off_t, size_t, int, vrwlock_t *);
typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint);
typedef int (*xfs_send_destroy_t)(struct bhv_desc *, dm_right_t);
typedef int (*xfs_send_destroy_t)(struct vnode *, dm_right_t);
typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct vnode *,
dm_right_t, struct vnode *, dm_right_t,
char *, char *, mode_t, int, int);
......@@ -113,8 +113,8 @@ typedef struct xfs_dmops {
(*(mp)->m_dm_ops.xfs_send_data)(ev,bdp,off,len,fl,lock)
#define XFS_SEND_MMAP(mp, vma,fl) \
(*(mp)->m_dm_ops.xfs_send_mmap)(vma,fl)
#define XFS_SEND_DESTROY(mp, bdp,right) \
(*(mp)->m_dm_ops.xfs_send_destroy)(bdp,right)
#define XFS_SEND_DESTROY(mp, vp,right) \
(*(mp)->m_dm_ops.xfs_send_destroy)(vp,right)
#define XFS_SEND_NAMESP(mp, ev,b1,r1,b2,r2,n1,n2,mode,rval,fl) \
(*(mp)->m_dm_ops.xfs_send_namesp)(ev,b1,r1,b2,r2,n1,n2,mode,rval,fl)
#define XFS_SEND_UNMOUNT(mp, vfsp,vp,right,mode,rval,fl) \
......
......@@ -260,11 +260,10 @@ xfs_ioerror_alert(
xfs_daddr_t blkno)
{
cmn_err(CE_ALERT,
"I/O error in filesystem (\"%s\") meta-data dev %u:%u block 0x%llx"
"I/O error in filesystem (\"%s\") meta-data dev %s block 0x%llx"
" (\"%s\") error %d buf count %u",
(!mp || !mp->m_fsname) ? "(fs name not set)" : mp->m_fsname,
MAJOR(XFS_BUF_TARGET_DEV(bp)),
MINOR(XFS_BUF_TARGET_DEV(bp)),
XFS_BUFTARG_NAME(bp->pb_target),
(__uint64_t)blkno,
func,
XFS_BUF_GETERROR(bp),
......
......@@ -995,7 +995,6 @@ void xfs_trans_dquot_buf(xfs_trans_t *, struct xfs_buf *, uint);
void xfs_trans_inode_alloc_buf(xfs_trans_t *, struct xfs_buf *);
int xfs_trans_iget(struct xfs_mount *, xfs_trans_t *,
xfs_ino_t , uint, struct xfs_inode **);
void xfs_trans_iput(xfs_trans_t *, struct xfs_inode *, uint);
void xfs_trans_ijoin(xfs_trans_t *, struct xfs_inode *, uint);
void xfs_trans_ihold(xfs_trans_t *, struct xfs_inode *);
void xfs_trans_ihold_release(xfs_trans_t *, struct xfs_inode *);
......
......@@ -264,7 +264,7 @@ xfs_trans_getsb(xfs_trans_t *tp,
}
#ifdef DEBUG
dev_t xfs_error_dev = 0;
xfs_buftarg_t *xfs_error_target;
int xfs_do_error;
int xfs_req_num;
int xfs_error_mod = 33;
......@@ -322,7 +322,7 @@ xfs_trans_read_buf(
}
#ifdef DEBUG
if (xfs_do_error && (bp != NULL)) {
if (xfs_error_dev == target->pbr_dev) {
if (xfs_error_target == target) {
if (((xfs_req_num++) % xfs_error_mod) == 0) {
xfs_buf_relse(bp);
printk("Returning error!\n");
......@@ -425,7 +425,7 @@ xfs_trans_read_buf(
}
#ifdef DEBUG
if (xfs_do_error && !(tp->t_flags & XFS_TRANS_DIRTY)) {
if (xfs_error_dev == target->pbr_dev) {
if (xfs_error_target == target) {
if (((xfs_req_num++) % xfs_error_mod) == 0) {
xfs_force_shutdown(tp->t_mountp,
XFS_METADATA_IO_ERROR);
......
......@@ -187,106 +187,6 @@ xfs_trans_iget(
}
/*
* Release the inode ip which was previously acquired with xfs_trans_iget()
* or added with xfs_trans_ijoin(). This will decrement the lock
* recursion count of the inode item. If the count goes to less than 0,
* the inode will be unlocked and disassociated from the transaction.
*
* If the inode has been modified within the transaction, it will not be
* unlocked until the transaction commits.
*/
void
xfs_trans_iput(
xfs_trans_t *tp,
xfs_inode_t *ip,
uint lock_flags)
{
xfs_inode_log_item_t *iip;
xfs_log_item_desc_t *lidp;
/*
* If the transaction pointer is NULL, just call xfs_iput().
*/
if (tp == NULL) {
xfs_iput(ip, lock_flags);
}
ASSERT(ip->i_transp == tp);
iip = ip->i_itemp;
ASSERT(iip != NULL);
/*
* Find the item descriptor pointing to this inode's
* log item. It must be there.
*/
lidp = xfs_trans_find_item(tp, (xfs_log_item_t*)iip);
ASSERT(lidp != NULL);
ASSERT(lidp->lid_item == (xfs_log_item_t*)iip);
/*
* Be consistent about the bookkeeping for the inode's
* io lock, but it doesn't mean much really.
*/
ASSERT((iip->ili_flags & XFS_ILI_IOLOCKED_ANY) != XFS_ILI_IOLOCKED_ANY);
if (lock_flags & (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED)) {
ASSERT(iip->ili_flags & XFS_ILI_IOLOCKED_ANY);
ASSERT((!(lock_flags & XFS_IOLOCK_EXCL)) ||
(iip->ili_flags & XFS_ILI_IOLOCKED_EXCL));
ASSERT((!(lock_flags & XFS_IOLOCK_SHARED)) ||
(iip->ili_flags &
(XFS_ILI_IOLOCKED_EXCL | XFS_ILI_IOLOCKED_SHARED)));
if (iip->ili_iolock_recur > 0) {
iip->ili_iolock_recur--;
}
}
/*
* If the release is just for a recursive lock on the inode lock,
* then decrement the count and return. We can assert that
* the caller is dropping an EXCL lock on the inode, because
* inode must be locked EXCL within transactions.
*/
ASSERT(lock_flags & XFS_ILOCK_EXCL);
if (iip->ili_ilock_recur > 0) {
iip->ili_ilock_recur--;
return;
}
ASSERT(iip->ili_iolock_recur == 0);
/*
* If the inode was dirtied within this transaction, it cannot
* be released until the transaction commits.
*/
if (lidp->lid_flags & XFS_LID_DIRTY) {
return;
}
xfs_trans_free_item(tp, lidp);
/*
* Clear the hold and iolocked flags in the inode log item.
* We wouldn't want the next user of the inode to
* get confused. Assert that if the iolocked flag is set
* in the item then we are unlocking it in the call to xfs_iput()
* below.
*/
ASSERT((!(iip->ili_flags & XFS_ILI_IOLOCKED_ANY)) ||
(lock_flags & (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED)));
if (iip->ili_flags & (XFS_ILI_HOLD | XFS_ILI_IOLOCKED_ANY)) {
iip->ili_flags &= ~(XFS_ILI_HOLD | XFS_ILI_IOLOCKED_ANY);
}
/*
* Unlike xfs_brelse() the inode log item cannot be
* freed, because it is embedded within the inode.
* All we have to do is release the inode.
*/
xfs_iput(ip, lock_flags);
return;
}
/*
* Add the locked inode to the transaction.
* The inode must be locked, and it cannot be associated with any
......
......@@ -1776,7 +1776,6 @@ xfs_showargs(
};
struct proc_xfs_info *xfs_infop;
struct xfs_mount *mp = XFS_BHVTOM(bhv);
char b[BDEVNAME_SIZE];
for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) {
if (mp->m_flags & xfs_infop->flag)
......@@ -1792,14 +1791,13 @@ xfs_showargs(
if (mp->m_logbsize > 0)
seq_printf(m, "," MNTOPT_LOGBSIZE "=%d", mp->m_logbsize);
if (mp->m_ddev_targp->pbr_dev != mp->m_logdev_targp->pbr_dev)
if (mp->m_ddev_targp != mp->m_logdev_targp)
seq_printf(m, "," MNTOPT_LOGDEV "=%s",
bdevname(mp->m_logdev_targp->pbr_bdev, b));
XFS_BUFTARG_NAME(mp->m_logdev_targp));
if (mp->m_rtdev_targp &&
mp->m_ddev_targp->pbr_dev != mp->m_rtdev_targp->pbr_dev)
if (mp->m_rtdev_targp && mp->m_ddev_targp != mp->m_rtdev_targp)
seq_printf(m, "," MNTOPT_RTDEV "=%s",
bdevname(mp->m_rtdev_targp->pbr_bdev, b));
XFS_BUFTARG_NAME(mp->m_rtdev_targp));
if (mp->m_dalign > 0)
seq_printf(m, "," MNTOPT_SUNIT "=%d",
......
......@@ -151,7 +151,6 @@ xfs_getattr(
}
vap->va_nblocks =
XFS_FSB_TO_BB(mp, ip->i_d.di_nblocks + ip->i_delayed_blks);
vap->va_fsid = mp->m_dev;
vap->va_nodeid = ip->i_ino;
#if XFS_BIG_INUMS
vap->va_nodeid += mp->m_inoadd;
......@@ -1729,7 +1728,7 @@ xfs_inactive(
if (ip->i_d.di_nlink == 0 &&
DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_DESTROY)) {
(void) XFS_SEND_DESTROY(mp, bdp, DM_RIGHT_NULL);
(void) XFS_SEND_DESTROY(mp, vp, DM_RIGHT_NULL);
}
error = 0;
......
......@@ -3739,9 +3739,9 @@ xfsidbg_xdabuf(xfs_dabuf_t *dabuf)
kdb_printf(" %d:0x%p", i, dabuf->bps[i]);
kdb_printf("\n");
#ifdef XFS_DABUF_DEBUG
kdb_printf(" ra 0x%x prev 0x%x next 0x%x dev %u:%u blkno 0x%x\n",
kdb_printf(" ra 0x%x prev 0x%x next 0x%x dev %s blkno 0x%x\n",
dabuf->ra, dabuf->prev, dabuf->next,
MAJOR(dabuf->dev), MINOR(dabuf->dev), dabuf->blkno);
XFS_BUFTARG_NAME(dabuf->dev), dabuf->blkno);
#endif
}
......@@ -4269,9 +4269,8 @@ xfsidbg_xlog(xlog_t *log)
xfsidbg_get_cstate(log->l_covered_state));
kdb_printf("flags: ");
printflags(log->l_flags, t_flags,"log");
kdb_printf(" dev: %u:%u logBBstart: %lld logsize: %d logBBsize: %d\n",
MAJOR(log->l_dev), MINOR(log->l_dev),
(long long) log->l_logBBstart,
kdb_printf(" dev: %s logBBstart: %lld logsize: %d logBBsize: %d\n",
XFS_BUFTARG_NAME(log->l_targ), (long long) log->l_logBBstart,
log->l_logsize,log->l_logBBsize);
kdb_printf("curr_cycle: %d prev_cycle: %d curr_block: %d prev_block: %d\n",
log->l_curr_cycle, log->l_prev_cycle, log->l_curr_block,
......@@ -4646,14 +4645,14 @@ xfsidbg_xmount(xfs_mount_t *mp)
XFS_MTOVFS(mp), mp->m_tid, &mp->m_ail_lock, &mp->m_ail);
kdb_printf("ail_gen 0x%x &sb 0x%p\n",
mp->m_ail_gen, &mp->m_sb);
kdb_printf("sb_lock 0x%p sb_bp 0x%p dev %u:%u logdev %u:%u rtdev %u:%u\n",
kdb_printf("sb_lock 0x%p sb_bp 0x%p dev %s logdev %s rtdev %s\n",
&mp->m_sb_lock, mp->m_sb_bp,
mp->m_ddev_targp ? MAJOR(mp->m_ddev_targp->pbr_dev) : 0,
mp->m_ddev_targp ? MINOR(mp->m_ddev_targp->pbr_dev) : 0,
mp->m_logdev_targp ? MAJOR(mp->m_logdev_targp->pbr_dev) : 0,
mp->m_logdev_targp ? MINOR(mp->m_logdev_targp->pbr_dev) : 0,
mp->m_rtdev_targp ? MAJOR(mp->m_rtdev_targp->pbr_dev) : 0,
mp->m_rtdev_targp ? MINOR(mp->m_rtdev_targp->pbr_dev) : 0);
mp->m_ddev_targp ?
XFS_BUFTARG_NAME(mp->m_ddev_targp) : "none",
mp->m_logdev_targp ?
XFS_BUFTARG_NAME(mp->m_logdev_targp) : "none",
mp->m_rtdev_targp ?
XFS_BUFTARG_NAME(mp->m_rtdev_targp) : "none");
kdb_printf("bsize %d agfrotor %d agirotor %d ihash 0x%p ihsize %d\n",
mp->m_bsize, mp->m_agfrotor, mp->m_agirotor,
mp->m_ihash, mp->m_ihsize);
......@@ -4824,9 +4823,8 @@ xfsidbg_xnode(xfs_inode_t *ip)
ip->i_mnext,
ip->i_mprev,
XFS_ITOV_NULL(ip));
kdb_printf("dev %u:%u ino %s\n",
MAJOR(ip->i_mount->m_dev),
MINOR(ip->i_mount->m_dev),
kdb_printf("dev %s ino %s\n",
XFS_BUFTARG_NAME(ip->i_mount->m_ddev_targp),
xfs_fmtino(ip->i_ino, ip->i_mount));
kdb_printf("blkno 0x%llx len 0x%x boffset 0x%x\n",
(long long) ip->i_blkno,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment