Skip to content

Commit

Permalink
Merge git://oss.sgi.com:8090/xfs/linux-2.6
Browse files Browse the repository at this point in the history
* git://oss.sgi.com:8090/xfs/linux-2.6: (45 commits)
  [XFS] Fix use after free in xfs_log_done().
  [XFS] Make xfs_bmap_*_count_leaves void.
  [XFS] Use KM_NOFS for debug trace buffers
  [XFS] use KM_MAYFAIL in xfs_mountfs
  [XFS] refactor xfs_mount_free
  [XFS] don't call xfs_freesb from xfs_unmountfs
  [XFS] xfs_unmountfs should return void
  [XFS] cleanup xfs_mountfs
  [XFS] move root inode IRELE into xfs_unmountfs
  [XFS] stop using file_update_time
  [XFS] optimize xfs_ichgtime
  [XFS] update timestamp in xfs_ialloc manually
  [XFS] remove the sema_t from XFS.
  [XFS] replace dquot flush semaphore with a completion
  [XFS] replace inode flush semaphore with a completion
  [XFS] extend completions to provide XFS object flush requirements
  [XFS] replace the XFS buf iodone semaphore with a completion
  [XFS] clean up stale references to semaphores
  [XFS] use get_unaligned_* helpers
  [XFS] Fix compile failure in xfs_buf_trace()
  ...
  • Loading branch information
Linus Torvalds committed Aug 13, 2008
2 parents 3e11acd + c6a7b0f commit 9ea319b
Show file tree
Hide file tree
Showing 62 changed files with 883 additions and 1,326 deletions.
52 changes: 0 additions & 52 deletions fs/xfs/linux-2.6/sema.h

This file was deleted.

