Commit 1f38b551 authored by Stephen Lord's avatar Stephen Lord Committed by Stephen Lord

Merge ssh://lord@kernel.bkbits.net/xfs-2.6

into jen.americas.sgi.com:/src/lord/bitkeeper/xfs-2.6
parents 41dd117c 95c495d0
...@@ -1041,6 +1041,8 @@ count_page_state( ...@@ -1041,6 +1041,8 @@ count_page_state(
do { do {
if (buffer_uptodate(bh) && !buffer_mapped(bh)) if (buffer_uptodate(bh) && !buffer_mapped(bh))
(*unmapped) = 1; (*unmapped) = 1;
else if (buffer_unwritten(bh) && !buffer_delay(bh))
clear_buffer_unwritten(bh);
else if (buffer_unwritten(bh)) else if (buffer_unwritten(bh))
(*unwritten) = 1; (*unwritten) = 1;
else if (buffer_delay(bh)) else if (buffer_delay(bh))
......
...@@ -218,7 +218,7 @@ xfs_read( ...@@ -218,7 +218,7 @@ xfs_read(
int error; int error;
vrwlock_t locktype = VRWLOCK_READ; vrwlock_t locktype = VRWLOCK_READ;
error = XFS_SEND_DATA(mp, DM_EVENT_READ, bdp, *offset, size, error = XFS_SEND_DATA(mp, DM_EVENT_READ, BHV_TO_VNODE(bdp), *offset, size,
FILP_DELAY_FLAG(file), &locktype); FILP_DELAY_FLAG(file), &locktype);
if (error) { if (error) {
xfs_iunlock(ip, XFS_IOLOCK_SHARED); xfs_iunlock(ip, XFS_IOLOCK_SHARED);
...@@ -612,7 +612,7 @@ xfs_write( ...@@ -612,7 +612,7 @@ xfs_write(
loff_t savedsize = *offset; loff_t savedsize = *offset;
xfs_iunlock(xip, XFS_ILOCK_EXCL); xfs_iunlock(xip, XFS_ILOCK_EXCL);
error = XFS_SEND_DATA(xip->i_mount, DM_EVENT_WRITE, bdp, error = XFS_SEND_DATA(xip->i_mount, DM_EVENT_WRITE, vp,
*offset, size, *offset, size,
FILP_DELAY_FLAG(file), &locktype); FILP_DELAY_FLAG(file), &locktype);
if (error) { if (error) {
......
...@@ -200,7 +200,7 @@ vn_revalidate( ...@@ -200,7 +200,7 @@ vn_revalidate(
vn_trace_entry(vp, "vn_revalidate", (inst_t *)__return_address); vn_trace_entry(vp, "vn_revalidate", (inst_t *)__return_address);
ASSERT(vp->v_fbhv != NULL); ASSERT(vp->v_fbhv != NULL);
va.va_mask = XFS_AT_STAT|XFS_AT_GENCOUNT; va.va_mask = XFS_AT_STAT|XFS_AT_XFLAGS;
VOP_GETATTR(vp, &va, 0, NULL, error); VOP_GETATTR(vp, &va, 0, NULL, error);
if (!error) { if (!error) {
inode = LINVFS_GET_IP(vp); inode = LINVFS_GET_IP(vp);
......
...@@ -1769,12 +1769,8 @@ pagebuf_delwri_flush( ...@@ -1769,12 +1769,8 @@ pagebuf_delwri_flush(
blk_run_queues(); blk_run_queues();
flush_cnt = 0; flush_cnt = 0;
} }
spin_lock(&pbd_delwrite_lock);
} }
spin_unlock(&pbd_delwrite_lock);
blk_run_queues(); blk_run_queues();
if (pinptr) if (pinptr)
......
...@@ -5553,7 +5553,7 @@ xfs_getbmap( ...@@ -5553,7 +5553,7 @@ xfs_getbmap(
&& DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ) && DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ)
&& whichfork == XFS_DATA_FORK) { && whichfork == XFS_DATA_FORK) {
error = XFS_SEND_DATA(mp, DM_EVENT_READ, bdp, 0, 0, 0, NULL); error = XFS_SEND_DATA(mp, DM_EVENT_READ, vp, 0, 0, 0, NULL);
if (error) if (error)
return XFS_ERROR(error); return XFS_ERROR(error);
} }
......
...@@ -3938,7 +3938,7 @@ xlog_recover_finish( ...@@ -3938,7 +3938,7 @@ xlog_recover_finish(
xlog_recover_check_summary(log); xlog_recover_check_summary(log);
cmn_err(CE_NOTE, cmn_err(CE_NOTE,
"Ending XFS recovery on filesystem: %s (dev: %d/%d)", "Ending XFS recovery on filesystem: %s (dev: %s)",
log->l_mp->m_fsname, XFS_BUFTARG_NAME(log->l_targ)); log->l_mp->m_fsname, XFS_BUFTARG_NAME(log->l_targ));
log->l_flags &= ~XLOG_RECOVERY_NEEDED; log->l_flags &= ~XLOG_RECOVERY_NEEDED;
} else { } else {
......
...@@ -91,7 +91,7 @@ struct xfs_bmap_free; ...@@ -91,7 +91,7 @@ struct xfs_bmap_free;
* Prototypes and functions for the Data Migration subsystem. * Prototypes and functions for the Data Migration subsystem.
*/ */
typedef int (*xfs_send_data_t)(int, struct bhv_desc *, typedef int (*xfs_send_data_t)(int, struct vnode *,
xfs_off_t, size_t, int, vrwlock_t *); xfs_off_t, size_t, int, vrwlock_t *);
typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint); typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint);
typedef int (*xfs_send_destroy_t)(struct vnode *, dm_right_t); typedef int (*xfs_send_destroy_t)(struct vnode *, dm_right_t);
...@@ -109,8 +109,8 @@ typedef struct xfs_dmops { ...@@ -109,8 +109,8 @@ typedef struct xfs_dmops {
xfs_send_unmount_t xfs_send_unmount; xfs_send_unmount_t xfs_send_unmount;
} xfs_dmops_t; } xfs_dmops_t;
#define XFS_SEND_DATA(mp, ev,bdp,off,len,fl,lock) \ #define XFS_SEND_DATA(mp, ev,vp,off,len,fl,lock) \
(*(mp)->m_dm_ops.xfs_send_data)(ev,bdp,off,len,fl,lock) (*(mp)->m_dm_ops.xfs_send_data)(ev,vp,off,len,fl,lock)
#define XFS_SEND_MMAP(mp, vma,fl) \ #define XFS_SEND_MMAP(mp, vma,fl) \
(*(mp)->m_dm_ops.xfs_send_mmap)(vma,fl) (*(mp)->m_dm_ops.xfs_send_mmap)(vma,fl)
#define XFS_SEND_DESTROY(mp, vp,right) \ #define XFS_SEND_DESTROY(mp, vp,right) \
......
...@@ -144,11 +144,9 @@ xfs_getattr( ...@@ -144,11 +144,9 @@ xfs_getattr(
xfs_ilock(ip, XFS_ILOCK_SHARED); xfs_ilock(ip, XFS_ILOCK_SHARED);
vap->va_size = ip->i_d.di_size; vap->va_size = ip->i_d.di_size;
if (vap->va_mask == XFS_AT_SIZE) { if (vap->va_mask == XFS_AT_SIZE)
if (!(flags & ATTR_LAZY)) goto all_done;
xfs_iunlock(ip, XFS_ILOCK_SHARED);
return 0;
}
vap->va_nblocks = vap->va_nblocks =
XFS_FSB_TO_BB(mp, ip->i_d.di_nblocks + ip->i_delayed_blks); XFS_FSB_TO_BB(mp, ip->i_d.di_nblocks + ip->i_delayed_blks);
vap->va_nodeid = ip->i_ino; vap->va_nodeid = ip->i_ino;
...@@ -162,11 +160,8 @@ xfs_getattr( ...@@ -162,11 +160,8 @@ xfs_getattr(
*/ */
if ((vap->va_mask & if ((vap->va_mask &
~(XFS_AT_SIZE|XFS_AT_FSID|XFS_AT_NODEID| ~(XFS_AT_SIZE|XFS_AT_FSID|XFS_AT_NODEID|
XFS_AT_NLINK|XFS_AT_BLKSIZE)) == 0) { XFS_AT_NLINK|XFS_AT_BLKSIZE)) == 0)
if (!(flags & ATTR_LAZY)) goto all_done;
xfs_iunlock(ip, XFS_ILOCK_SHARED);
return 0;
}
/* /*
* Copy from in-core inode. * Copy from in-core inode.
...@@ -250,37 +245,44 @@ xfs_getattr( ...@@ -250,37 +245,44 @@ xfs_getattr(
*/ */
if ((vap->va_mask & if ((vap->va_mask &
(XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS| (XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|
XFS_AT_GENCOUNT|XFS_AT_VCODE)) == 0) { XFS_AT_GENCOUNT|XFS_AT_VCODE)) == 0)
if (!(flags & ATTR_LAZY)) goto all_done;
xfs_iunlock(ip, XFS_ILOCK_SHARED);
return 0;
}
/* /*
* convert di_flags to xflags * convert di_flags to xflags
*/ */
vap->va_xflags = vap->va_xflags = 0;
((ip->i_d.di_flags & XFS_DIFLAG_REALTIME) ? if (ip->i_d.di_flags & XFS_DIFLAG_REALTIME)
XFS_XFLAG_REALTIME : 0) | vap->va_xflags |= XFS_XFLAG_REALTIME;
((ip->i_d.di_flags & XFS_DIFLAG_PREALLOC) ? if (ip->i_d.di_flags & XFS_DIFLAG_PREALLOC)
XFS_XFLAG_PREALLOC : 0) | vap->va_xflags |= XFS_XFLAG_PREALLOC;
((ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE) ? if (ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE)
XFS_XFLAG_IMMUTABLE : 0) | vap->va_xflags |= XFS_XFLAG_IMMUTABLE;
((ip->i_d.di_flags & XFS_DIFLAG_APPEND) ? if (ip->i_d.di_flags & XFS_DIFLAG_APPEND)
XFS_XFLAG_APPEND : 0) | vap->va_xflags |= XFS_XFLAG_APPEND;
((ip->i_d.di_flags & XFS_DIFLAG_SYNC) ? if (ip->i_d.di_flags & XFS_DIFLAG_SYNC)
XFS_XFLAG_SYNC : 0) | vap->va_xflags |= XFS_XFLAG_SYNC;
((ip->i_d.di_flags & XFS_DIFLAG_NOATIME) ? if (ip->i_d.di_flags & XFS_DIFLAG_NOATIME)
XFS_XFLAG_NOATIME : 0) | vap->va_xflags |= XFS_XFLAG_NOATIME;
((ip->i_d.di_flags & XFS_DIFLAG_NODUMP) ? if (ip->i_d.di_flags & XFS_DIFLAG_NODUMP)
XFS_XFLAG_NODUMP: 0) | vap->va_xflags |= XFS_XFLAG_NODUMP;
(XFS_IFORK_Q(ip) ? if (XFS_IFORK_Q(ip))
XFS_XFLAG_HASATTR : 0); vap->va_xflags |= XFS_XFLAG_HASATTR;
/*
* Exit for inode revalidate. See if any of the rest of
* the fields to be filled in are needed.
*/
if ((vap->va_mask &
(XFS_AT_EXTSIZE|XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|
XFS_AT_GENCOUNT|XFS_AT_VCODE)) == 0)
goto all_done;
vap->va_extsize = ip->i_d.di_extsize << mp->m_sb.sb_blocklog; vap->va_extsize = ip->i_d.di_extsize << mp->m_sb.sb_blocklog;
vap->va_nextents = vap->va_nextents =
(ip->i_df.if_flags & XFS_IFEXTENTS) ? (ip->i_df.if_flags & XFS_IFEXTENTS) ?
ip->i_df.if_bytes / sizeof(xfs_bmbt_rec_t) : ip->i_df.if_bytes / sizeof(xfs_bmbt_rec_t) :
ip->i_d.di_nextents; ip->i_d.di_nextents;
if (ip->i_afp != NULL) if (ip->i_afp)
vap->va_anextents = vap->va_anextents =
(ip->i_afp->if_flags & XFS_IFEXTENTS) ? (ip->i_afp->if_flags & XFS_IFEXTENTS) ?
ip->i_afp->if_bytes / sizeof(xfs_bmbt_rec_t) : ip->i_afp->if_bytes / sizeof(xfs_bmbt_rec_t) :
...@@ -290,6 +292,7 @@ xfs_getattr( ...@@ -290,6 +292,7 @@ xfs_getattr(
vap->va_gencount = ip->i_d.di_gen; vap->va_gencount = ip->i_d.di_gen;
vap->va_vcode = 0L; vap->va_vcode = 0L;
all_done:
if (!(flags & ATTR_LAZY)) if (!(flags & ATTR_LAZY))
xfs_iunlock(ip, XFS_ILOCK_SHARED); xfs_iunlock(ip, XFS_ILOCK_SHARED);
return 0; return 0;
...@@ -414,7 +417,7 @@ xfs_setattr( ...@@ -414,7 +417,7 @@ xfs_setattr(
} else { } else {
if (DM_EVENT_ENABLED (vp->v_vfsp, ip, DM_EVENT_TRUNCATE) && if (DM_EVENT_ENABLED (vp->v_vfsp, ip, DM_EVENT_TRUNCATE) &&
!(flags & ATTR_DMI)) { !(flags & ATTR_DMI)) {
code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, bdp, code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, vp,
vap->va_size, 0, AT_DELAY_FLAG(flags), NULL); vap->va_size, 0, AT_DELAY_FLAG(flags), NULL);
if (code) { if (code) {
lock_flags = 0; lock_flags = 0;
...@@ -4162,7 +4165,7 @@ xfs_alloc_file_space( ...@@ -4162,7 +4165,7 @@ xfs_alloc_file_space(
end_dmi_offset = offset+len; end_dmi_offset = offset+len;
if (end_dmi_offset > ip->i_d.di_size) if (end_dmi_offset > ip->i_d.di_size)
end_dmi_offset = ip->i_d.di_size; end_dmi_offset = ip->i_d.di_size;
error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, XFS_ITOBHV(ip), error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, XFS_ITOV(ip),
offset, end_dmi_offset - offset, offset, end_dmi_offset - offset,
0, NULL); 0, NULL);
if (error) if (error)
...@@ -4409,7 +4412,7 @@ xfs_free_file_space( ...@@ -4409,7 +4412,7 @@ xfs_free_file_space(
DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_WRITE)) { DM_EVENT_ENABLED(XFS_MTOVFS(mp), ip, DM_EVENT_WRITE)) {
if (end_dmi_offset > ip->i_d.di_size) if (end_dmi_offset > ip->i_d.di_size)
end_dmi_offset = ip->i_d.di_size; end_dmi_offset = ip->i_d.di_size;
error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, XFS_ITOBHV(ip), error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, XFS_ITOV(ip),
offset, end_dmi_offset - offset, offset, end_dmi_offset - offset,
AT_DELAY_FLAG(attr_flags), NULL); AT_DELAY_FLAG(attr_flags), NULL);
if (error) if (error)
......
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