Commit 697d719c authored by Christoph Hellwig's avatar Christoph Hellwig

[XFS] merge over some lost changes from the XFS tree

parent 40198cf1
...@@ -163,7 +163,7 @@ map_buffer_at_offset( ...@@ -163,7 +163,7 @@ map_buffer_at_offset(
delta -= mp->pbm_offset; delta -= mp->pbm_offset;
delta >>= block_bits; delta >>= block_bits;
sector_shift = block_bits - 9; sector_shift = block_bits - BBSHIFT;
bn = mp->pbm_bn >> sector_shift; bn = mp->pbm_bn >> sector_shift;
bn += delta; bn += delta;
ASSERT((bn << sector_shift) >= mp->pbm_bn); ASSERT((bn << sector_shift) >= mp->pbm_bn);
...@@ -285,7 +285,7 @@ probe_unmapped_cluster( ...@@ -285,7 +285,7 @@ probe_unmapped_cluster(
total += bh->b_size; total += bh->b_size;
} while ((bh = bh->b_this_page) != head); } while ((bh = bh->b_this_page) != head);
/* if we reached the end of the page, sum forwards in /* If we reached the end of the page, sum forwards in
* following pages. * following pages.
*/ */
if (bh == head) { if (bh == head) {
...@@ -735,8 +735,8 @@ page_state_convert( ...@@ -735,8 +735,8 @@ page_state_convert(
page_dirty = 0; page_dirty = 0;
} }
} else if (startio) { } else if (startio) {
if (buffer_uptodate(bh)) { if (buffer_uptodate(bh) &&
lock_buffer(bh); !test_and_set_bit(BH_Lock, &bh->b_state)) {
bh_arr[cnt++] = bh; bh_arr[cnt++] = bh;
page_dirty = 0; page_dirty = 0;
} }
...@@ -759,8 +759,7 @@ page_state_convert( ...@@ -759,8 +759,7 @@ page_state_convert(
} }
if (mp) { if (mp) {
cluster_write(inode, page->index + 1, mp, cluster_write(inode, page->index + 1, mp, startio, unmapped);
startio, unmapped);
} }
return page_dirty; return page_dirty;
...@@ -769,7 +768,7 @@ page_state_convert( ...@@ -769,7 +768,7 @@ page_state_convert(
for (i = 0; i < cnt; i++) { for (i = 0; i < cnt; i++) {
unlock_buffer(bh_arr[i]); unlock_buffer(bh_arr[i]);
} }
/* /*
* If it's delalloc and we have nowhere to put it, * If it's delalloc and we have nowhere to put it,
* throw it away, unless the lower layers told * throw it away, unless the lower layers told
...@@ -812,8 +811,7 @@ linvfs_get_block_core( ...@@ -812,8 +811,7 @@ linvfs_get_block_core(
size = 1 << inode->i_blkbits; size = 1 << inode->i_blkbits;
VOP_BMAP(vp, offset, size, VOP_BMAP(vp, offset, size,
create ? flags : PBF_READ, create ? flags : PBF_READ, &pbmap, &retpbbm, error);
(struct page_buf_bmap_s *)&pbmap, &retpbbm, error);
if (error) if (error)
return -error; return -error;
...@@ -831,7 +829,7 @@ linvfs_get_block_core( ...@@ -831,7 +829,7 @@ linvfs_get_block_core(
delta = offset - pbmap.pbm_offset; delta = offset - pbmap.pbm_offset;
delta >>= inode->i_blkbits; delta >>= inode->i_blkbits;
bn = pbmap.pbm_bn >> (inode->i_blkbits - 9); bn = pbmap.pbm_bn >> (inode->i_blkbits - BBSHIFT);
bn += delta; bn += delta;
bh_result->b_blocknr = bn; bh_result->b_blocknr = bn;
......
/* /*
* Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
* *
* This program is free software; you can redistribute it and/or modify it * 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 * under the terms of version 2 of the GNU General Public License as
...@@ -136,6 +136,7 @@ linvfs_aio_write( ...@@ -136,6 +136,7 @@ linvfs_aio_write(
return linvfs_writev(iocb->ki_filp, &iov, 1, &iocb->ki_pos); return linvfs_writev(iocb->ki_filp, &iov, 1, &iocb->ki_pos);
} }
STATIC ssize_t STATIC ssize_t
linvfs_sendfile( linvfs_sendfile(
struct file *filp, struct file *filp,
...@@ -199,9 +200,7 @@ linvfs_fsync( ...@@ -199,9 +200,7 @@ linvfs_fsync(
flags |= FSYNC_DATA; flags |= FSYNC_DATA;
ASSERT(vp); ASSERT(vp);
VOP_FSYNC(vp, flags, NULL, (xfs_off_t)0, (xfs_off_t)-1, error); VOP_FSYNC(vp, flags, NULL, (xfs_off_t)0, (xfs_off_t)-1, error);
return -error; return -error;
} }
...@@ -288,6 +287,7 @@ linvfs_readdir( ...@@ -288,6 +287,7 @@ linvfs_readdir(
return -error; return -error;
} }
STATIC int STATIC int
linvfs_file_mmap( linvfs_file_mmap(
struct file *filp, struct file *filp,
......
...@@ -39,11 +39,6 @@ ...@@ -39,11 +39,6 @@
#include <linux/pagemap.h> #include <linux/pagemap.h>
extern int xfs_change_file_space(bhv_desc_t *, int,
xfs_flock64_t *, xfs_off_t, cred_t *, int);
extern int xfs_set_dmattrs(bhv_desc_t *, u_int, u_int16_t, cred_t *);
/* /*
* xfs_find_handle maps from userspace xfs_fsop_handlereq structure to * xfs_find_handle maps from userspace xfs_fsop_handlereq structure to
* a file or fs handle. * a file or fs handle.
......
/* /*
* Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
* *
* This program is free software; you can redistribute it and/or modify it * 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 * under the terms of version 2 of the GNU General Public License as
......
/* /*
* Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
* *
* This program is free software; you can redistribute it and/or modify it * 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 * under the terms of version 2 of the GNU General Public License as
......
...@@ -257,7 +257,7 @@ xfs_showargs( ...@@ -257,7 +257,7 @@ xfs_showargs(
}; };
struct proc_xfs_info *xfs_infop; struct proc_xfs_info *xfs_infop;
struct xfs_mount *mp = XFS_BHVTOM(bhv); struct xfs_mount *mp = XFS_BHVTOM(bhv);
char b[BDEVNAME_SIZE]; char b[BDEVNAME_SIZE];
for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) { for (xfs_infop = xfs_info; xfs_infop->flag; xfs_infop++) {
if (mp->m_flags & xfs_infop->flag) if (mp->m_flags & xfs_infop->flag)
......
/*
* Copyright (c) 2000-2003 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/
*/
#ifndef __XFS_SUPPORT_ATOMIC_H__
#define __XFS_SUPPORT_ATOMIC_H__
#include <linux/version.h>
#include <linux/time.h>
#include <linux/wait.h>
#include <linux/sched.h>
#include <asm/atomic.h>
#include <asm/semaphore.h>
/*
* This is used for two variables in XFS, one of which is a debug trace
* buffer index. They are not accessed via any other atomic operations
* so this is safe. All other atomic increments and decrements in XFS
* now use the Linux built-in functions.
*/
extern spinlock_t xfs_atomic_spin;
static __inline__ int atomicIncWithWrap(int *ip, int val)
{
unsigned long flags;
int ret;
spin_lock_irqsave(&xfs_atomic_spin, flags);
ret = *ip;
(*ip)++;
if (*ip == val) *ip = 0;
spin_unlock_irqrestore(&xfs_atomic_spin, flags);
return ret;
}
#endif /* __XFS_SUPPORT_ATOMIC_H__ */
...@@ -186,7 +186,7 @@ typedef enum { ...@@ -186,7 +186,7 @@ typedef enum {
extern struct bhv_vfsops xfs_dmops; extern struct bhv_vfsops xfs_dmops;
extern void xfs_dm_init(void); extern int dmapi_init(void);
extern void xfs_dm_exit(void); extern void dmapi_uninit(void);
#endif /* __XFS_DMAPI_H__ */ #endif /* __XFS_DMAPI_H__ */
/* /*
* Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
* *
* This program is free software; you can redistribute it and/or modify it * 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 * under the terms of version 2 of the GNU General Public License as
......
...@@ -153,39 +153,55 @@ int ...@@ -153,39 +153,55 @@ int
xfs_bioerror( xfs_bioerror(
struct xfs_buf *b); struct xfs_buf *b);
/* int
* XFS I/O core functions xfs_bioerror_relse(
*/ struct xfs_buf *b);
extern int xfs_bioerror_relse(struct xfs_buf *);
int
xfs_read_buf(
struct xfs_mount *mp,
xfs_buftarg_t *target,
xfs_daddr_t blkno,
int len,
uint flags,
struct xfs_buf **bpp);
void
xfs_ioerror_alert(
char *func,
struct xfs_mount *mp,
xfs_buf_t *bp,
xfs_daddr_t blkno);
/* /*
* Needed by xfs_rw.c * Prototypes for functions in xfs_vnodeops.c.
*/ */
int int
xfs_rwlock( xfs_rwlock(
bhv_desc_t *bdp, bhv_desc_t *bdp,
vrwlock_t write_lock); vrwlock_t write_lock);
void void
xfs_rwunlock( xfs_rwunlock(
bhv_desc_t *bdp, bhv_desc_t *bdp,
vrwlock_t write_lock); vrwlock_t write_lock);
int int
xfs_read_buf( xfs_change_file_space(
struct xfs_mount *mp, bhv_desc_t *bdp,
xfs_buftarg_t *target, int cmd,
xfs_daddr_t blkno, xfs_flock64_t *bf,
int len, xfs_off_t offset,
uint flags, cred_t *credp,
struct xfs_buf **bpp); int flags);
void int
xfs_ioerror_alert( xfs_set_dmattrs(
char *func, bhv_desc_t *bdp,
struct xfs_mount *mp, u_int evmask,
xfs_buf_t *bp, u_int16_t state,
xfs_daddr_t blkno); cred_t *credp);
#endif /* __XFS_RW_H__ */ #endif /* __XFS_RW_H__ */
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