Skip to content

Commit

Permalink
Merge git://oss.sgi.com:8090/xfs-2.6
Browse files Browse the repository at this point in the history
* git://oss.sgi.com:8090/xfs-2.6: (43 commits)
  [XFS] Remove files from the build that are now unused.
  [XFS] Fix a Makefile issue related to exports.o handling.
  [XFS] Remove version 1 directory code.	Never functioned on Linux, just
  [XFS] Map EFSCORRUPTED to an actual error code, not just a made up one
  [XFS] Kill direct access to ->count in valusema(); all we ever use it for
  [XFS] Remove unneeded conditional code on NFS export interface related
  [XFS] Remove an incorrect use of unlikely() on a relatively likely code
  [XFS] Push some common code out of write path into core XFS code for
  [XFS] Remove unnecessary local from open_exec dmapi path.
  [XFS] Minor XFS documentation updates.
  [XFS] Fix broken const use inside local suffix_strtoul routine.
  [XFS] Fix nused counter.  It's currently getting set to -1 rather than
  [XFS] Fix mismerge of the fs_writable cleanup patch causing a freeze/thaw
  [XFS] Fix up debug code so that bulkstat wont generate thousands of
  [XFS] Remove unused parameter from di2xflags routine.
  [XFS] Cleanup a missed porting conversion, and freezing.
  [XFS] Resolve a namespace collision on remaining vtypes for FreeBSD
  [XFS] Resolve a namespace collision on vnode/vnodeops for FreeBSD porters.
  [XFS] Resolve a namespace collision on vfs/vfsops for FreeBSD porters.
  [XFS] statvfs component of directory/project quota support, code
  ...
  • Loading branch information
Linus Torvalds committed Jun 22, 2006
2 parents 43104f1 + 98174e4 commit 52ab3f3
Show file tree
Hide file tree
Showing 109 changed files with 2,317 additions and 6,262 deletions.
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -3191,7 +3191,7 @@ XFS FILESYSTEM
P: Silicon Graphics Inc
M: xfs-masters@oss.sgi.com
M: nathans@sgi.com
L: linux-xfs@oss.sgi.com
L: xfs@oss.sgi.com
W: http://oss.sgi.com/projects/xfs
S: Supported

Expand Down
27 changes: 11 additions & 16 deletions fs/xfs/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
config XFS_FS
tristate "XFS filesystem support"
select EXPORTFS if NFSD!=n
help
XFS is a high performance journaling filesystem which originated
on the SGI IRIX platform. It is completely multi-threaded, can
Expand All @@ -18,11 +17,6 @@ config XFS_FS
system of your root partition is compiled as a module, you'll need
to use an initial ramdisk (initrd) to boot.

config XFS_EXPORT
bool
depends on XFS_FS && EXPORTFS
default y

config XFS_QUOTA
bool "XFS Quota support"
depends on XFS_FS
Expand Down Expand Up @@ -65,18 +59,19 @@ config XFS_POSIX_ACL
If you don't know what Access Control Lists are, say N.

config XFS_RT
bool "XFS Realtime support (EXPERIMENTAL)"
depends on XFS_FS && EXPERIMENTAL
bool "XFS Realtime subvolume support"
depends on XFS_FS
help
If you say Y here you will be able to mount and use XFS filesystems
which contain a realtime subvolume. The realtime subvolume is a
separate area of disk space where only file data is stored. The
realtime subvolume is designed to provide very deterministic
data rates suitable for media streaming applications.

See the xfs man page in section 5 for a bit more information.
which contain a realtime subvolume. The realtime subvolume is a
separate area of disk space where only file data is stored. It was
originally designed to provide deterministic data rates suitable
for media streaming applications, but is also useful as a generic
mechanism for ensuring data and metadata/log I/Os are completely
separated. Regular file I/Os are isolated to a separate device
from all other requests, and this can be done quite transparently
to applications via the inherit-realtime directory inode flag.

This feature is unsupported at this time, is not yet fully
functional, and may cause serious problems.
See the xfs man page in section 5 for additional information.

