Commit graph

251 commits

Author SHA1 Message Date
Nathan Scott 8f79405527 [XFS] Reduce complexity in xfs_trans_init by pushing complex macros out
into functions and hence reduce the stack footprint there.

SGI-PV: 947312
SGI-Modid: xfs-linux-melb:xfs-kern:25360a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:32:41 +11:00
Nathan Scott f6d75cbed9 [XFS] Dynamically allocate xfs_dir2_put_args_t structure to reduce stack
pressure in xfs_dir2_leaf_getdents routine.

SGI-PV: 947312
SGI-Modid: xfs-linux-melb:xfs-kern:25359a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:32:24 +11:00
Nathan Scott 1f6553f9f9 [XFS] Dynamically allocate local kiocb structures in readv/writev routines
to reduce stack footprint.

SGI-PV: 947312
SGI-Modid: xfs-linux-melb:xfs-kern:25358a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:30:48 +11:00
Mandy Kirkconnell 0293ce3a9f [XFS] 929045 567344 This mod introduces multi-level in-core file extent
functionality, building upon the new layout introduced in mod
xfs-linux:xfs-kern:207390a.  The new multi-level extent allocations are
only required for heavily fragmented files, so the old-style linear extent
list is used on files until the extents reach a pre-determined size of 4k.
4k buffers are used because this is the system page size on Linux i386 and
systems with larger page sizes don't seem to gain much, if anything, by
using their native page size as the extent buffer size. Also, using 4k
extent buffers everywhere provides a consistent interface for CXFS across
different platforms.  The 4k extent buffers are managed by an indirection
array (xfs_ext_irec_t) which is basically just a pointer array with a bit
of extra information to keep track of the number of extents in each buffer
as well as the extent offset of each buffer.  Major changes include:  -
Add multi-level in-core file extent functionality to the xfs_iext_  
subroutines introduced in mod:	xfs-linux:xfs-kern:207390a  - Introduce 13
new subroutines which add functionality for multi-level   in-core file
extents:	 xfs_iext_add_indirect_multi()	      
xfs_iext_remove_indirect()	   xfs_iext_realloc_indirect()	      
xfs_iext_indirect_to_direct()	      xfs_iext_bno_to_irec()	    
xfs_iext_idx_to_irec()	       xfs_iext_irec_init()	   
xfs_iext_irec_new()	    xfs_iext_irec_remove()	  
xfs_iext_irec_compact() 	xfs_iext_irec_compact_pages()	     
xfs_iext_irec_compact_full()	     xfs_iext_irec_update_extoffs()

SGI-PV: 928864
SGI-Modid: xfs-linux-melb:xfs-kern:207393a

Signed-off-by: Mandy Kirkconnell <alkirkco@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:30:23 +11:00
Mandy Kirkconnell 4eea22f01b [XFS] 929045 567344 This mod re-organizes some of the in-core file extent
code to prepare for an upcoming mod which will introduce multi-level
in-core extent allocations. Although the in-core extent management is
using a new code path in this mod, the functionality remains the same. 
Major changes include:	- Introduce 10 new subroutines which re-orgainze
the existing code but	do NOT change functionality:	    
xfs_iext_get_ext()	   xfs_iext_insert()	     xfs_iext_add()	  
 xfs_iext_remove()	   xfs_iext_remove_inline()	   
xfs_iext_remove_direct()	 xfs_iext_realloc_direct()	  
xfs_iext_direct_to_inline()	    xfs_iext_inline_to_direct()        
xfs_iext_destroy() - Remove 2 subroutines (functionality moved to new
subroutines above):	    xfs_iext_realloc() -replaced by xfs_iext_add()
and xfs_iext_remove()	      xfs_bmap_insert_exlist() - replaced by
xfs_iext_insert()	  xfs_bmap_delete_exlist() - replaced by
xfs_iext_remove() - Replace all hard-coded (indexed) extent assignments
with a call to	 xfs_iext_get_ext() - Replace all extent record pointer
arithmetic (ep++, ep--, base + lastx,..)   with calls to
xfs_iext_get_ext() - Update comments to remove the idea of a single
"extent list" and   introduce "extent record" terminology instead

SGI-PV: 928864
SGI-Modid: xfs-linux-melb:xfs-kern:207390a

