Commit Graph

444 Commits

Author SHA1 Message Date
Nathan Scott
d432c80e68 [XFS] Minor code rearranging and cleanup to prevent some coverity false
positives.

SGI-PV: 955502
SGI-Modid: xfs-linux-melb:xfs-kern:26805a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:03:44 +10:00
Nathan Scott
b627259c60 [XFS] Remove a no-longer-correct debug assert from dio completion
handling.

SGI-PV: 955302
SGI-Modid: xfs-linux-melb:xfs-kern:26804a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:03:33 +10:00
Nathan Scott
77e4635ae1 [XFS] Add a greedy allocation interface, allocating within a min/max size
range.

SGI-PV: 955302
SGI-Modid: xfs-linux-melb:xfs-kern:26803a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:03:27 +10:00
Nathan Scott
572d95f49f [XFS] Improve error handling for the zero-fsblock extent detection code.
SGI-PV: 955302
SGI-Modid: xfs-linux-melb:xfs-kern:26802a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:03:20 +10:00
Nathan Scott
948ecdb4c1 [XFS] Be more defensive with page flags (error/private) for metadata
buffers.

SGI-PV: 955302
SGI-Modid: xfs-linux-melb:xfs-kern:26801a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:03:13 +10:00
Nathan Scott
efb8ad7e94 [XFS] Add a debug flag for allocations which are known to be larger than
one page.

SGI-PV: 955302
SGI-Modid: xfs-linux-melb:xfs-kern:26800a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:03:05 +10:00
Eric Sandeen
3f89243c5b [XFS] Remove several macros that are no longer used anywhere
SGI-PV: 955302
SGI-Modid: xfs-linux-melb:xfs-kern:26749a

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:02:57 +10:00
Eric Sandeen
065d312e15 [XFS] Remove unused iop_abort log item operation
SGI-PV: 955302
SGI-Modid: xfs-linux-melb:xfs-kern:26747a

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:02:44 +10:00
Eric Sandeen
43129c16e8 [XFS] Remove a couple of unused BUF macros
SGI-PV: 955302
SGI-Modid: xfs-linux-melb:xfs-kern:26746a

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:02:37 +10:00
Vlad Apostolov
17370097da [XFS] pass file mode on DMAPI remove events
SGI-PV: 953687
SGI-Modid: xfs-linux-melb:xfs-kern:26639a

Signed-off-by: Vlad Apostolov <vapo@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:02:30 +10:00
Nathan Scott
745b1f47fc [XFS] Remove last bulkstat false-positives with debug kernels.
SGI-PV: 953819
SGI-Modid: xfs-linux-melb:xfs-kern:26628a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:02:23 +10:00
Nathan Scott
a3c6685eaa [XFS] Ensure xlog_state_do_callback does not report spurious warnings on
ramdisks.

SGI-PV: 954802
SGI-Modid: xfs-linux-melb:xfs-kern:26627a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:02:14 +10:00
Nathan Scott
bb3c7d2936 [XFS] Increase the size of the buffer holding the local inode cluster
list, to increase our potential readahead window and in turn improve
bulkstat performance.

SGI-PV: 944409
SGI-Modid: xfs-linux-melb:xfs-kern:26607a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:02:09 +10:00
Nathan Scott
2627509330 [XFS] Drop unneeded endian conversion in bulkstat and start readahead for
batches of inode cluster buffers at once, before any blocking reads are
issued.

SGI-PV: 944409
SGI-Modid: xfs-linux-melb:xfs-kern:26606a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:02:03 +10:00
Nathan Scott
51bdd70681 [XFS] When issuing metadata readahead, submit bio with READA not READ.
SGI-PV: 944409
SGI-Modid: xfs-linux-melb:xfs-kern:26603a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:01:57 +10:00
Nathan Scott
8b56f083c2 [XFS] Rework DMAPI bulkstat calls in such a way that we can directly
extract inline attributes out of the bulkstat buffer (for that case),
rather than using an (extremely expensive for large icount filesystems)
iget for fetching attrs.

SGI-PV: 944409
SGI-Modid: xfs-linux-melb:xfs-kern:26602a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:01:46 +10:00
Tim Shimmin
726801ba06 [XFS] Add EA list callbacks for xfs kernel use. Cleanup some namespace
code.

SGI-PV: 954372
SGI-Modid: xfs-linux-melb:xfs-kern:26583a

Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:01:37 +10:00
Nathan Scott
69e23b9a5e [XFS] Update XFS for i_blksize removal from generic inode structure
SGI-PV: 954366
SGI-Modid: xfs-linux-melb:xfs-kern:26565a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 11:01:22 +10:00
Nathan Scott
29b6d22b01 [XFS] remove accidentally reintroduced vfs unmount flag, unneeded in
current kernels

SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26564a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:59:06 +10:00
Christoph Hellwig
fe48cae9ed [XFS] remove bhv_lookup, _range version works aswell and has more useful
semantics.

SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26563a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:58:52 +10:00
Nathan Scott
1121b219bf [XFS] use NULL for pointer initialisation instead of zero-cast-to-ptr
SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26562a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:58:40 +10:00
Christoph Hellwig
8801bb99e4 [XFS] endianess annotations for xfs_bmbt_key Trivial as there are no
incore users.

SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26561a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:58:17 +10:00
Christoph Hellwig
576039cf3c [XFS] endianess annotate XFS_BMAP_BROOT_PTR_ADDR Make sure it returns a
__be64 and let the callers use the proper macros.

SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26560a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:58:06 +10:00
Christoph Hellwig
397b5208d5 [XFS] endianess annotations for xfs_bmbt_ptr_t/xfs_bmdr_ptr_t
SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26559a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:57:52 +10:00
Christoph Hellwig
b113bcb83e [XFS] add xfs_btree_check_lptr_disk variant which handles endian
conversion

SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26558a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:57:42 +10:00
Christoph Hellwig
c38e5e84db [XFS] remove left over INT_ comments in *alloc*.c We can verify endianess
handling with sparse now, no need for comments.

SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26557a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:57:17 +10:00
Christoph Hellwig
61a2584867 [XFS] endianess annotations for xfs_inobt_rec_t / xfs_inobt_key_t
SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26556a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:57:04 +10:00
Christoph Hellwig
e21010053a [XFS] endianess annotation for xfs_agfl_t. Trivial, xfs_agfl_t is always
used for ondisk values.

SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26553a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:56:51 +10:00
Nathan Scott
ed9d88f7b7 [XFS] Fix sparse warning found when page tracing enabled, due to
overloaded gfp_t param.

SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26552a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:56:43 +10:00
Nathan Scott
673cdf5c72 [XFS] Fix rounding bug in xfs_free_file_space found by sparse checking.
SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26551a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:56:26 +10:00
Alexey Dobriyan
87395deb0b [XFS] move XFS_IOC_GETVERSION to main multiplexer
Avoids doing an unnecessary inode to vnode conversion and avoids a memory
allocation.

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

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:56:01 +10:00
Tim Shimmin
128dabc5e9 [XFS] cleanup the field types of some item format structures
SGI-PV: 954365
SGI-Modid: xfs-linux-melb:xfs-kern:26406a

Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:55:43 +10:00
Nathan Scott
f07c225036 [XFS] Improve xfsbufd delayed write submission patterns, after blktrace
analysis.

Under a sequential create+allocate workload, blktrace reported backward
writes being issued by xfsbufd, and frequent inappropriate queue unplugs.
We now insert at the tail when moving from the delwri lists to the temp
lists, which maintains correct ordering, and we avoid unplugging queues
deep in the submit paths when we'd shortly do it at a higher level anyway.
blktrace now reports much healthier write patterns from xfsbufd for this
workload (and likely many others).

SGI-PV: 954310
SGI-Modid: xfs-linux-melb:xfs-kern:26396a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:52:15 +10:00
Alexey Dobriyan
f37ea14969 [XFS] pass inode to xfs_ioc_space(), simplify some code. There is trivial
"inode => vnode => inode" conversion, but only flags and mode of final
inode are looked at. Pass original inode instead.

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

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
2006-09-28 10:52:04 +10:00
Theodore Ts'o
ba52de123d [PATCH] inode-diet: Eliminate i_blksize from the inode structure
This eliminates the i_blksize field from struct inode.  Filesystems that want
to provide a per-inode st_blksize can do so by providing their own getattr
routine instead of using the generic_fillattr() function.

Note that some filesystems were providing pretty much random (and incorrect)
values for i_blksize.

[bunk@stusta.de: cleanup]
[akpm@osdl.org: generic_fillattr() fix]
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 08:26:18 -07:00
Alexey Dobriyan
1a1d92c10d [PATCH] Really ignore kmem_cache_destroy return value
* Rougly half of callers already do it by not checking return value
* Code in drivers/acpi/osl.c does the following to be sure:

	(void)kmem_cache_destroy(cache);

* Those who check it printk something, however, slab_error already printed
  the name of failed cache.
* XFS BUGs on failed kmem_cache_destroy which is not the decision
  low-level filesystem driver should make. Converted to ignore.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 08:26:10 -07:00
Panagiotis Issaris
f52720ca5f [PATCH] fs: Removing useless casts
* Removing useless casts
* Removing useless wrapper
* Conversion from kmalloc+memset to kzalloc

Signed-off-by: Panagiotis Issaris <takis@issaris.org>
Acked-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-27 08:26:10 -07:00
Nathan Scott
0edc7d0f37 [XFS] Fix a bad pointer dereference in the quota statvfs handling.
SGI-PV: 955993
SGI-Modid: xfs-linux-melb:xfs-kern:26934a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: David Chatterton <chatz@sgi.com>
2006-09-07 14:27:23 +10:00
David Chinner
0a8d17d090 [XFS] Fix xfs_splice_write() so appended data gets to disk.
xfs_splice_write() failed to update the on disk inode size when extending
the so when the file was closed the range extended by splice was truncated
off. Hence any region of a file written to by splice would end up as a
hole full of zeros.

