diff options
Diffstat (limited to 'fs/xfs')
| -rw-r--r-- | fs/xfs/Makefile | 119 | ||||
| -rw-r--r-- | fs/xfs/kmem.c (renamed from fs/xfs/linux-2.6/kmem.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/kmem.h (renamed from fs/xfs/linux-2.6/kmem.h) | 7 | ||||
| -rw-r--r-- | fs/xfs/mrlock.h (renamed from fs/xfs/linux-2.6/mrlock.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/time.h (renamed from fs/xfs/linux-2.6/time.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/uuid.c (renamed from fs/xfs/support/uuid.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/uuid.h (renamed from fs/xfs/support/uuid.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs.h | 3 | ||||
| -rw-r--r-- | fs/xfs/xfs_acl.c (renamed from fs/xfs/linux-2.6/xfs_acl.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_aops.c (renamed from fs/xfs/linux-2.6/xfs_aops.c) | 3 | ||||
| -rw-r--r-- | fs/xfs/xfs_aops.h (renamed from fs/xfs/linux-2.6/xfs_aops.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_buf.c (renamed from fs/xfs/linux-2.6/xfs_buf.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_buf.h (renamed from fs/xfs/linux-2.6/xfs_buf.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_buf_item.c | 3 | ||||
| -rw-r--r-- | fs/xfs/xfs_discard.c (renamed from fs/xfs/linux-2.6/xfs_discard.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_discard.h (renamed from fs/xfs/linux-2.6/xfs_discard.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_dquot.c (renamed from fs/xfs/quota/xfs_dquot.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_dquot.h (renamed from fs/xfs/quota/xfs_dquot.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_dquot_item.c (renamed from fs/xfs/quota/xfs_dquot_item.c) | 10 | ||||
| -rw-r--r-- | fs/xfs/xfs_dquot_item.h (renamed from fs/xfs/quota/xfs_dquot_item.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_export.c (renamed from fs/xfs/linux-2.6/xfs_export.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_export.h (renamed from fs/xfs/linux-2.6/xfs_export.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_file.c (renamed from fs/xfs/linux-2.6/xfs_file.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_fs_subr.c (renamed from fs/xfs/linux-2.6/xfs_fs_subr.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_globals.c (renamed from fs/xfs/linux-2.6/xfs_globals.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_inode_item.c | 10 | ||||
| -rw-r--r-- | fs/xfs/xfs_ioctl.c (renamed from fs/xfs/linux-2.6/xfs_ioctl.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_ioctl.h (renamed from fs/xfs/linux-2.6/xfs_ioctl.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_ioctl32.c (renamed from fs/xfs/linux-2.6/xfs_ioctl32.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_ioctl32.h (renamed from fs/xfs/linux-2.6/xfs_ioctl32.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_iops.c (renamed from fs/xfs/linux-2.6/xfs_iops.c) | 53 | ||||
| -rw-r--r-- | fs/xfs/xfs_iops.h (renamed from fs/xfs/linux-2.6/xfs_iops.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_linux.h (renamed from fs/xfs/linux-2.6/xfs_linux.h) | 29 | ||||
| -rw-r--r-- | fs/xfs/xfs_message.c (renamed from fs/xfs/linux-2.6/xfs_message.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_message.h (renamed from fs/xfs/linux-2.6/xfs_message.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_qm.c (renamed from fs/xfs/quota/xfs_qm.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_qm.h (renamed from fs/xfs/quota/xfs_qm.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_qm_bhv.c (renamed from fs/xfs/quota/xfs_qm_bhv.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_qm_stats.c (renamed from fs/xfs/quota/xfs_qm_stats.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_qm_stats.h (renamed from fs/xfs/quota/xfs_qm_stats.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_qm_syscalls.c (renamed from fs/xfs/quota/xfs_qm_syscalls.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_quota_priv.h (renamed from fs/xfs/quota/xfs_quota_priv.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_quotaops.c (renamed from fs/xfs/linux-2.6/xfs_quotaops.c) | 2 | ||||
| -rw-r--r-- | fs/xfs/xfs_stats.c (renamed from fs/xfs/linux-2.6/xfs_stats.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_stats.h (renamed from fs/xfs/linux-2.6/xfs_stats.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_super.c (renamed from fs/xfs/linux-2.6/xfs_super.c) | 49 | ||||
| -rw-r--r-- | fs/xfs/xfs_super.h (renamed from fs/xfs/linux-2.6/xfs_super.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_sync.c (renamed from fs/xfs/linux-2.6/xfs_sync.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_sync.h (renamed from fs/xfs/linux-2.6/xfs_sync.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_sysctl.c (renamed from fs/xfs/linux-2.6/xfs_sysctl.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_sysctl.h (renamed from fs/xfs/linux-2.6/xfs_sysctl.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_trace.c (renamed from fs/xfs/linux-2.6/xfs_trace.c) | 4 | ||||
| -rw-r--r-- | fs/xfs/xfs_trace.h (renamed from fs/xfs/linux-2.6/xfs_trace.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_trans.h | 2 | ||||
| -rw-r--r-- | fs/xfs/xfs_trans_ail.c | 83 | ||||
| -rw-r--r-- | fs/xfs/xfs_trans_dquot.c (renamed from fs/xfs/quota/xfs_trans_dquot.c) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_trans_priv.h | 8 | ||||
| -rw-r--r-- | fs/xfs/xfs_vnode.h (renamed from fs/xfs/linux-2.6/xfs_vnode.h) | 0 | ||||
| -rw-r--r-- | fs/xfs/xfs_xattr.c (renamed from fs/xfs/linux-2.6/xfs_xattr.c) | 0 | 
59 files changed, 190 insertions, 195 deletions
diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile index 75bb316529d..427a4e82a58 100644 --- a/fs/xfs/Makefile +++ b/fs/xfs/Makefile @@ -16,44 +16,53 @@  # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA  # -ccflags-y := -I$(src) -I$(src)/linux-2.6 -ccflags-$(CONFIG_XFS_DEBUG) += -g +ccflags-y += -I$(src)			# needed for trace events -XFS_LINUX := linux-2.6 +ccflags-$(CONFIG_XFS_DEBUG) += -g  obj-$(CONFIG_XFS_FS)		+= xfs.o -xfs-y				+= linux-2.6/xfs_trace.o - -xfs-$(CONFIG_XFS_QUOTA)		+= $(addprefix quota/, \ -				   xfs_dquot.o \ -				   xfs_dquot_item.o \ -				   xfs_trans_dquot.o \ -				   xfs_qm_syscalls.o \ -				   xfs_qm_bhv.o \ -				   xfs_qm.o) -xfs-$(CONFIG_XFS_QUOTA)		+= linux-2.6/xfs_quotaops.o - -ifeq ($(CONFIG_XFS_QUOTA),y) -xfs-$(CONFIG_PROC_FS)		+= quota/xfs_qm_stats.o -endif - -xfs-$(CONFIG_XFS_RT)		+= xfs_rtalloc.o -xfs-$(CONFIG_XFS_POSIX_ACL)	+= $(XFS_LINUX)/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 +# this one should be compiled first, as the tracing macros can easily blow up +xfs-y				+= xfs_trace.o +# highlevel code +xfs-y				+= xfs_aops.o \ +				   xfs_bit.o \ +				   xfs_buf.o \ +				   xfs_dfrag.o \ +				   xfs_discard.o \ +				   xfs_error.o \ +				   xfs_export.o \ +				   xfs_file.o \ +				   xfs_filestream.o \ +				   xfs_fsops.o \ +				   xfs_fs_subr.o \ +				   xfs_globals.o \ +				   xfs_iget.o \ +				   xfs_ioctl.o \ +				   xfs_iomap.o \ +				   xfs_iops.o \ +				   xfs_itable.o \ +				   xfs_message.o \ +				   xfs_mru_cache.o \ +				   xfs_super.o \ +				   xfs_sync.o \ +				   xfs_xattr.o \ +				   xfs_rename.o \ +				   xfs_rw.o \ +				   xfs_utils.o \ +				   xfs_vnodeops.o \ +				   kmem.o \ +				   uuid.o +# code shared with libxfs  xfs-y				+= xfs_alloc.o \  				   xfs_alloc_btree.o \  				   xfs_attr.o \  				   xfs_attr_leaf.o \ -				   xfs_bit.o \  				   xfs_bmap.o \  				   xfs_bmap_btree.o \  				   xfs_btree.o \ -				   xfs_buf_item.o \  				   xfs_da_btree.o \  				   xfs_dir2.o \  				   xfs_dir2_block.o \ @@ -61,49 +70,37 @@ xfs-y				+= xfs_alloc.o \  				   xfs_dir2_leaf.o \  				   xfs_dir2_node.o \  				   xfs_dir2_sf.o \ -				   xfs_error.o \ -				   xfs_extfree_item.o \ -				   xfs_filestream.o \ -				   xfs_fsops.o \  				   xfs_ialloc.o \  				   xfs_ialloc_btree.o \ -				   xfs_iget.o \  				   xfs_inode.o \ -				   xfs_inode_item.o \ -				   xfs_iomap.o \ -				   xfs_itable.o \ -				   xfs_dfrag.o \ -				   xfs_log.o \ -				   xfs_log_cil.o \  				   xfs_log_recover.o \  				   xfs_mount.o \ -				   xfs_mru_cache.o \ -				   xfs_rename.o \ -				   xfs_trans.o \ +				   xfs_trans.o + +# low-level transaction/log code +xfs-y				+= xfs_log.o \ +				   xfs_log_cil.o \ +				   xfs_buf_item.o \ +				   xfs_extfree_item.o \ +				   xfs_inode_item.o \  				   xfs_trans_ail.o \  				   xfs_trans_buf.o \  				   xfs_trans_extfree.o \  				   xfs_trans_inode.o \ -				   xfs_utils.o \ -				   xfs_vnodeops.o \ -				   xfs_rw.o - -# Objects in linux/ -xfs-y				+= $(addprefix $(XFS_LINUX)/, \ -				   kmem.o \ -				   xfs_aops.o \ -				   xfs_buf.o \ -				   xfs_discard.o \ -				   xfs_export.o \ -				   xfs_file.o \ -				   xfs_fs_subr.o \ -				   xfs_globals.o \ -				   xfs_ioctl.o \ -				   xfs_iops.o \ -				   xfs_message.o \ -				   xfs_super.o \ -				   xfs_sync.o \ -				   xfs_xattr.o) -# Objects in support/ -xfs-y				+= support/uuid.o +# optional features +xfs-$(CONFIG_XFS_QUOTA)		+= xfs_dquot.o \ +				   xfs_dquot_item.o \ +				   xfs_trans_dquot.o \ +				   xfs_qm_syscalls.o \ +				   xfs_qm_bhv.o \ +				   xfs_qm.o \ +				   xfs_quotaops.o +ifeq ($(CONFIG_XFS_QUOTA),y) +xfs-$(CONFIG_PROC_FS)		+= xfs_qm_stats.o +endif +xfs-$(CONFIG_XFS_RT)		+= xfs_rtalloc.o +xfs-$(CONFIG_XFS_POSIX_ACL)	+= xfs_acl.o +xfs-$(CONFIG_PROC_FS)		+= xfs_stats.o +xfs-$(CONFIG_SYSCTL)		+= xfs_sysctl.o +xfs-$(CONFIG_COMPAT)		+= xfs_ioctl32.o diff --git a/fs/xfs/linux-2.6/kmem.c b/fs/xfs/kmem.c index a907de565db..a907de565db 100644 --- a/fs/xfs/linux-2.6/kmem.c +++ b/fs/xfs/kmem.c diff --git a/fs/xfs/linux-2.6/kmem.h b/fs/xfs/kmem.h index f7c8f7a9ea6..292eff19803 100644 --- a/fs/xfs/linux-2.6/kmem.h +++ b/fs/xfs/kmem.h @@ -61,12 +61,7 @@ extern void  kmem_free(const void *);  static inline void *kmem_zalloc_large(size_t size)  { -	void *ptr; - -	ptr = vmalloc(size); -	if (ptr) -		memset(ptr, 0, size); -	return ptr; +	return vzalloc(size);  }  static inline void kmem_free_large(void *ptr)  { diff --git a/fs/xfs/linux-2.6/mrlock.h b/fs/xfs/mrlock.h index ff6a19873e5..ff6a19873e5 100644 --- a/fs/xfs/linux-2.6/mrlock.h +++ b/fs/xfs/mrlock.h diff --git a/fs/xfs/linux-2.6/time.h b/fs/xfs/time.h index 387e695a184..387e695a184 100644 --- a/fs/xfs/linux-2.6/time.h +++ b/fs/xfs/time.h diff --git a/fs/xfs/support/uuid.c b/fs/xfs/uuid.c index b83f76b6d41..b83f76b6d41 100644 --- a/fs/xfs/support/uuid.c +++ b/fs/xfs/uuid.c diff --git a/fs/xfs/support/uuid.h b/fs/xfs/uuid.h index 4732d71262c..4732d71262c 100644 --- a/fs/xfs/support/uuid.h +++ b/fs/xfs/uuid.h diff --git a/fs/xfs/xfs.h b/fs/xfs/xfs.h index 53ec3ea9a62..d8b11b7f94a 100644 --- a/fs/xfs/xfs.h +++ b/fs/xfs/xfs.h @@ -24,5 +24,6 @@  #define XFS_BUF_LOCK_TRACKING 1  #endif -#include <linux-2.6/xfs_linux.h> +#include "xfs_linux.h" +  #endif	/* __XFS_H__ */ diff --git a/fs/xfs/linux-2.6/xfs_acl.c b/fs/xfs/xfs_acl.c index b6c4b3795c4..b6c4b3795c4 100644 --- a/fs/xfs/linux-2.6/xfs_acl.c +++ b/fs/xfs/xfs_acl.c diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/xfs_aops.c index 63e971e2b83..8c37dde4c52 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/xfs_aops.c @@ -1300,6 +1300,7 @@ xfs_end_io_direct_write(  	bool			is_async)  {  	struct xfs_ioend	*ioend = iocb->private; +	struct inode		*inode = ioend->io_inode;  	/*  	 * blockdev_direct_IO can return an error even after the I/O @@ -1331,7 +1332,7 @@ xfs_end_io_direct_write(  	}  	/* XXX: probably should move into the real I/O completion handler */ -	inode_dio_done(ioend->io_inode); +	inode_dio_done(inode);  }  STATIC ssize_t diff --git a/fs/xfs/linux-2.6/xfs_aops.h b/fs/xfs/xfs_aops.h index 71f721e1a71..71f721e1a71 100644 --- a/fs/xfs/linux-2.6/xfs_aops.h +++ b/fs/xfs/xfs_aops.h diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/xfs_buf.c index c57836dc778..c57836dc778 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/xfs_buf.c diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/xfs_buf.h index 620972b8094..620972b8094 100644 --- a/fs/xfs/linux-2.6/xfs_buf.h +++ b/fs/xfs/xfs_buf.h diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index cac2ecfa674..ef43fce519a 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c @@ -629,7 +629,7 @@ xfs_buf_item_push(   * the xfsbufd to get this buffer written. We have to unlock the buffer   * to allow the xfsbufd to write it, too.   */ -STATIC void +STATIC bool  xfs_buf_item_pushbuf(  	struct xfs_log_item	*lip)  { @@ -643,6 +643,7 @@ xfs_buf_item_pushbuf(  	xfs_buf_delwri_promote(bp);  	xfs_buf_relse(bp); +	return true;  }  STATIC void diff --git a/fs/xfs/linux-2.6/xfs_discard.c b/fs/xfs/xfs_discard.c index 244e797dae3..244e797dae3 100644 --- a/fs/xfs/linux-2.6/xfs_discard.c +++ b/fs/xfs/xfs_discard.c diff --git a/fs/xfs/linux-2.6/xfs_discard.h b/fs/xfs/xfs_discard.h index 344879aea64..344879aea64 100644 --- a/fs/xfs/linux-2.6/xfs_discard.h +++ b/fs/xfs/xfs_discard.h diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/xfs_dquot.c index db62959bed1..db62959bed1 100644 --- a/fs/xfs/quota/xfs_dquot.c +++ b/fs/xfs/xfs_dquot.c diff --git a/fs/xfs/quota/xfs_dquot.h b/fs/xfs/xfs_dquot.h index 34b7e945dbf..34b7e945dbf 100644 --- a/fs/xfs/quota/xfs_dquot.h +++ b/fs/xfs/xfs_dquot.h diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/xfs_dquot_item.c index 9e0e2fa3f2c..bb3f71d236d 100644 --- a/fs/xfs/quota/xfs_dquot_item.c +++ b/fs/xfs/xfs_dquot_item.c @@ -183,13 +183,14 @@ xfs_qm_dqunpin_wait(   * search the buffer cache can be a time consuming thing, and AIL lock is a   * spinlock.   */ -STATIC void +STATIC bool  xfs_qm_dquot_logitem_pushbuf(  	struct xfs_log_item	*lip)  {  	struct xfs_dq_logitem	*qlip = DQUOT_ITEM(lip);  	struct xfs_dquot	*dqp = qlip->qli_dquot;  	struct xfs_buf		*bp; +	bool			ret = true;  	ASSERT(XFS_DQ_IS_LOCKED(dqp)); @@ -201,17 +202,20 @@ xfs_qm_dquot_logitem_pushbuf(  	if (completion_done(&dqp->q_flush) ||  	    !(lip->li_flags & XFS_LI_IN_AIL)) {  		xfs_dqunlock(dqp); -		return; +		return true;  	}  	bp = xfs_incore(dqp->q_mount->m_ddev_targp, qlip->qli_format.qlf_blkno,  			dqp->q_mount->m_quotainfo->qi_dqchunklen, XBF_TRYLOCK);  	xfs_dqunlock(dqp);  	if (!bp) -		return; +		return true;  	if (XFS_BUF_ISDELAYWRITE(bp))  		xfs_buf_delwri_promote(bp); +	if (xfs_buf_ispinned(bp)) +		ret = false;  	xfs_buf_relse(bp); +	return ret;  }  /* diff --git a/fs/xfs/quota/xfs_dquot_item.h b/fs/xfs/xfs_dquot_item.h index 5acae2ada70..5acae2ada70 100644 --- a/fs/xfs/quota/xfs_dquot_item.h +++ b/fs/xfs/xfs_dquot_item.h diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/xfs_export.c index 75e5d322e48..75e5d322e48 100644 --- a/fs/xfs/linux-2.6/xfs_export.c +++ b/fs/xfs/xfs_export.c diff --git a/fs/xfs/linux-2.6/xfs_export.h b/fs/xfs/xfs_export.h index 3272b6ae7a3..3272b6ae7a3 100644 --- a/fs/xfs/linux-2.6/xfs_export.h +++ b/fs/xfs/xfs_export.h diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/xfs_file.c index 7f7b42469ea..7f7b42469ea 100644 --- a/fs/xfs/linux-2.6/xfs_file.c +++ b/fs/xfs/xfs_file.c diff --git a/fs/xfs/linux-2.6/xfs_fs_subr.c b/fs/xfs/xfs_fs_subr.c index ed88ed16811..ed88ed16811 100644 --- a/fs/xfs/linux-2.6/xfs_fs_subr.c +++ b/fs/xfs/xfs_fs_subr.c diff --git a/fs/xfs/linux-2.6/xfs_globals.c b/fs/xfs/xfs_globals.c index 76e81cff70b..76e81cff70b 100644 --- a/fs/xfs/linux-2.6/xfs_globals.c +++ b/fs/xfs/xfs_globals.c diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 588406dc6a3..836ad80d4f2 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -708,13 +708,14 @@ xfs_inode_item_committed(   * marked delayed write. If that's the case, we'll promote it and that will   * allow the caller to write the buffer by triggering the xfsbufd to run.   */ -STATIC void +STATIC bool  xfs_inode_item_pushbuf(  	struct xfs_log_item	*lip)  {  	struct xfs_inode_log_item *iip = INODE_ITEM(lip);  	struct xfs_inode	*ip = iip->ili_inode;  	struct xfs_buf		*bp; +	bool			ret = true;  	ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED)); @@ -725,7 +726,7 @@ xfs_inode_item_pushbuf(  	if (completion_done(&ip->i_flush) ||  	    !(lip->li_flags & XFS_LI_IN_AIL)) {  		xfs_iunlock(ip, XFS_ILOCK_SHARED); -		return; +		return true;  	}  	bp = xfs_incore(ip->i_mount->m_ddev_targp, iip->ili_format.ilf_blkno, @@ -733,10 +734,13 @@ xfs_inode_item_pushbuf(  	xfs_iunlock(ip, XFS_ILOCK_SHARED);  	if (!bp) -		return; +		return true;  	if (XFS_BUF_ISDELAYWRITE(bp))  		xfs_buf_delwri_promote(bp); +	if (xfs_buf_ispinned(bp)) +		ret = false;  	xfs_buf_relse(bp); +	return ret;  }  /* diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index f7ce7debe14..f7ce7debe14 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c diff --git a/fs/xfs/linux-2.6/xfs_ioctl.h b/fs/xfs/xfs_ioctl.h index d56173b34a2..d56173b34a2 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.h +++ b/fs/xfs/xfs_ioctl.h diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c index 54e623bfbb8..54e623bfbb8 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl32.c +++ b/fs/xfs/xfs_ioctl32.c diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.h b/fs/xfs/xfs_ioctl32.h index 80f4060e897..80f4060e897 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl32.h +++ b/fs/xfs/xfs_ioctl32.h diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/xfs_iops.c index b9c172b3fbb..28856accb4f 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -70,9 +70,8 @@ xfs_synchronize_times(  }  /* - * If the linux inode is valid, mark it dirty. - * Used when committing a dirty inode into a transaction so that - * the inode will get written back by the linux code + * If the linux inode is valid, mark it dirty, else mark the dirty state + * in the XFS inode to make sure we pick it up when reclaiming the inode.   */  void  xfs_mark_inode_dirty_sync( @@ -82,6 +81,10 @@ xfs_mark_inode_dirty_sync(  	if (!(inode->i_state & (I_WILL_FREE|I_FREEING)))  		mark_inode_dirty_sync(inode); +	else { +		barrier(); +		ip->i_update_core = 1; +	}  }  void @@ -92,6 +95,28 @@ xfs_mark_inode_dirty(  	if (!(inode->i_state & (I_WILL_FREE|I_FREEING)))  		mark_inode_dirty(inode); +	else { +		barrier(); +		ip->i_update_core = 1; +	} + +} + + +int xfs_initxattrs(struct inode *inode, const struct xattr *xattr_array, +		   void *fs_info) +{ +	const struct xattr *xattr; +	struct xfs_inode *ip = XFS_I(inode); +	int error = 0; + +	for (xattr = xattr_array; xattr->name != NULL; xattr++) { +		error = xfs_attr_set(ip, xattr->name, xattr->value, +				     xattr->value_len, ATTR_SECURE); +		if (error < 0) +			break; +	} +	return error;  }  /* @@ -100,31 +125,15 @@ xfs_mark_inode_dirty(   * these attrs can be journalled at inode creation time (along with the   * inode, of course, such that log replay can't cause these to be lost).   */ +  STATIC int  xfs_init_security(  	struct inode	*inode,  	struct inode	*dir,  	const struct qstr *qstr)  { -	struct xfs_inode *ip = XFS_I(inode); -	size_t		length; -	void		*value; -	unsigned char	*name; -	int		error; - -	error = security_inode_init_security(inode, dir, qstr, (char **)&name, -					     &value, &length); -	if (error) { -		if (error == -EOPNOTSUPP) -			return 0; -		return -error; -	} - -	error = xfs_attr_set(ip, name, value, length, ATTR_SECURE); - -	kfree(name); -	kfree(value); -	return error; +	return security_inode_init_security(inode, dir, qstr, +					    &xfs_initxattrs, NULL);  }  static void diff --git a/fs/xfs/linux-2.6/xfs_iops.h b/fs/xfs/xfs_iops.h index ef41c92ce66..ef41c92ce66 100644 --- a/fs/xfs/linux-2.6/xfs_iops.h +++ b/fs/xfs/xfs_iops.h diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/xfs_linux.h index d42f814e4d3..828662f70d6 100644 --- a/fs/xfs/linux-2.6/xfs_linux.h +++ b/fs/xfs/xfs_linux.h @@ -32,13 +32,12 @@  # define XFS_BIG_INUMS	0  #endif -#include <xfs_types.h> +#include "xfs_types.h" -#include <kmem.h> -#include <mrlock.h> -#include <time.h> - -#include <support/uuid.h> +#include "kmem.h" +#include "mrlock.h" +#include "time.h" +#include "uuid.h"  #include <linux/semaphore.h>  #include <linux/mm.h> @@ -69,6 +68,8 @@  #include <linux/ctype.h>  #include <linux/writeback.h>  #include <linux/capability.h> +#include <linux/kthread.h> +#include <linux/freezer.h>  #include <linux/list_sort.h>  #include <asm/page.h> @@ -78,14 +79,14 @@  #include <asm/byteorder.h>  #include <asm/unaligned.h> -#include <xfs_vnode.h> -#include <xfs_stats.h> -#include <xfs_sysctl.h> -#include <xfs_iops.h> -#include <xfs_aops.h> -#include <xfs_super.h> -#include <xfs_buf.h> -#include <xfs_message.h> +#include "xfs_vnode.h" +#include "xfs_stats.h" +#include "xfs_sysctl.h" +#include "xfs_iops.h" +#include "xfs_aops.h" +#include "xfs_super.h" +#include "xfs_buf.h" +#include "xfs_message.h"  #ifdef __BIG_ENDIAN  #define XFS_NATIVE_HOST 1 diff --git a/fs/xfs/linux-2.6/xfs_message.c b/fs/xfs/xfs_message.c index bd672def95a..bd672def95a 100644 --- a/fs/xfs/linux-2.6/xfs_message.c +++ b/fs/xfs/xfs_message.c diff --git a/fs/xfs/linux-2.6/xfs_message.h b/fs/xfs/xfs_message.h index 7fb7ea00767..7fb7ea00767 100644 --- a/fs/xfs/linux-2.6/xfs_message.h +++ b/fs/xfs/xfs_message.h diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/xfs_qm.c index 9a0aa76facd..9a0aa76facd 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/xfs_qm.c diff --git a/fs/xfs/quota/xfs_qm.h b/fs/xfs/xfs_qm.h index 43b9abe1052..43b9abe1052 100644 --- a/fs/xfs/quota/xfs_qm.h +++ b/fs/xfs/xfs_qm.h diff --git a/fs/xfs/quota/xfs_qm_bhv.c b/fs/xfs/xfs_qm_bhv.c index a0a829addca..a0a829addca 100644 --- a/fs/xfs/quota/xfs_qm_bhv.c +++ b/fs/xfs/xfs_qm_bhv.c diff --git a/fs/xfs/quota/xfs_qm_stats.c b/fs/xfs/xfs_qm_stats.c index 8671a0b3264..8671a0b3264 100644 --- a/fs/xfs/quota/xfs_qm_stats.c +++ b/fs/xfs/xfs_qm_stats.c diff --git a/fs/xfs/quota/xfs_qm_stats.h b/fs/xfs/xfs_qm_stats.h index 5b964fc0dc0..5b964fc0dc0 100644 --- a/fs/xfs/quota/xfs_qm_stats.h +++ b/fs/xfs/xfs_qm_stats.h diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c index 609246f42e6..609246f42e6 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/xfs_qm_syscalls.c diff --git a/fs/xfs/quota/xfs_quota_priv.h b/fs/xfs/xfs_quota_priv.h index 94a3d927d71..94a3d927d71 100644 --- a/fs/xfs/quota/xfs_quota_priv.h +++ b/fs/xfs/xfs_quota_priv.h diff --git a/fs/xfs/linux-2.6/xfs_quotaops.c b/fs/xfs/xfs_quotaops.c index 29b9d642e93..7e76f537abb 100644 --- a/fs/xfs/linux-2.6/xfs_quotaops.c +++ b/fs/xfs/xfs_quotaops.c @@ -25,7 +25,7 @@  #include "xfs_trans.h"  #include "xfs_bmap_btree.h"  #include "xfs_inode.h" -#include "quota/xfs_qm.h" +#include "xfs_qm.h"  #include <linux/quota.h> diff --git a/fs/xfs/linux-2.6/xfs_stats.c b/fs/xfs/xfs_stats.c index 76fdc586193..76fdc586193 100644 --- a/fs/xfs/linux-2.6/xfs_stats.c +++ b/fs/xfs/xfs_stats.c diff --git a/fs/xfs/linux-2.6/xfs_stats.h b/fs/xfs/xfs_stats.h index 736854b1ca1..736854b1ca1 100644 --- a/fs/xfs/linux-2.6/xfs_stats.h +++ b/fs/xfs/xfs_stats.h diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/xfs_super.c index 9a72dda58bd..5cf06b85fd9 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -356,6 +356,8 @@ xfs_parseargs(  			mp->m_flags |= XFS_MOUNT_DELAYLOG;  		} else if (!strcmp(this_char, MNTOPT_NODELAYLOG)) {  			mp->m_flags &= ~XFS_MOUNT_DELAYLOG; +			xfs_warn(mp, +	"nodelaylog is deprecated and will be removed in Linux 3.3");  		} else if (!strcmp(this_char, MNTOPT_DISCARD)) {  			mp->m_flags |= XFS_MOUNT_DISCARD;  		} else if (!strcmp(this_char, MNTOPT_NODISCARD)) { @@ -877,33 +879,17 @@ xfs_log_inode(  	struct xfs_trans	*tp;  	int			error; -	xfs_iunlock(ip, XFS_ILOCK_SHARED);  	tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS);  	error = xfs_trans_reserve(tp, 0, XFS_FSYNC_TS_LOG_RES(mp), 0, 0, 0); -  	if (error) {  		xfs_trans_cancel(tp, 0); -		/* we need to return with the lock hold shared */ -		xfs_ilock(ip, XFS_ILOCK_SHARED);  		return error;  	}  	xfs_ilock(ip, XFS_ILOCK_EXCL); - -	/* -	 * Note - it's possible that we might have pushed ourselves out of the -	 * way during trans_reserve which would flush the inode.  But there's -	 * no guarantee that the inode buffer has actually gone out yet (it's -	 * delwri).  Plus the buffer could be pinned anyway if it's part of -	 * an inode in another recent transaction.  So we play it safe and -	 * fire off the transaction anyway. -	 */ -	xfs_trans_ijoin(tp, ip); +	xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL);  	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); -	error = xfs_trans_commit(tp, 0); -	xfs_ilock_demote(ip, XFS_ILOCK_EXCL); - -	return error; +	return xfs_trans_commit(tp, 0);  }  STATIC int @@ -918,7 +904,9 @@ xfs_fs_write_inode(  	trace_xfs_write_inode(ip);  	if (XFS_FORCED_SHUTDOWN(mp)) -		return XFS_ERROR(EIO); +		return -XFS_ERROR(EIO); +	if (!ip->i_update_core) +		return 0;  	if (wbc->sync_mode == WB_SYNC_ALL) {  		/* @@ -929,12 +917,10 @@ xfs_fs_write_inode(  		 * of synchronous log foces dramatically.  		 */  		xfs_ioend_wait(ip); -		xfs_ilock(ip, XFS_ILOCK_SHARED); -		if (ip->i_update_core) { -			error = xfs_log_inode(ip); -			if (error) -				goto out_unlock; -		} +		error = xfs_log_inode(ip); +		if (error) +			goto out; +		return 0;  	} else {  		/*  		 * We make this non-blocking if the inode is contended, return @@ -1666,24 +1652,13 @@ xfs_init_workqueues(void)  	 */  	xfs_syncd_wq = alloc_workqueue("xfssyncd", WQ_CPU_INTENSIVE, 8);  	if (!xfs_syncd_wq) -		goto out; - -	xfs_ail_wq = alloc_workqueue("xfsail", WQ_CPU_INTENSIVE, 8); -	if (!xfs_ail_wq) -		goto out_destroy_syncd; - +		return -ENOMEM;  	return 0; - -out_destroy_syncd: -	destroy_workqueue(xfs_syncd_wq); -out: -	return -ENOMEM;  }  STATIC void  xfs_destroy_workqueues(void)  { -	destroy_workqueue(xfs_ail_wq);  	destroy_workqueue(xfs_syncd_wq);  } diff --git a/fs/xfs/linux-2.6/xfs_super.h b/fs/xfs/xfs_super.h index 50a3266c999..50a3266c999 100644 --- a/fs/xfs/linux-2.6/xfs_super.h +++ b/fs/xfs/xfs_super.h diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/xfs_sync.c index 4604f90f86a..4604f90f86a 100644 --- a/fs/xfs/linux-2.6/xfs_sync.c +++ b/fs/xfs/xfs_sync.c diff --git a/fs/xfs/linux-2.6/xfs_sync.h b/fs/xfs/xfs_sync.h index 941202e7ac6..941202e7ac6 100644 --- a/fs/xfs/linux-2.6/xfs_sync.h +++ b/fs/xfs/xfs_sync.h diff --git a/fs/xfs/linux-2.6/xfs_sysctl.c b/fs/xfs/xfs_sysctl.c index ee2d2adaa43..ee2d2adaa43 100644 --- a/fs/xfs/linux-2.6/xfs_sysctl.c +++ b/fs/xfs/xfs_sysctl.c diff --git a/fs/xfs/linux-2.6/xfs_sysctl.h b/fs/xfs/xfs_sysctl.h index b9937d450f8..b9937d450f8 100644 --- a/fs/xfs/linux-2.6/xfs_sysctl.h +++ b/fs/xfs/xfs_sysctl.h diff --git a/fs/xfs/linux-2.6/xfs_trace.c b/fs/xfs/xfs_trace.c index 88d25d4aa56..9010ce885e6 100644 --- a/fs/xfs/linux-2.6/xfs_trace.c +++ b/fs/xfs/xfs_trace.c @@ -43,8 +43,8 @@  #include "xfs_quota.h"  #include "xfs_iomap.h"  #include "xfs_aops.h" -#include "quota/xfs_dquot_item.h" -#include "quota/xfs_dquot.h" +#include "xfs_dquot_item.h" +#include "xfs_dquot.h"  #include "xfs_log_recover.h"  #include "xfs_inode_item.h" diff --git a/fs/xfs/linux-2.6/xfs_trace.h b/fs/xfs/xfs_trace.h index 690fc7a7bd7..690fc7a7bd7 100644 --- a/fs/xfs/linux-2.6/xfs_trace.h +++ b/fs/xfs/xfs_trace.h diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index 06a9759b635..53597f4db9b 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h @@ -350,7 +350,7 @@ typedef struct xfs_item_ops {  	void (*iop_unlock)(xfs_log_item_t *);  	xfs_lsn_t (*iop_committed)(xfs_log_item_t *, xfs_lsn_t);  	void (*iop_push)(xfs_log_item_t *); -	void (*iop_pushbuf)(xfs_log_item_t *); +	bool (*iop_pushbuf)(xfs_log_item_t *);  	void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t);  } xfs_item_ops_t; diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c index c15aa29fa16..3a1e7ca54c2 100644 --- a/fs/xfs/xfs_trans_ail.c +++ b/fs/xfs/xfs_trans_ail.c @@ -28,8 +28,6 @@  #include "xfs_trans_priv.h"  #include "xfs_error.h" -struct workqueue_struct	*xfs_ail_wq;	/* AIL workqueue */ -  #ifdef DEBUG  /*   * Check that the list is sorted as it should be. @@ -356,16 +354,10 @@ xfs_ail_delete(  	xfs_trans_ail_cursor_clear(ailp, lip);  } -/* - * xfs_ail_worker does the work of pushing on the AIL. It will requeue itself - * to run at a later time if there is more work to do to complete the push. - */ -STATIC void -xfs_ail_worker( -	struct work_struct	*work) +static long +xfsaild_push( +	struct xfs_ail		*ailp)  { -	struct xfs_ail		*ailp = container_of(to_delayed_work(work), -					struct xfs_ail, xa_work);  	xfs_mount_t		*mp = ailp->xa_mount;  	struct xfs_ail_cursor	cur;  	xfs_log_item_t		*lip; @@ -427,8 +419,13 @@ xfs_ail_worker(  		case XFS_ITEM_PUSHBUF:  			XFS_STATS_INC(xs_push_ail_pushbuf); -			IOP_PUSHBUF(lip); -			ailp->xa_last_pushed_lsn = lsn; + +			if (!IOP_PUSHBUF(lip)) { +				stuck++; +				flush_log = 1; +			} else { +				ailp->xa_last_pushed_lsn = lsn; +			}  			push_xfsbufd = 1;  			break; @@ -440,7 +437,6 @@ xfs_ail_worker(  		case XFS_ITEM_LOCKED:  			XFS_STATS_INC(xs_push_ail_locked); -			ailp->xa_last_pushed_lsn = lsn;  			stuck++;  			break; @@ -501,20 +497,6 @@ out_done:  		/* We're past our target or empty, so idle */  		ailp->xa_last_pushed_lsn = 0; -		/* -		 * We clear the XFS_AIL_PUSHING_BIT first before checking -		 * whether the target has changed. If the target has changed, -		 * this pushes the requeue race directly onto the result of the -		 * atomic test/set bit, so we are guaranteed that either the -		 * the pusher that changed the target or ourselves will requeue -		 * the work (but not both). -		 */ -		clear_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags); -		smp_rmb(); -		if (XFS_LSN_CMP(ailp->xa_target, target) == 0 || -		    test_and_set_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags)) -			return; -  		tout = 50;  	} else if (XFS_LSN_CMP(lsn, target) >= 0) {  		/* @@ -537,9 +519,30 @@ out_done:  		tout = 20;  	} -	/* There is more to do, requeue us.  */ -	queue_delayed_work(xfs_syncd_wq, &ailp->xa_work, -					msecs_to_jiffies(tout)); +	return tout; +} + +static int +xfsaild( +	void		*data) +{ +	struct xfs_ail	*ailp = data; +	long		tout = 0;	/* milliseconds */ + +	while (!kthread_should_stop()) { +		if (tout && tout <= 20) +			__set_current_state(TASK_KILLABLE); +		else +			__set_current_state(TASK_INTERRUPTIBLE); +		schedule_timeout(tout ? +				 msecs_to_jiffies(tout) : MAX_SCHEDULE_TIMEOUT); + +		try_to_freeze(); + +		tout = xfsaild_push(ailp); +	} + +	return 0;  }  /* @@ -574,8 +577,9 @@ xfs_ail_push(  	 */  	smp_wmb();  	xfs_trans_ail_copy_lsn(ailp, &ailp->xa_target, &threshold_lsn); -	if (!test_and_set_bit(XFS_AIL_PUSHING_BIT, &ailp->xa_flags)) -		queue_delayed_work(xfs_syncd_wq, &ailp->xa_work, 0); +	smp_wmb(); + +	wake_up_process(ailp->xa_task);  }  /* @@ -813,9 +817,18 @@ xfs_trans_ail_init(  	INIT_LIST_HEAD(&ailp->xa_ail);  	INIT_LIST_HEAD(&ailp->xa_cursors);  	spin_lock_init(&ailp->xa_lock); -	INIT_DELAYED_WORK(&ailp->xa_work, xfs_ail_worker); + +	ailp->xa_task = kthread_run(xfsaild, ailp, "xfsaild/%s", +			ailp->xa_mount->m_fsname); +	if (IS_ERR(ailp->xa_task)) +		goto out_free_ailp; +  	mp->m_ail = ailp;  	return 0; + +out_free_ailp: +	kmem_free(ailp); +	return ENOMEM;  }  void @@ -824,6 +837,6 @@ xfs_trans_ail_destroy(  {  	struct xfs_ail	*ailp = mp->m_ail; -	cancel_delayed_work_sync(&ailp->xa_work); +	kthread_stop(ailp->xa_task);  	kmem_free(ailp);  } diff --git a/fs/xfs/quota/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c index 4d00ee67792..4d00ee67792 100644 --- a/fs/xfs/quota/xfs_trans_dquot.c +++ b/fs/xfs/xfs_trans_dquot.c diff --git a/fs/xfs/xfs_trans_priv.h b/fs/xfs/xfs_trans_priv.h index 212946b9723..22750b5e4a8 100644 --- a/fs/xfs/xfs_trans_priv.h +++ b/fs/xfs/xfs_trans_priv.h @@ -64,23 +64,17 @@ struct xfs_ail_cursor {   */  struct xfs_ail {  	struct xfs_mount	*xa_mount; +	struct task_struct	*xa_task;  	struct list_head	xa_ail;  	xfs_lsn_t		xa_target;  	struct list_head	xa_cursors;  	spinlock_t		xa_lock; -	struct delayed_work	xa_work;  	xfs_lsn_t		xa_last_pushed_lsn; -	unsigned long		xa_flags;  }; -#define XFS_AIL_PUSHING_BIT	0 -  /*   * From xfs_trans_ail.c   */ - -extern struct workqueue_struct	*xfs_ail_wq;	/* AIL workqueue */ -  void	xfs_trans_ail_update_bulk(struct xfs_ail *ailp,  				struct xfs_ail_cursor *cur,  				struct xfs_log_item **log_items, int nr_items, diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/xfs_vnode.h index 7c220b4227b..7c220b4227b 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/xfs_vnode.h diff --git a/fs/xfs/linux-2.6/xfs_xattr.c b/fs/xfs/xfs_xattr.c index 87d3e03878c..87d3e03878c 100644 --- a/fs/xfs/linux-2.6/xfs_xattr.c +++ b/fs/xfs/xfs_xattr.c  |