Signed-off-by: Mandy Kirkconnell <alkirkco@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:29:52 +11:00
Nathan Scott 9f989c9455 [XFS] Additional mount time superblock validation checks.
SGI-PV: 950491
SGI-Modid: xfs-linux-melb:xfs-kern:25354a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:29:32 +11:00
David Chinner 01e1b69cfc [XFS] using a spinlock per cpu for superblock counter exclusion results in
a preēmpt counter overflow at 256p and above. Change the exclusion
mechanism to use atomic bit operations and busy wait loops to emulate the
spin lock exclusion mechanism but without the preempt count issues.

SGI-PV: 950027
SGI-Modid: xfs-linux-melb:xfs-kern:25338a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:29:16 +11:00
Nathan Scott 87cbc49cd4 [XFS] Add xfs_map_buffer helper, use it in a couple of places.
SGI-PV: 950211
SGI-Modid: xfs-linux-melb:xfs-kern:25312a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:26:43 +11:00
Nathan Scott f51623b21f [XFS] Move some code around to avoid prototypes and prep for future
writepages code. 

SGI-PV: 950211
SGI-Modid: xfs-linux-melb:xfs-kern:25311a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:26:27 +11:00
Nathan Scott 02d7c92334 [XFS] Use XFS_VFSTOM in more places instead of open coding it.
SGI-PV: 947206
SGI-Modid: xfs-linux-melb:xfs-kern:25310a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:26:09 +11:00
Tim Shimmin fcce0f1f9a [XFS] forgot a couple of calls to XLOG_VEC_SET_TYPE when porting from irix
to linux.

SGI-PV: 931456
SGI-Modid: xfs-linux-melb:xfs-kern:25238a

Signed-off-by: Tim Shimmin <tes@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:25:02 +11:00
Nathan Scott a780143ea5 [XFS] UUID endianess fix. uu_timelow is a 32bit field and needs to be
swapped with be32_to_cpu. 

SGI-PV: 943272
SGI-Modid: xfs-linux-melb:xfs-kern:25232a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:24:46 +11:00
David Chinner e8234a6871 [XFS] Add support for hotplug CPUs to the per-CPU superblock counters by
registering a notifier callback that listens to CPU up/down events to
modify the counters appropriately.

SGI-PV: 949726
SGI-Modid: xfs-linux-melb:xfs-kern:25214a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:23:52 +11:00
Nathan Scott 2d0f864be3 [XFS] Make headers compile for more compiler variants; minor cleanup.
SGI-PV: 949432
SGI-Modid: xfs-linux-melb:xfs-kern:25184a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:20:33 +11:00
Nathan Scott d2c32edf64 [XFS] When compiling with gcc 4.0 and CONFIG_SMP unset, there are many
warnings along the lines: xfs_linux.h:103:5: warning: "CONFIG_SMP" is not
defined. 

SGI-PV: 946630
SGI-Modid: xfs-linux-melb:xfs-kern:25171a

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:20:13 +11:00
Nathan Scott e0cc2325d1 [XFS] Flag the XFS inode cache as in need of spreading also.
SGI-PV: 949073
SGI-Modid: xfs-linux-melb:xfs-kern:25170a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:19:55 +11:00
Nathan Scott 20722a9192 [XFS] Fix a mutex_destroy diagnostic about a locked-mutex-on-destroy from
quota code.

SGI-PV: 949149
SGI-Modid: xfs-linux-melb:xfs-kern:25123a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:19:08 +11:00
Nathan Scott 8758280fcc [XFS] Cleanup the use of zones/slabs, more consistent and allows flags to
be passed.

SGI-PV: 949073
SGI-Modid: xfs-linux-melb:xfs-kern:25122a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:18:19 +11:00
David Chinner 8d280b98cf [XFS] On machines with more than 8 cpus, when running parallel I/O
threads, the incore superblock lock becomes the limiting factor for
buffered write throughput. Make the contended fields in the incore
superblock use per-cpu counters so that there is no global lock to limit
scalability.

SGI-PV: 946630
SGI-Modid: xfs-linux-melb:xfs-kern:25106a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:13:09 +11:00
Nathan Scott 9f4cbecd7e [XFS] XFS propagates MS_NOATIME through two levels internally but doesn't
actually use it.  Kill this dead code.	Signed-off-by: Christoph Hellwig
<hch@lst.de>

SGI-PV: 904196
SGI-Modid: xfs-linux-melb:xfs-kern:25086a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:05:30 +11:00
David Chinner 0c9512d746 [XFS] find_exported_dentry(). XFS does not need to use this symbol as it
is provided by a vector through the superblock export operations when the
filesystem is exported by NFS. The fix is to call that vector instead of
using the exported symbol directly.