If unsure, say N.
4 changes: 1 addition & 3 deletions fs/xfs/Makefile-linux-2.6
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ xfs-$(CONFIG_XFS_POSIX_ACL) += xfs_acl.o
xfs-$(CONFIG_PROC_FS) += $(XFS_LINUX)/xfs_stats.o
xfs-$(CONFIG_SYSCTL) += $(XFS_LINUX)/xfs_sysctl.o
xfs-$(CONFIG_COMPAT) += $(XFS_LINUX)/xfs_ioctl32.o
xfs-$(CONFIG_XFS_EXPORT) += $(XFS_LINUX)/xfs_export.o


xfs-y += xfs_alloc.o \
Expand All @@ -73,14 +72,12 @@ xfs-y += xfs_alloc.o \
xfs_btree.o \
xfs_buf_item.o \
xfs_da_btree.o \
xfs_dir.o \
xfs_dir2.o \
xfs_dir2_block.o \
xfs_dir2_data.o \
xfs_dir2_leaf.o \
xfs_dir2_node.o \
xfs_dir2_sf.o \
xfs_dir_leaf.o \
xfs_error.o \
xfs_extfree_item.o \
xfs_fsops.o \
Expand Down Expand Up @@ -117,6 +114,7 @@ xfs-y += $(addprefix $(XFS_LINUX)/, \
kmem.o \
xfs_aops.o \
xfs_buf.o \
xfs_export.o \
xfs_file.o \
xfs_fs_subr.o \
xfs_globals.o \
Expand Down
38 changes: 1 addition & 37 deletions fs/xfs/linux-2.6/kmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,42 +22,6 @@
#include <linux/sched.h>
#include <linux/mm.h>

/*
* Process flags handling
*/

#define PFLAGS_TEST_NOIO() (current->flags & PF_NOIO)
#define PFLAGS_TEST_FSTRANS() (current->flags & PF_FSTRANS)

#define PFLAGS_SET_NOIO() do { \
current->flags |= PF_NOIO; \
} while (0)

#define PFLAGS_CLEAR_NOIO() do { \
current->flags &= ~PF_NOIO; \
} while (0)

/* these could be nested, so we save state */
#define PFLAGS_SET_FSTRANS(STATEP) do { \
*(STATEP) = current->flags; \
current->flags |= PF_FSTRANS; \
} while (0)

#define PFLAGS_CLEAR_FSTRANS(STATEP) do { \
*(STATEP) = current->flags; \
current->flags &= ~PF_FSTRANS; \
} while (0)

/* Restore the PF_FSTRANS state to what was saved in STATEP */
#define PFLAGS_RESTORE_FSTRANS(STATEP) do { \
current->flags = ((current->flags & ~PF_FSTRANS) | \
(*(STATEP) & PF_FSTRANS)); \
} while (0)

#define PFLAGS_DUP(OSTATEP, NSTATEP) do { \
*(NSTATEP) = *(OSTATEP); \
} while (0)

/*
* General memory allocation interfaces
*/
Expand All @@ -83,7 +47,7 @@ kmem_flags_convert(unsigned int __nocast flags)
lflags = GFP_ATOMIC | __GFP_NOWARN;
} else {
lflags = GFP_KERNEL | __GFP_NOWARN;
if (PFLAGS_TEST_FSTRANS() || (flags & KM_NOFS))
if ((current->flags & PF_FSTRANS) || (flags & KM_NOFS))
lflags &= ~__GFP_FS;
}
return lflags;
Expand Down
4 changes: 2 additions & 2 deletions fs/xfs/linux-2.6/mrlock.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000-2005 Silicon Graphics, Inc.
* Copyright (c) 2000-2006 Silicon Graphics, Inc.
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
Expand Down Expand Up @@ -28,7 +28,7 @@ typedef struct {
} mrlock_t;

#define mrinit(mrp, name) \
( (mrp)->mr_writer = 0, init_rwsem(&(mrp)->mr_lock) )
do { (mrp)->mr_writer = 0; init_rwsem(&(mrp)->mr_lock); } while (0)
#define mrlock_init(mrp, t,n,s) mrinit(mrp, n)
#define mrfree(mrp) do { } while (0)
#define mraccess(mrp) mraccessf(mrp, 0)
Expand Down
19 changes: 10 additions & 9 deletions fs/xfs/linux-2.6/sema.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,21 @@ typedef struct semaphore sema_t;
#define initnsema(sp, val, name) sema_init(sp, val)
#define psema(sp, b) down(sp)
#define vsema(sp) up(sp)
#define valusema(sp) (atomic_read(&(sp)->count))
#define freesema(sema)
#define freesema(sema) do { } while (0)