SGI-PV: 955939
SGI-Modid: xfs-linux-melb:xfs-kern:26920a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: David Chatterton <chatz@sgi.com>
2006-09-07 14:27:15 +10:00
Lachlan McIlroy
721259bce2 [XFS] Fix ABBA deadlock between i_mutex and iolock. Avoid calling
__blockdev_direct_IO for the DIO_OWN_LOCKING case for direct I/O reads
since it drops and reacquires the i_mutex while holding the iolock and
this violates the locking order.

SGI-PV: 955696
SGI-Modid: xfs-linux-melb:xfs-kern:26898a

Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: David Chatterton <chatz@sgi.com>
2006-09-07 14:27:05 +10:00
David Chinner
4be536debe [XFS] Prevent free space oversubscription and xfssyncd looping.
The fix for recent ENOSPC deadlocks introduced certain limitations on
allocations. The fix could cause xfssyncd to loop endlessly if we did not
leave some space free for the allocator to work correctly. Basically, we
needed to ensure that we had at least 4 blocks free for an AG free list
and a block for the inode bmap btree at all times.

However, this did not take into account the fact that each AG has a free
list that needs 4 blocks. Hence any filesystem with more than one AG could
cause oversubscription of free space and make xfssyncd spin forever trying
to allocate space needed for AG freelists that was not available in the
AG.

The following patch reserves space for the free lists in all AGs plus the
inode bmap btree which prevents oversubscription. It also prevents those
blocks from being reported as free space (as they can never be used) and
makes the SMP in-core superblock accounting code and the reserved block
ioctl respect this requirement.

SGI-PV: 955674
SGI-Modid: xfs-linux-melb:xfs-kern:26894a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: David Chatterton <chatz@sgi.com>
2006-09-07 14:26:50 +10:00
Adrian Bunk
7288026b86 [XFS] Fix char size overflow in bmap_alloc call for unwritten extent
conversion.

Since bma.conv is a char and XFS_BMAPI_CONVERT is 0x1000, bma.conv was
always assigned zero. Spotted by the GNU C compiler (SVN version).

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

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-08-30 13:41:58 +10:00
Nathan Scott
0e1edbd999 [XFS] Fix xfs_free_extent related NULL pointer dereference.
We recently fixed an out-of-space deadlock in XFS, and part of that fix
involved the addition of the XFS_ALLOC_FLAG_FREEING flag to some of the
space allocator calls to indicate they're freeing space, not allocating
it. There was a missed xfs_alloc_fix_freelist condition test that did not
correctly test "flags". The same test would also test an uninitialised
structure field (args->userdata) and depending on its value either would
or would not return early with a critical buffer pointer set to NULL.

This fixes that up, adds asserts to several places to catch future botches
of this nature, and skips sections of xfs_alloc_fix_freelist that are
irrelevent for the space-freeing case.

SGI-PV: 955303
SGI-Modid: xfs-linux-melb:xfs-kern:26743a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-08-10 14:40:41 +10:00
Nathan Scott
41ff715abc [XFS] Ensure bulkstat from an invalid inode number gets caught always with
EINVAL.

SGI-PV: 953819
SGI-Modid: xfs-linux-melb:xfs-kern:26629a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-07-28 17:05:51 +10:00
Nathan Scott
b2ea401bac [XFS] Fix a barrier related forced shutdown on mounts with quota enabled.
SGI-PV: 912426
SGI-Modid: xfs-linux-melb:xfs-kern:26622a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-07-28 17:05:13 +10:00
Nathan Scott
f5faad7994 [XFS] Fix remount vs no/barrier options by ensuring we clear unwanted
flags from iclog buffers before submitting them for writing.

SGI-PV: 954772
SGI-Modid: xfs-linux-melb:xfs-kern:26605a

Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-07-28 17:04:44 +10:00
Christoph Hellwig
2a293b7d5a [XFS] All xfs_disk_dquot_t values are (as the name says) disk endian.
Before putting them into struct statfs they should be endian-swapped.

SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26550a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
2006-07-28 17:04:26 +10:00
David Howells
b4cac1a022 [PATCH] FDPIC: Move roundup() into linux/kernel.h
Move the roundup() macro from binfmt_elf.c into linux/kernel.h as it's
generally useful.

[akpm@osdl.org: nuke all the other implementations]
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 13:24:22 -07:00
Jörn Engel
6ab3d5624e Remove obsolete #include <linux/config.h>
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-06-30 19:25:36 +02:00
Christoph Hellwig
f5e54d6e53 [PATCH] mark address_space_operations const
Same as with already do with the file operations: keep them in .rodata and
prevents people from doing runtime patching.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Steven French <sfrench@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-28 14:59:04 -07:00