Commit d90199f2 authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/home/hch/BK/xfs/linux-2.5

into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
parents f7f05f6a 2d05b4c9
......@@ -32,7 +32,8 @@
# Makefile for XFS on Linux.
#
# This needs -I because everything does #include <xfs.h> instead of "xfs.h".
# This needs -I. because everything does #include <xfs.h> instead of "xfs.h".
# The code is wrong, local files should be included using "xfs.h", not <xfs.h>
# but I am not going to change every file at the moment.
EXTRA_CFLAGS += -Ifs/xfs -funsigned-char
......
......@@ -113,6 +113,32 @@ linvfs_write(
}
STATIC ssize_t
linvfs_aio_read(
struct kiocb *iocb,
char *buf,
size_t count,
loff_t pos)
{
struct iovec iov = {buf, count};
return linvfs_readv(iocb->ki_filp, &iov, 1, &iocb->ki_pos);
}
STATIC ssize_t
linvfs_aio_write(
struct kiocb *iocb,
const char *buf,
size_t count,
loff_t pos)
{
struct iovec iov = {(void *)buf, count};
return linvfs_writev(iocb->ki_filp, &iov, 1, &iocb->ki_pos);
}
STATIC int
linvfs_open(
struct inode *inode,
......@@ -320,6 +346,8 @@ struct file_operations linvfs_file_operations = {
.write = linvfs_write,
.readv = linvfs_readv,
.writev = linvfs_writev,
.aio_read = linvfs_aio_read,
.aio_write = linvfs_aio_write,
.ioctl = linvfs_ioctl,
.mmap = linvfs_file_mmap,
.open = linvfs_open,
......
......@@ -64,5 +64,6 @@ EXPORT_SYMBOL(xfs_Gqm);
EXPORT_SYMBOL(xfs_next_bit);
EXPORT_SYMBOL(xfs_contig_bits);
EXPORT_SYMBOL(xfs_bmbt_get_all);
#if ARCH_CONVERT != ARCH_NOCONVERT
EXPORT_SYMBOL(xfs_bmbt_disk_get_all);
#endif
......@@ -2135,19 +2135,6 @@ xfs_alloc_put_freelist(
(int)((xfs_caddr_t)blockp - (xfs_caddr_t)agfl),
(int)((xfs_caddr_t)blockp - (xfs_caddr_t)agfl +
sizeof(xfs_agblock_t) - 1));
/*
* Since blocks move to the free list without the coordination
* used in xfs_bmap_finish, we can't allow block to be available
* for reallocation and non-transaction writing (user data)
* until we know that the transaction that moved it to the free
* list is permanently on disk. We track the blocks by declaring
* these blocks as "busy"; the busy list is maintained on a per-ag
* basis and each transaction records which entries should be removed
* when the iclog commits to disk. If a busy block is allocated,
* the iclog is pushed up to the LSN that freed the block.
*/
xfs_alloc_mark_busy(tp, INT_GET(agf->agf_seqno, ARCH_CONVERT), bno, 1);
return 0;
}
......
......@@ -223,6 +223,23 @@ xfs_alloc_delrec(
if ((error = xfs_alloc_put_freelist(cur->bc_tp,
cur->bc_private.a.agbp, NULL, bno)))
return error;
/*
* Since blocks move to the free list without the
* coordination used in xfs_bmap_finish, we can't allow
* block to be available for reallocation and
* non-transaction writing (user data) until we know
* that the transaction that moved it to the free list
* is permanently on disk. We track the blocks by
* declaring these blocks as "busy"; the busy list is
* maintained on a per-ag basis and each transaction
* records which entries should be removed when the
* iclog commits to disk. If a busy block is
* allocated, the iclog is pushed up to the LSN
* that freed the block.
*/
xfs_alloc_mark_busy(cur->bc_tp,
INT_GET(agf->agf_seqno, ARCH_CONVERT), bno, 1);
xfs_trans_agbtree_delta(cur->bc_tp, -1);
xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp,
XFS_AGF_ROOTS | XFS_AGF_LEVELS);
......@@ -528,6 +545,21 @@ xfs_alloc_delrec(
if ((error = xfs_alloc_put_freelist(cur->bc_tp, cur->bc_private.a.agbp,
NULL, rbno)))
return error;
/*
* Since blocks move to the free list without the coordination
* used in xfs_bmap_finish, we can't allow block to be available
* for reallocation and non-transaction writing (user data)
* until we know that the transaction that moved it to the free
* list is permanently on disk. We track the blocks by declaring
* these blocks as "busy"; the busy list is maintained on a
* per-ag basis and each transaction records which entries
* should be removed when the iclog commits to disk. If a
* busy block is allocated, the iclog is pushed up to the
* LSN that freed the block.
*/
xfs_alloc_mark_busy(cur->bc_tp,
INT_GET(agf->agf_seqno, ARCH_CONVERT), bno, 1);
xfs_trans_agbtree_delta(cur->bc_tp, -1);
/*
* Adjust the current level's cursor so that we're left referring
......
......@@ -253,11 +253,7 @@ xfs_bmbt_trace_cursor(
xfs_bmbt_trace_enter(func, cur, s, XFS_BMBT_KTRACE_CUR, line,
(cur->bc_nlevels << 24) | (cur->bc_private.b.flags << 16) |
cur->bc_private.b.allocated,
#if BMBT_USE_64
INT_GET(r.l0, ARCH_CONVERT) >> 32, (int)INT_GET(r.l0, ARCH_CONVERT), INT_GET(r.l1, ARCH_CONVERT) >> 32, (int)INT_GET(r.l1, ARCH_CONVERT),
#else
INT_GET(r.l0, ARCH_CONVERT), INT_GET(r.l1, ARCH_CONVERT), INT_GET(r.l2, ARCH_CONVERT), INT_GET(r.l3, ARCH_CONVERT),
#endif
(unsigned long)cur->bc_bufs[0], (unsigned long)cur->bc_bufs[1],
(unsigned long)cur->bc_bufs[2], (unsigned long)cur->bc_bufs[3],
(cur->bc_ptrs[0] << 16) | cur->bc_ptrs[1],
......
......@@ -658,8 +658,8 @@ xfs_bmbt_disk_set_allf(
#else
#define xfs_bmbt_disk_set_all(r, s) \
xfs_bmbt_set_all(r, s)
#define xfs_bmbt_disk_set_allf(r, 0, b, c, v) \
xfs_bmbt_set_allf(r, 0, b, c, v)
#define xfs_bmbt_disk_set_allf(r, o, b, c, v) \
xfs_bmbt_set_allf(r, o, b, c, v)
#endif
void
......
......@@ -602,9 +602,12 @@ xfs_iformat_extents(
int whichfork)
{
xfs_ifork_t *ifp;
int nex, i;
int nex;
int real_size;
int size;
#if ARCH_CONVERT != ARCH_NOCONVERT
int i;
#endif
xfs_bmbt_rec_t *ep, *dp;
ifp = XFS_IFORK_PTR(ip, whichfork);
......
......@@ -126,7 +126,7 @@ typedef struct xfs_inode_log_format_v1 {
#ifdef __KERNEL__
struct xfs_buf;
struct xfs_bmbt_rec_32;
struct xfs_bmbt_rec_64;
struct xfs_inode;
struct xfs_mount;
......@@ -141,9 +141,9 @@ typedef struct xfs_inode_log_item {
unsigned short ili_flags; /* misc flags */
unsigned short ili_logged; /* flushed logged data */
unsigned int ili_last_fields; /* fields when flushed */
struct xfs_bmbt_rec_32 *ili_extents_buf; /* array of logged
struct xfs_bmbt_rec_64 *ili_extents_buf; /* array of logged
data exts */
struct xfs_bmbt_rec_32 *ili_aextents_buf; /* array of logged
struct xfs_bmbt_rec_64 *ili_aextents_buf; /* array of logged
attr exts */
unsigned int ili_pushbuf_flag; /* one bit used in push_ail */
......
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