SGI-PV: 948858
SGI-Modid: xfs-linux-melb:xfs-kern:25062a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-03-14 13:02:13 +11:00
Eric Sandeen 2353e8e9b6 [XFS] Don't map non-uptodate buffers in xfs_probe_cluster; also fixes
obscure corruption case

SGI-PV: 942658
SGI-Modid: xfs-linux-melb:xfs-kern:207119a

Signed-off-by: Eric Sandeen <sandeen@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-02-28 12:30:30 +11:00
Nathan Scott dae81d4774 [XFS] Reduce stack use during quota mounts (caused a panic). This
regressed recently via the fix for inherited quota inode attributes.

SGI-PV: 947312
SGI-Modid: xfs-linux-melb:xfs-kern:25318a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-02-28 12:30:13 +11:00
Nathan Scott 07ff2fa8fc [XFS] Fix a realtime allocator regression introduced by an old iget race
fix.  Noticed by Roger Willcocks.

SGI-PV: 949821
SGI-Modid: xfs-linux-melb:xfs-kern:25257a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-02-28 12:29:51 +11:00
Nathan Scott 9bd6f13dfd [XFS] Fix missing inode atime update from the utime syscall.
SGI-PV: 949214
SGI-Modid: xfs-linux-melb:xfs-kern:25136a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-02-07 20:27:44 +11:00
David Chinner 9fddaca229 [XFS] Account for the page we just wrote when we detect congestion during
the clustering of extra pages in a buffered write.

SGI-PV: 949210
SGI-Modid: xfs-linux-melb:xfs-kern:25130a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-02-07 20:27:24 +11:00
Christoph Lameter e965f9630c [PATCH] Direct Migration V9: Avoid writeback / page_migrate() method
Migrate a page with buffers without requiring writeback

This introduces a new address space operation migratepage() that may be used
by a filesystem to implement its own version of page migration.

A version is provided that migrates buffers attached to pages.  Some
filesystems (ext2, ext3, xfs) are modified to utilize this feature.

The swapper address space operation are modified so that a regular
migrate_page() will occur for anonymous pages without writeback (migrate_pages
forces every anonymous page to have a swap entry).

Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-01 08:53:17 -08:00
Nathan Scott fad3aa1e8e [XFS] Fix regression in xfs_buf_rele dealing with non-hashed buffers, as
occur during log replay.  Novell bug 145204, Fedora bug 177848.

SGI-PV: 948860
SGI-Modid: xfs-linux-melb:xfs-kern:25064a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-02-01 12:14:52 +11:00
Yingping Lu 3a69c7dc6f [XFS] Interim solution for attribute insertion failure during file
creation due to ENOSPC. The current solution removes the inode when the
attribute insertion fails. Long term solution would be to make the inode
creation and attribute insertion atomic.

SGI-PV: 947610
SGI-Modid: xfs-linux-melb:xfs-kern:205193a

Signed-off-by: Yingping Lu <yingping@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-02-01 12:14:34 +11:00
David Chinner d88992f660 [XFS] Fix a race in xfs_submit_ioend() where we can be completing I/O for
a page while we are still submitting other buffers on the same page for
I/O.

SGI-PV: 948197
SGI-Modid: xfs-linux-melb:xfs-kern:25004a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-18 13:38:12 +11:00
Linus Torvalds 4a8e4a270b Merge git://oss.sgi.com:8090/oss/git/xfs-2.6 2006-01-15 22:18:04 -08:00
Nathan Scott 107a09c44b [XFS] remove no-longer-needed IS_NOATIME macro, twas just a build workaround
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-16 16:28:07 +11:00
Nathan Scott c2e8143220 [XFS] mutex fallout - fix debug builds and remove no-longer-useful comment.
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-16 16:21:34 +11:00
Nathan Scott 54245702ab [XFS] Fix symlink creation too, with respect to initialising SELinux
context.