3 changes: 1 addition & 2 deletions fs/xfs/linux-2.6/xfs_aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,14 @@ xfs_page_trace(
unsigned long pgoff)
{
xfs_inode_t *ip;
bhv_vnode_t *vp = vn_from_inode(inode);
loff_t isize = i_size_read(inode);
loff_t offset = page_offset(page);
int delalloc = -1, unmapped = -1, unwritten = -1;

if (page_has_buffers(page))
xfs_count_page_state(page, &delalloc, &unmapped, &unwritten);

ip = xfs_vtoi(vp);
ip = XFS_I(inode);
if (!ip->i_rwtrace)
return;

Expand Down
16 changes: 6 additions & 10 deletions fs/xfs/linux-2.6/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ xfs_buf_trace(
bp, id,
(void *)(unsigned long)bp->b_flags,
(void *)(unsigned long)bp->b_hold.counter,
(void *)(unsigned long)bp->b_sema.count.counter,
(void *)(unsigned long)bp->b_sema.count,
(void *)current,
data, ra,
(void *)(unsigned long)((bp->b_file_offset>>32) & 0xffffffff),
Expand Down Expand Up @@ -253,7 +253,7 @@ _xfs_buf_initialize(

memset(bp, 0, sizeof(xfs_buf_t));
atomic_set(&bp->b_hold, 1);
init_MUTEX_LOCKED(&bp->b_iodonesema);
init_completion(&bp->b_iowait);
INIT_LIST_HEAD(&bp->b_list);
INIT_LIST_HEAD(&bp->b_hash_list);
init_MUTEX_LOCKED(&bp->b_sema); /* held, no waiters */
Expand Down Expand Up @@ -838,6 +838,7 @@ xfs_buf_rele(
return;
}

ASSERT(atomic_read(&bp->b_hold) > 0);
if (atomic_dec_and_lock(&bp->b_hold, &hash->bh_lock)) {
if (bp->b_relse) {
atomic_inc(&bp->b_hold);
Expand All @@ -851,11 +852,6 @@ xfs_buf_rele(
spin_unlock(&hash->bh_lock);
xfs_buf_free(bp);
}
} else {
/*
* Catch reference count leaks
*/
ASSERT(atomic_read(&bp->b_hold) >= 0);
}
}

Expand Down Expand Up @@ -1037,7 +1033,7 @@ xfs_buf_ioend(
xfs_buf_iodone_work(&bp->b_iodone_work);
}
} else {
up(&bp->b_iodonesema);
complete(&bp->b_iowait);
}
}

Expand Down Expand Up @@ -1275,7 +1271,7 @@ xfs_buf_iowait(
XB_TRACE(bp, "iowait", 0);
if (atomic_read(&bp->b_io_remaining))
blk_run_address_space(bp->b_target->bt_mapping);
down(&bp->b_iodonesema);
wait_for_completion(&bp->b_iowait);
XB_TRACE(bp, "iowaited", (long)bp->b_error);
return bp->b_error;
}
Expand Down Expand Up @@ -1799,7 +1795,7 @@ int __init
xfs_buf_init(void)
{
#ifdef XFS_BUF_TRACE
xfs_buf_trace_buf = ktrace_alloc(XFS_BUF_TRACE_SIZE, KM_SLEEP);
xfs_buf_trace_buf = ktrace_alloc(XFS_BUF_TRACE_SIZE, KM_NOFS);
#endif

xfs_buf_zone = kmem_zone_init_flags(sizeof(xfs_buf_t), "xfs_buf",
Expand Down
4 changes: 2 additions & 2 deletions fs/xfs/linux-2.6/xfs_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ typedef struct xfs_buf {
xfs_buf_iodone_t b_iodone; /* I/O completion function */
xfs_buf_relse_t b_relse; /* releasing function */
xfs_buf_bdstrat_t b_strat; /* pre-write function */
struct semaphore b_iodonesema; /* Semaphore for I/O waiters */
struct completion b_iowait; /* queue for I/O waiters */
void *b_fspriv;
void *b_fspriv2;
void *b_fspriv3;
Expand Down Expand Up @@ -352,7 +352,7 @@ extern void xfs_buf_trace(xfs_buf_t *, char *, void *, void *);
#define XFS_BUF_CPSEMA(bp) (xfs_buf_cond_lock(bp) == 0)
#define XFS_BUF_VSEMA(bp) xfs_buf_unlock(bp)
#define XFS_BUF_PSEMA(bp,x) xfs_buf_lock(bp)
#define XFS_BUF_V_IODONESEMA(bp) up(&bp->b_iodonesema);
#define XFS_BUF_FINISH_IOWAIT(bp) complete(&bp->b_iowait);

#define XFS_BUF_SET_TARGET(bp, target) ((bp)->b_target = (target))
#define XFS_BUF_TARGET(bp) ((bp)->b_target)
Expand Down
10 changes: 5 additions & 5 deletions fs/xfs/linux-2.6/xfs_export.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ xfs_nfs_get_inode(
}

xfs_iunlock(ip, XFS_ILOCK_SHARED);
return ip->i_vnode;
return VFS_I(ip);
}

STATIC struct dentry *
Expand Down Expand Up @@ -167,7 +167,7 @@ xfs_fs_fh_to_dentry(struct super_block *sb, struct fid *fid,
if (!inode)
return NULL;
if (IS_ERR(inode))
return ERR_PTR(PTR_ERR(inode));
return ERR_CAST(inode);
result = d_alloc_anon(inode);
if (!result) {
iput(inode);
Expand Down Expand Up @@ -198,7 +198,7 @@ xfs_fs_fh_to_parent(struct super_block *sb, struct fid *fid,
if (!inode)
return NULL;
if (IS_ERR(inode))
return ERR_PTR(PTR_ERR(inode));
return ERR_CAST(inode);
result = d_alloc_anon(inode);
if (!result) {
iput(inode);
Expand All @@ -219,9 +219,9 @@ xfs_fs_get_parent(
if (unlikely(error))
return ERR_PTR(-error);

parent = d_alloc_anon(cip->i_vnode);
parent = d_alloc_anon(VFS_I(cip));
if (unlikely(!parent)) {
iput(cip->i_vnode);
iput(VFS_I(cip));
return ERR_PTR(-ENOMEM);
}
return parent;
Expand Down
6 changes: 3 additions & 3 deletions fs/xfs/linux-2.6/xfs_fs_subr.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ xfs_tosspages(
xfs_off_t last,
int fiopt)
{
struct address_space *mapping = ip->i_vnode->i_mapping;
struct address_space *mapping = VFS_I(ip)->i_mapping;

if (mapping->nrpages)
truncate_inode_pages(mapping, first);
Expand All @@ -44,7 +44,7 @@ xfs_flushinval_pages(
xfs_off_t last,
int fiopt)
{
struct address_space *mapping = ip->i_vnode->i_mapping;
struct address_space *mapping = VFS_I(ip)->i_mapping;
int ret = 0;

if (mapping->nrpages) {
Expand All @@ -64,7 +64,7 @@ xfs_flush_pages(
uint64_t flags,
int fiopt)
{
struct address_space *mapping = ip->i_vnode->i_mapping;
struct address_space *mapping = VFS_I(ip)->i_mapping;
int ret = 0;
int ret2;

Expand Down
4 changes: 2 additions & 2 deletions fs/xfs/linux-2.6/xfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ xfs_vget_fsop_handlereq(

xfs_iunlock(ip, XFS_ILOCK_SHARED);

*inode = XFS_ITOV(ip);
*inode = VFS_I(ip);
return 0;
}

Expand Down Expand Up @@ -927,7 +927,7 @@ STATIC void
xfs_diflags_to_linux(
struct xfs_inode *ip)
{
struct inode *inode = XFS_ITOV(ip);
struct inode *inode = VFS_I(ip);
unsigned int xflags = xfs_ip2xflags(ip);

if (xflags & XFS_XFLAG_IMMUTABLE)
Expand Down
Loading

0 comments on commit 9ea319b

Please sign in to comment.