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(
delta -= mp->pbm_offset;
delta >>= block_bits;
sector_shift = block_bits - 9;
sector_shift = block_bits - BBSHIFT;
bn = mp->pbm_bn >> sector_shift;
bn += delta;
ASSERT((bn << sector_shift) >= mp->pbm_bn);
......@@ -285,7 +285,7 @@ probe_unmapped_cluster(
total += bh->b_size;
} 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.
*/
if (bh == head) {
......@@ -735,8 +735,8 @@ page_state_convert(
page_dirty = 0;
}
} else if (startio) {
if (buffer_uptodate(bh)) {
lock_buffer(bh);
if (buffer_uptodate(bh) &&
!test_and_set_bit(BH_Lock, &bh->b_state)) {
bh_arr[cnt++] = bh;
page_dirty = 0;
}
......@@ -759,8 +759,7 @@ page_state_convert(
}
if (mp) {
cluster_write(inode, page->index + 1, mp,
startio, unmapped);
cluster_write(inode, page->index + 1, mp, startio, unmapped);
}
return page_dirty;
......@@ -769,7 +768,7 @@ page_state_convert(
for (i = 0; i < cnt; i++) {
unlock_buffer(bh_arr[i]);
}
/*
* If it's delalloc and we have nowhere to put it,
* throw it away, unless the lower layers told
......@@ -812,8 +811,7 @@ linvfs_get_block_core(
size = 1 << inode->i_blkbits;
VOP_BMAP(vp, offset, size,
create ? flags : PBF_READ,
(struct page_buf_bmap_s *)&pbmap, &retpbbm, error);
create ? flags : PBF_READ, &pbmap, &retpbbm, error);
if (error)
return -error;
......@@ -831,7 +829,7 @@ linvfs_get_block_core(
delta = offset - pbmap.pbm_offset;
delta >>= inode->i_blkbits;
bn = pbmap.pbm_bn >> (inode->i_blkbits - 9);
bn = pbmap.pbm_bn >> (inode->i_blkbits - BBSHIFT);
bn += delta;
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
* under the terms of version 2 of the GNU General Public License as
......@@ -136,6 +136,7 @@ linvfs_aio_write(
return linvfs_writev(iocb->ki_filp, &iov, 1, &iocb->ki_pos);
}
STATIC ssize_t
linvfs_sendfile(
struct file *filp,
......@@ -199,9 +200,7 @@ linvfs_fsync(
flags |= FSYNC_DATA;
ASSERT(vp);
VOP_FSYNC(vp, flags, NULL, (xfs_off_t)0, (xfs_off_t)-1, error);
return -error;
}
......@@ -288,6 +287,7 @@ linvfs_readdir(
return -error;
}
STATIC int
linvfs_file_mmap(
struct file *filp,
......
......@@ -39,11 +39,6 @@
#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
* 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
* 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
* under the terms of version 2 of the GNU General Public License as
......
......@@ -257,7 +257,7 @@ xfs_showargs(
};
struct proc_xfs_info *xfs_infop;
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++) {
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 {
extern struct bhv_vfsops xfs_dmops;
extern void xfs_dm_init(void);
extern void xfs_dm_exit(void);
extern int dmapi_init(void);
extern void dmapi_uninit(void);
#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
* under the terms of version 2 of the GNU General Public License as
......
......@@ -153,39 +153,55 @@ int
xfs_bioerror(
struct xfs_buf *b);
/*
* XFS I/O core functions
*/
extern int xfs_bioerror_relse(struct xfs_buf *);
int
xfs_bioerror_relse(
struct xfs_buf *b);
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
xfs_rwlock(
bhv_desc_t *bdp,
vrwlock_t write_lock);
bhv_desc_t *bdp,
vrwlock_t write_lock);
void
xfs_rwunlock(
bhv_desc_t *bdp,
vrwlock_t write_lock);
bhv_desc_t *bdp,
vrwlock_t write_lock);
int
xfs_read_buf(
struct xfs_mount *mp,
xfs_buftarg_t *target,
xfs_daddr_t blkno,
int len,
uint flags,
struct xfs_buf **bpp);
xfs_change_file_space(
bhv_desc_t *bdp,
int cmd,
xfs_flock64_t *bf,
xfs_off_t offset,
cred_t *credp,
int flags);
void
xfs_ioerror_alert(
char *func,
struct xfs_mount *mp,
xfs_buf_t *bp,
xfs_daddr_t blkno);
int
xfs_set_dmattrs(
bhv_desc_t *bdp,
u_int evmask,
u_int16_t state,
cred_t *credp);
#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