SGI-PV: 946762
SGI-Modid: xfs-linux-melb:xfs-kern:24983a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-16 15:54:05 +11:00
Jesper Juhl 014c2544e6 return statement cleanup - kill pointless parentheses
This patch removes pointless parentheses from return statements.

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-01-15 02:37:08 +01:00
Linus Torvalds 9f5974c873 Merge git://oss.sgi.com:8090/oss/git/xfs-2.6 2006-01-12 09:10:34 -08:00
Randy Dunlap 16f7e0fe2e [PATCH] capable/capability.h (fs/)
fs: Use <linux/capability.h> where capable() is used.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-11 18:42:13 -08:00
Randy.Dunlap c59ede7b78 [PATCH] move capable() to capability.h
- Move capable() from sched.h to capability.h;

- Use <linux/capability.h> where capable() is used
	(in include/, block/, ipc/, kernel/, a few drivers/,
	mm/, security/, & sound/;
	many more drivers/ to go)

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-11 18:42:13 -08:00
Nathan Scott ddae9c2ea7 Merge HEAD from oss.sgi.com:/oss/git/linux-2.6.git 2006-01-12 13:34:47 +11:00
Nathan Scott 0d1335b310 [XFS] Fix follow_link when dealing with symlinks larger than 256 bytes.
Thanks to Yamamoto Takashi.

SGI-PV: 947953
SGI-Modid: xfs-linux-melb:xfs-kern:24962a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-12 10:32:51 +11:00
Nathan Scott 3762ec6bf7 [XFS] Merge in trivial changes, sync up headers with userspace
equivalents.

SGI-PV: 907752
SGI-Modid: xfs-linux-melb:xfs-kern:24961a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-12 10:29:53 +11:00
Nathan Scott 6ab65429b4 [XFS] Fix compiler warnings from older gcc versions wrt printfalike
arguments.

SGI-PV: 907752
SGI-Modid: xfs-linux-melb:xfs-kern:24901a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-11 21:03:28 +11:00
Nathan Scott ca5ccbf98d [XFS] Fix some build fallout from atime changes.
SGI-PV: 946679
SGI-Modid: xfs-linux-melb:xfs-kern:24899a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-11 21:03:04 +11:00
Tim Shimmin 1259845d3f [XFS] remove XFS_LOG_RES_DEBUG and turn on the res history all the time to
get more useful error info on space for trans items

SGI-PV: 947110
SGI-Modid: xfs-linux-melb:xfs-kern:24886a

Signed-off-by: Tim Shimmin <tes@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-11 21:02:47 +11:00
Yingping Lu 71df099dc3 [XFS] xfssyncd is responsible for flushing inode or device's data by
extracting the work from its queue. In addition, this processing also
decrement the inode's i_count. If there are any remaining works in queue
before this process terminates, we have unbalanced increment and decrement
of i_count. Thus it can cause assertion failure of vn_count. The fix
allows xyssyncd to process any remaining work before it is shutdown. 

SGI-PV: 945935
SGI-Modid: xfs-linux-melb:xfs-kern:203970a

Signed-off-by: Yingping Lu <yingping@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-11 21:02:29 +11:00
Christoph Hellwig 75e17b3caf [XFS] add helper to get xfs_inode from vnode
SGI-PV: 947206
SGI-Modid: xfs-linux-melb:xfs-kern:203960a

Signed-off-by: Christoph Hellwig <hch@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-11 20:58:44 +11:00
Nathan Scott 204ab25f36 [XFS] Fix up offset type inconsistencies and gcc warnings from earlier
changes.

SGI-PV: 947038
SGI-Modid: xfs-linux-melb:xfs-kern:24875a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-11 20:50:22 +11:00
Christoph Hellwig da7f93e9ee [XFS] fix up per-device xfsbufd
SGI-PV: 947098
SGI-Modid: xfs-linux-melb:xfs-kern:203831a

Signed-off-by: Christoph Hellwig <hch@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-11 20:49:57 +11:00
Christoph Hellwig f5e596bbef [XFS] fix writeback control handling fix a reversed condition on where to
trylock and deal with block layer congestion properly.	Patch from David
Chinner and Christoph Hellwig.

SGI-PV: 947118
SGI-Modid: xfs-linux-melb:xfs-kern:203830a

Signed-off-by: Christoph Hellwig <hch@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-11 20:49:42 +11:00
Christoph Hellwig 6c4fe19f66 [XFS] cluster rewrites We can cluster mapped pages aswell, this improves
performances on rewrites since we can reduce the number of allocator
calls.

SGI-PV: 947118
SGI-Modid: xfs-linux-melb:xfs-kern:203829a

Signed-off-by: Christoph Hellwig <hch@sgi.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-01-11 20:49:28 +11:00