static inline int issemalocked(sema_t *sp)
{
return down_trylock(sp) || (up(sp), 0);
}

/*
* Map cpsema (try to get the sema) to down_trylock. We need to switch
* the return values since cpsema returns 1 (acquired) 0 (failed) and
* down_trylock returns the reverse 0 (acquired) 1 (failed).
*/

#define cpsema(sp) (down_trylock(sp) ? 0 : 1)

/*
* Didn't do cvsema(sp). Not sure how to map this to up/down/...
* It does a vsema if the values is < 0 other wise nothing.
*/
static inline int cpsema(sema_t *sp)
{
return down_trylock(sp) ? 0 : 1;
}

#endif /* __XFS_SUPPORT_SEMA_H__ */
65 changes: 36 additions & 29 deletions fs/xfs/linux-2.6/xfs_aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
#include "xfs_inum.h"
#include "xfs_sb.h"
#include "xfs_ag.h"
#include "xfs_dir.h"
#include "xfs_dir2.h"
#include "xfs_trans.h"
#include "xfs_dmapi.h"
#include "xfs_mount.h"
#include "xfs_bmap_btree.h"
#include "xfs_alloc_btree.h"
#include "xfs_ialloc_btree.h"
#include "xfs_dir_sf.h"
#include "xfs_dir2_sf.h"
#include "xfs_attr_sf.h"
#include "xfs_dinode.h"
Expand Down Expand Up @@ -76,7 +74,7 @@ xfs_page_trace(
int mask)
{
xfs_inode_t *ip;
vnode_t *vp = vn_from_inode(inode);
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;
Expand Down Expand Up @@ -136,9 +134,10 @@ xfs_destroy_ioend(

for (bh = ioend->io_buffer_head; bh; bh = next) {
next = bh->b_private;
bh->b_end_io(bh, ioend->io_uptodate);
bh->b_end_io(bh, !ioend->io_error);
}

if (unlikely(ioend->io_error))
vn_ioerror(ioend->io_vnode, ioend->io_error, __FILE__,__LINE__);
vn_iowake(ioend->io_vnode);
mempool_free(ioend, xfs_ioend_pool);
}
Expand Down Expand Up @@ -180,13 +179,12 @@ xfs_end_bio_unwritten(
void *data)
{
xfs_ioend_t *ioend = data;
vnode_t *vp = ioend->io_vnode;
bhv_vnode_t *vp = ioend->io_vnode;
xfs_off_t offset = ioend->io_offset;
size_t size = ioend->io_size;
int error;

if (ioend->io_uptodate)
VOP_BMAP(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL, error);
if (likely(!ioend->io_error))
bhv_vop_bmap(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL);
xfs_destroy_ioend(ioend);
}

Expand All @@ -211,7 +209,7 @@ xfs_alloc_ioend(
* all the I/O from calling the completion routine too early.
*/
atomic_set(&ioend->io_remaining, 1);
ioend->io_uptodate = 1; /* cleared if any I/O fails */
ioend->io_error = 0;
ioend->io_list = NULL;
ioend->io_type = type;
ioend->io_vnode = vn_from_inode(inode);
Expand Down Expand Up @@ -239,10 +237,10 @@ xfs_map_blocks(
xfs_iomap_t *mapp,
int flags)
{
vnode_t *vp = vn_from_inode(inode);
bhv_vnode_t *vp = vn_from_inode(inode);
int error, nmaps = 1;

VOP_BMAP(vp, offset, count, flags, mapp, &nmaps, error);
error = bhv_vop_bmap(vp, offset, count, flags, mapp, &nmaps);
if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE)))
VMODIFY(vp);
return -error;
Expand Down Expand Up @@ -271,16 +269,14 @@ xfs_end_bio(
if (bio->bi_size)
return 1;

ASSERT(ioend);
ASSERT(atomic_read(&bio->bi_cnt) >= 1);
ioend->io_error = test_bit(BIO_UPTODATE, &bio->bi_flags) ? 0 : error;

/* Toss bio and pass work off to an xfsdatad thread */
if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
ioend->io_uptodate = 0;
bio->bi_private = NULL;
bio->bi_end_io = NULL;

bio_put(bio);

xfs_finish_ioend(ioend);
return 0;
}
Expand Down Expand Up @@ -1127,7 +1123,7 @@ xfs_vm_writepage(
* then mark the page dirty again and leave the page
* as is.
*/
if (PFLAGS_TEST_FSTRANS() && need_trans)
if (current_test_flags(PF_FSTRANS) && need_trans)
goto out_fail;

/*
Expand Down Expand Up @@ -1158,6 +1154,18 @@ xfs_vm_writepage(
return error;
}

STATIC int
xfs_vm_writepages(
struct address_space *mapping,
struct writeback_control *wbc)
{
struct bhv_vnode *vp = vn_from_inode(mapping->host);

if (VN_TRUNC(vp))
VUNTRUNCATE(vp);
return generic_writepages(mapping, wbc);
}

/*
* Called to move a page into cleanable state - and from there
* to be released. Possibly the page is already clean. We always
Expand Down Expand Up @@ -1204,7 +1212,7 @@ xfs_vm_releasepage(
/* If we are already inside a transaction or the thread cannot
* do I/O, we cannot release this page.
*/
if (PFLAGS_TEST_FSTRANS())
if (current_test_flags(PF_FSTRANS))
return 0;

/*
Expand All @@ -1231,7 +1239,7 @@ __xfs_get_blocks(
int direct,
bmapi_flags_t flags)
{
vnode_t *vp = vn_from_inode(inode);
bhv_vnode_t *vp = vn_from_inode(inode);
xfs_iomap_t iomap;
xfs_off_t offset;
ssize_t size;
Expand All @@ -1241,8 +1249,8 @@ __xfs_get_blocks(
offset = (xfs_off_t)iblock << inode->i_blkbits;
ASSERT(bh_result->b_size >= (1 << inode->i_blkbits));
size = bh_result->b_size;
VOP_BMAP(vp, offset, size,
create ? flags : BMAPI_READ, &iomap, &niomap, error);
error = bhv_vop_bmap(vp, offset, size,
create ? flags : BMAPI_READ, &iomap, &niomap);
if (error)
return -error;
if (niomap == 0)
Expand Down Expand Up @@ -1370,13 +1378,13 @@ xfs_vm_direct_IO(
{
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
vnode_t *vp = vn_from_inode(inode);
bhv_vnode_t *vp = vn_from_inode(inode);
xfs_iomap_t iomap;
int maps = 1;
int error;
ssize_t ret;

VOP_BMAP(vp, offset, 0, BMAPI_DEVICE, &iomap, &maps, error);
error = bhv_vop_bmap(vp, offset, 0, BMAPI_DEVICE, &iomap, &maps);
if (error)
return -error;

Expand Down Expand Up @@ -1409,14 +1417,12 @@ xfs_vm_bmap(
sector_t block)
{
struct inode *inode = (struct inode *)mapping->host;
vnode_t *vp = vn_from_inode(inode);
int error;
bhv_vnode_t *vp = vn_from_inode(inode);

vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);

VOP_RWLOCK(vp, VRWLOCK_READ);
VOP_FLUSH_PAGES(vp, (xfs_off_t)0, -1, 0, FI_REMAPF, error);
VOP_RWUNLOCK(vp, VRWLOCK_READ);
bhv_vop_rwlock(vp, VRWLOCK_READ);
bhv_vop_flush_pages(vp, (xfs_off_t)0, -1, 0, FI_REMAPF);
bhv_vop_rwunlock(vp, VRWLOCK_READ);
return generic_block_bmap(mapping, block, xfs_get_blocks);
}

Expand Down Expand Up @@ -1452,6 +1458,7 @@ struct address_space_operations xfs_address_space_operations = {
.readpage = xfs_vm_readpage,
.readpages = xfs_vm_readpages,
.writepage = xfs_vm_writepage,
.writepages = xfs_vm_writepages,
.sync_page = block_sync_page,
.releasepage = xfs_vm_releasepage,
.invalidatepage = xfs_vm_invalidatepage,
Expand Down
Loading

0 comments on commit 52ab3f3

Please sign in to comment.