aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
Commit message (Collapse)AuthorAge
* [GFS2] Fix OOM error handlingSteven Whitehouse2006-11-06
| | | | | | | Fix the OOM error handling in inode.c where it was possible for a NULL pointer to be dereferenced. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix incorrect fs sync behaviour.Steven Whitehouse2006-11-06
| | | | | | | | | | | | This adds a sync_fs superblock operation for GFS2 and removes the journal flush from write_super in favour of sync_fs where it ought to be. This is more or less identical to the way in which ext3 does this. This bug was pointed out by Russell Cattelan <cattelan@redhat.com> Cc: Russell Cattelan <cattelan@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] don't panic needlesslyAlexey Dobriyan2006-11-06
| | | | | | | | First, SLAB_PANIC is unjustified. Second, all error propagating and backing out is in place. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [PATCH] gfs2: ->readpages() fixesOGAWA Hirofumi2006-11-03
| | | | | | | | | | | | This just ignore the remaining pages, and remove unneeded unlock_pages(). Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Cc: Steven French <sfrench@us.ibm.com> Cc: Miklos Szeredi <miklos@szeredi.hu> Acked-by: Steven Whitehouse <swhiteho@redhat.com> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [GFS2] gfs2_dir_read_data(): fix uninitialized variable usageAdrian Bunk2006-10-20
| | | | | | | | | | | | | | In the "if (extlen)" case, "bh" was used uninitialized. This patch changes the code to what seems to have been intended. Spotted by the Coverity checker. This patch also removes a pointless "bh = NULL" asignment (the variable is never accessed again after this point). Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] fs/gfs2/ops_fstype.c:fill_super_meta(): fix NULL dereferenceAdrian Bunk2006-10-20
| | | | | | | | | Don't dereference new->s_root when we do know it's NULL. Spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] fs/gfs2/dir.c:gfs2_dir_write_data(): don't use an uninitialized variableAdrian Bunk2006-10-20
| | | | | | | | | | | In the "if (extlen)" case, "new" might be used uninitialized. Looking at the code, it should be initialized to 0. Spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] fs/gfs2/ops_fstype.c:gfs2_get_sb_meta(): remove unused variableAdrian Bunk2006-10-20
| | | | | | | The Coverity checker spotted this unused variable. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] fs/gfs2/dir.c:gfs2_dir_write_data(): remove dead codeAdrian Bunk2006-10-20
| | | | | | | The Coverity checker spotted this obviously dead code. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] gfs2 endianness bug: be16 assigned to be32 fieldAl Viro2006-10-20
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix bmap to map extents properlySteven Whitehouse2006-10-20
| | | | | | | | | This fix means that bmap will map extents of the length requested by the VFS rather than guessing at it, or just mapping one block at a time. The other callers of gfs2_block_map are audited to ensure they send the correct max extent lengths (i.e. set bh->b_size correctly). Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Pass the correct value to kunmap_atomicRussell Cattelan2006-10-12
| | | | | | | Pass kaddr rather than (incorrect) struct page to kunmap_atomic. Signed-off-by: Russell Cattelan <cattelan@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix bug where lock not heldSteven Whitehouse2006-10-12
| | | | | | | The log lock needs to be held when manipulating the counter for the number of free journal blocks. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix uninitialised variableSteven Whitehouse2006-10-12
| | | | | | | | This fixes a bug where, in certain cases an uninitialised variable could cause a dereference of a NULL pointer in gfs2_commit_write(). Also a typo in a comment is fixed at the same time. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix a size calculation errorRussell Cattelan2006-10-12
| | | | | | | | | | | | | | Fix a size calculation error. The size was incorrect being computed as a negative length and then being passed to an unsigned parameter. This in turn would cause the allocator to think it needed enough meta data to store a gigabyte file for every file created. Signed-off-by: Russell Cattelan <cattelan@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [PATCH] misuse of strstrAl Viro2006-10-11
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [GFS2] Fix endian bug for de_typeSteven Whitehouse2006-10-03
| | | | | | Missing endian conversion for the de_type field. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Initialize SELinux extended attributes at inode creation time.Ryan O'Hara2006-10-03
| | | | | | | | | | This patch has gfs2_security_init declared as a static function, which is correct. As a result, the declaration of this function in inode.h is removed (and thus inode.h is unchanged). Also removed #include eaops.h, which is not needed. Signed-Off-By: Ryan O'Hara <rohara@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Move logging code into log.c (mostly)Steven Whitehouse2006-10-03
| | | | | | | | This moves the logging code from meta_io.c into log.c and glops.c. As a result the routines can now be static and all the logging code is together in log.c, leaving meta_io.c with just metadata i/o code in it. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Mark nlink cleared so VFS sees it happenSteven Whitehouse2006-10-02
| | | | | | | This does nothing atm, but will be required for later support of r/o bind mounts. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Two redundant casts removedSteven Whitehouse2006-10-02
| | | | Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Remove uneeded endian conversionSteven Whitehouse2006-10-02
| | | | | | | | | | | | | In many places GFS2 was calling the endian conversion routines for an inode even when only a single field, or a few fields might have changed. As a result we were copying lots of data needlessly. This patch replaces those calls with conversion of just the required fields in each case. This should be faster and easier to understand. There are still other places which suffer from this problem, but this is a start in the right direction. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Remove duplicate sb reading codeSteven Whitehouse2006-10-02
| | | | | | | | | For some reason we had two different sets of code for reading in the superblock. This removes one of them in favour of the other. Also we don't need the temporary buffer for the sb since we already have one in the gfs2 sb itself. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Mark metadata reads for blktraceSteven Whitehouse2006-10-02
| | | | | | Mark the metadata reads so that blktrace knows what they are. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Remove iflags.h, use FS_Steven Whitehouse2006-10-02
| | | | | | | | | | | | | | | | Update GFS2 in the light of David Howells' patch: [PATCH] BLOCK: Move common FS-specific ioctls to linux/fs.h [try #6] 36695673b012096228ebdc1b39a6a5850daa474e which calls the filesystem independant flags FS_..._FL. As a result we no longer need the flags.h file and the conversion routine is moved into the GFS2 source code. Userland programs which used to include iflags.h should now include fs.h and use the new flag names. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix code style/indent in ops_file.cSteven Whitehouse2006-10-02
| | | | | | Fix a couple of minor issues. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] streamline-generic_file_-interfaces-and-filemap gfs fixAndrew Morton2006-10-02
| | | | | | | | Fix GFS for streamline-generic_file_-interfaces-and-filemap.patch Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Remove readv/writev methods and use aio_read/aio_write instead (gfs bits)Badari Pulavarty2006-10-02
| | | | | | | | | | This patch removes readv() and writev() methods and replaces them with aio_read()/aio_write() methods. Signed-off-by: Badari Pulavarty <pbadari@us.ibm.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] inode-diet: Eliminate i_blksize from the inode structureTheodore Ts'o2006-09-28
| | | | | | | | | | | | | 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. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org>
* [GFS2] inode_diet: Replace inode.u.generic_ip with inode.i_private (gfs)Theodore Ts'o2006-09-28
| | | | | | | | | | | | | | | | | | | | | | | The following patches reduce the size of the VFS inode structure by 28 bytes on a UP x86. (It would be more on an x86_64 system). This is a 10% reduction in the inode size on a UP kernel that is configured in a production mode (i.e., with no spinlock or other debugging functions enabled; if you want to save memory taken up by in-core inodes, the first thing you should do is disable the debugging options; they are responsible for a huge amount of bloat in the VFS inode structure). This patch: The filesystem or device-specific pointer in the inode is inside a union, which is pretty pointless given that all 30+ users of this field have been using the void pointer. Get rid of the union and rename it to i_private, with a comment to explain who is allowed to use the void pointer. This is just a cleanup, but it allows us to reuse the union 'u' for something something where the union will actually be used. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org>
* [GFS2] Fix bug in Makefiles for lock modulesSteven Whitehouse2006-09-27
| | | | | | | | The Makefile had the wrong CONFIG_ variable in it so that in case GFS2 was y and the lock modules were m, they were not getting built properly. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2/DLM] Fix trailing whitespaceSteven Whitehouse2006-09-25
| | | | | | | As per Andrew Morton's request, removed trailing whitespace. Cc: Andrew Morton <akpm@osdl.org> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Tidy up meta_io codeSteven Whitehouse2006-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug in the directory reading code, where we might have dereferenced a NULL pointer in case of OOM. Updated the directory code to use the new & improved version of gfs2_meta_ra() which now returns the first block that was being read. Previously it was releasing it requiring following code to grab the block again at each point it was called. Also turned off readahead on directory lookups since we are reading a hash table, and therefore reading the entries in order is very unlikely. Readahead is still used for all other calls to the directory reading function (e.g. when growing the hash table). Removed the DIO_START constant. Everywhere this was used, it was used to unconditionally start i/o aside from a couple of places, so I've removed it and made the couple of exceptions to this rule into separate functions. Also hunted through the other DIO flags and removed them as arguments from functions which were always called with the same combination of arguments. Updated gfs2_meta_indirect_buffer to be a bit more efficient and hopefully also be a bit easier to read. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Remove unused constantsSteven Whitehouse2006-09-20
| | | | | | Three of the DIO constants were not being used, so remove them. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Remove "NFS only" readdir pathSteven Whitehouse2006-09-19
| | | | | | | This code path shouldn't be needed, so remove it for now. This tidys things up. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Use list_for_each_entry_safe_reverse in gfs2_ail1_start()Steven Whitehouse2006-09-19
| | | | | | | | | | This is an attempt to fix Red Hat bz 204364. I don't hit it all the time, but with these changes, running postmark which used to trigger it on a regular basis no longer appears to. So I'm not saying that its 100% certain that its fixed, but it does look promising at the moment. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Export lm_interface to kernel headersFabio Massimo Di Nitto2006-09-19
| | | | | | | | | | | | | | | lm_interface.h has a few out of the tree clients such as GFS1 and userland tools. Right now, these clients keeps a copy of the file in their build tree that can go out of sync. Move lm_interface.h to include/linux, export it to userland and clean up fs/gfs2 to use the new location. Signed-off-by: Fabio M. Di Nitto <fabbione@ubuntu.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] inode-diet-eliminate-i_blksize-and-use-a-per-superblock-default-vs-gfs2akpm@osdl.org2006-09-19
| | | | | | | | | i_blksize got removed in -mm. Cc: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Tweek unlock test in readpage()Steven Whitehouse2006-09-18
| | | | | | This make the unlock test a bit simpler. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix for mmap() bug in readpageRussell Cattelan2006-09-18
| | | | | | | | Fix for Red Hat bz 205307. Don't need to lock in readpage if the higher level code has already grabbed the lock. Signed-off-by: Russell Cattelan <cattelan@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Map multiple blocks at once where possibleSteven Whitehouse2006-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a tidy up of the GFS2 bmap code. The main change is that the bh is passed to gfs2_block_map allowing the flags to be set directly rather than having to repeat that code several times in ops_address.c. At the same time, the extent mapping code from gfs2_extent_map has been moved into gfs2_block_map. This allows all calls to gfs2_block_map to map extents in the case that no allocation is taking place. As a result reads and non-allocating writes should be faster. A quick test with postmark appears to support this. There is a limit on the number of blocks mapped in a single bmap call in that it will only ever map blocks which are pointed to from a single pointer block. So in other words, it will never try to do additional i/o in order to satisfy read-ahead. The maximum number of blocks is thus somewhat less than 512 (the GFS2 4k block size minus the header divided by sizeof(u64)). I've further limited the mapping of "normal" blocks to 32 blocks (to avoid extra work) since readpages() will currently read a maximum of 32 blocks ahead (128k). Some further work will probably be needed to set a suitable value for DIO as well, but for now thats left at the maximum 512 (see ops_address.c:gfs2_get_block_direct). There is probably a lot more that can be done to improve bmap for GFS2, but this is a good first step. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] print mount errors related to sysfsDavid Teigland2006-09-18
| | | | | | | | Print an error message if mount fails in setting up the sysfs files. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix glock hash clearingSteven Whitehouse2006-09-14
| | | | | | | A one liner bug fix to prevent the return value being wrong when more than one superblock is mounted. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Tidy up log.cSteven Whitehouse2006-09-13
| | | | | | | Based upon previous feedback from lkml and also removing some commented out debugging which is no longer needed. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Use atomic_t rather than kref in glock.cSteven Whitehouse2006-09-13
| | | | | | | Use atomic_t as the ref count in glocks rather than a kref. This is another step towards using RCU for the glock hash. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Use hlist for glock hash chainsSteven Whitehouse2006-09-12
| | | | | | | | | | | | | | | | | | This results in smaller list heads, so that we can have more chains in the same amount of memory (twice as many). I've multiplied the size of the table by four though - this is because we are saving memory by not having one lock per chain any more. So we land up using about the same amount of memory for the hash table as we did before I started these changes, the difference being that we now have four times as many hash chains. The reason that I say "about the same amount of memory" is that the actual amount now depends upon the NR_CPUS and some of the config variables, so that its not exact and in some cases we do use more memory. Eventually we might want to scale the hash table size according to the size of physical ram as measured on module load. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Rewrite of examine_bucket()Steven Whitehouse2006-09-11
| | | | | | | | | | | | | | | | | | | | | The existing implementation of this function in glock.c was not very efficient as it relied upon keeping a cursor element upon the hash chain in question and moving it along. This new version improves upon this by using the current element as a cursor. This is possible since we only look at the "next" element in the list after we've taken the read_lock() subsequent to calling the examiner function. Obviously we have to eventually drop the ref count that we are then left with and we cannot do that while holding the read_lock, so we do that next time we drop the lock. That means either just before we examine another glock, or when the loop has terminated. The new implementation has several advantages: it uses only a read_lock() rather than a write_lock(), so it can run simnultaneously with other code, it doesn't need a "plug" element, so that it removes a test not only from this list iterator, but from all the other glock list iterators too. So it makes things faster and smaller. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Remove unused function from glock.cSteven Whitehouse2006-09-09
| | | | | | | The callback for iopen locks is unused, so this removes it. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Add consts to glock sorting functionSteven Whitehouse2006-09-09
| | | | | | | Add back the consts which were casted away in the glock sorting function. Also add early exit code. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Make glock hash locks proportional to NR_CPUSSteven Whitehouse2006-09-09
| | | | | | | | | Make the number of locks used for hash chains in glock.c proportional to NR_CPUS. Also move constants for the number of hash chains into glock.c from incore.h since they are not used outside of glock.c. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>