Commit f53a3af7 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.5
parents 63360427 35146523
......@@ -225,7 +225,8 @@ probe_unwritten_page(
page_buf_bmap_t *mp,
page_buf_t *pb,
unsigned long max_offset,
unsigned long *fsbs)
unsigned long *fsbs,
unsigned int bbits)
{
struct page *page;
......@@ -248,6 +249,7 @@ probe_unwritten_page(
break;
if (p_offset >= max_offset)
break;
map_buffer_at_offset(page, bh, p_offset, bbits, mp);
set_buffer_unwritten_io(bh);
bh->b_private = pb;
p_offset += bh->b_size;
......@@ -455,13 +457,14 @@ map_unwritten(
if (bh == head) {
struct address_space *mapping = inode->i_mapping;
unsigned long tindex, tloff, tlast, bs;
unsigned int bbits = inode->i_blkbits;
struct page *page;
tlast = i_size_read(inode) >> PAGE_CACHE_SHIFT;
tloff = min(tlast, start_page->index + pb->pb_page_count - 1);
for (tindex = start_page->index + 1; tindex < tloff; tindex++) {
page = probe_unwritten_page(mapping, tindex, mp, pb,
PAGE_CACHE_SIZE, &bs);
PAGE_CACHE_SIZE, &bs, bbits);
if (!page)
break;
nblocks += bs;
......@@ -472,7 +475,7 @@ map_unwritten(
if (tindex == tlast &&
(tloff = (i_size_read(inode) & (PAGE_CACHE_SIZE - 1)))) {
page = probe_unwritten_page(mapping, tindex, mp, pb,
tloff, &bs);
tloff, &bs, bbits);
if (page) {
nblocks += bs;
atomic_add(bs, &pb->pb_io_remaining);
......@@ -560,7 +563,8 @@ convert_page(
offset = i << bbits;
if (!(PageUptodate(page) || buffer_uptodate(bh)))
continue;
if (buffer_mapped(bh) && !buffer_delay(bh) && all_bh) {
if (buffer_mapped(bh) && all_bh &&
!buffer_unwritten(bh) && !buffer_delay(bh)) {
if (startio && (offset < end)) {
lock_buffer(bh);
bh_arr[index++] = bh;
......@@ -581,7 +585,7 @@ convert_page(
ASSERT(tmp->pbm_flags & PBMF_UNWRITTEN);
map_unwritten(inode, page, head, bh,
offset, bbits, tmp, all_bh);
} else {
} else if (! (buffer_unwritten(bh) && buffer_locked(bh))) {
map_buffer_at_offset(page, bh, offset, bbits, tmp);
if (buffer_unwritten(bh)) {
set_buffer_unwritten_io(bh);
......
......@@ -156,7 +156,7 @@ xfs_iomap(
if (flags & BMAP_IGNSTATE)
bmap_flags |= XFS_BMAPI_IGSTATE;
break;
case PBF_WRITE:
case BMAP_WRITE:
lockmode = XFS_ILOCK_EXCL|XFS_EXTSIZE_WR;
bmap_flags = 0;
XFS_ILOCK(mp, io, lockmode);
......
......@@ -189,10 +189,10 @@ typedef struct xfs_da_args {
int index2; /* index of 2nd attr in blk */
xfs_dablk_t rmtblkno2; /* remote attr value starting blkno */
int rmtblkcnt2; /* remote attr value block count */
int justcheck : 1; /* T/F: check for ok with no space */
int rename : 1; /* T/F: this is an atomic rename op */
int addname : 1; /* T/F: this is an add operation */
int oknoent : 1; /* T/F: ok to return ENOENT, else die */
unsigned char justcheck; /* T/F: check for ok with no space */
unsigned char rename; /* T/F: this is an atomic rename op */
unsigned char addname; /* T/F: this is an add operation */
unsigned char oknoent; /* T/F: ok to return ENOENT, else die */
} xfs_da_args_t;
/*
......@@ -252,10 +252,10 @@ typedef struct xfs_da_state {
unsigned int node_ents; /* how many entries in danode */
xfs_da_state_path_t path; /* search/split paths */
xfs_da_state_path_t altpath; /* alternate path for join */
unsigned int inleaf : 1; /* insert into 1->lf, 0->splf */
unsigned int holeok : 1; /* T/F: can deal with a hole */
unsigned int extravalid : 1; /* T/F: extrablk is in use */
unsigned int extraafter : 1; /* T/F: extrablk is after new */
unsigned char inleaf; /* insert into 1->lf, 0->splf */
unsigned char holeok; /* T/F: can deal with a hole */
unsigned char extravalid; /* T/F: extrablk is in use */
unsigned char extraafter; /* T/F: extrablk is after new */
xfs_da_state_blk_t extrablk; /* for double-splits on leafs */
/* for dirv2 extrablk is data */
} xfs_da_state_t;
......
......@@ -172,7 +172,7 @@ xfs_growfs_data_private(
if (nb < mp->m_sb.sb_dblocks)
return XFS_ERROR(EINVAL);
}
new = in->newblocks - mp->m_sb.sb_dblocks;
new = nb - mp->m_sb.sb_dblocks;
oagcount = mp->m_sb.sb_agcount;
if (nagcount > oagcount) {
down_write(&mp->m_peraglock);
......
......@@ -3427,8 +3427,8 @@ xlog_verify_iclog(xlog_t *log,
if (syncing == B_FALSE || (field_offset & 0x1ff)) {
clientid = ophead->oh_clientid;
} else {
idx = BTOBB((xfs_caddr_t)&(ophead->oh_clientid) - iclog->ic_datap);
if (idx > (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) {
idx = BTOBBT((xfs_caddr_t)&(ophead->oh_clientid) - iclog->ic_datap);
if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) {
j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
clientid = GET_CLIENT_ID(xhdr[j].hic_xheader.xh_cycle_data[k], ARCH_CONVERT);
......@@ -3445,9 +3445,9 @@ xlog_verify_iclog(xlog_t *log,
if (syncing == B_FALSE || (field_offset & 0x1ff)) {
op_len = INT_GET(ophead->oh_len, ARCH_CONVERT);
} else {
idx = BTOBB((__psint_t)&ophead->oh_len -
idx = BTOBBT((__psint_t)&ophead->oh_len -
(__psint_t)iclog->ic_datap);
if (idx > (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) {
if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) {
j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
op_len = INT_GET(xhdr[j].hic_xheader.xh_cycle_data[k], ARCH_CONVERT);
......
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