aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
Commit message (Collapse)AuthorAge
* [GFS2] [-mm patch] fs/gfs2/: possible cleanupsAdrian Bunk2006-04-28
| | | | | | | | | | | | This patch contains the following possible cleanups: - make needlessly global code static - #if 0 unused functions - remove the following global function that was both unused and unimplemented: - super.c: gfs2_do_upgrade() Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Reordering in deallocation to avoid recursive lockingSteven Whitehouse2006-04-28
| | | | | | | | | | | | | | | | | Despite my earlier careful search, there was a recursive lock left in the deallocation code. This removes it. It also should speed up deallocation be reducing the number of locking operations which take place by using two "try lock" operations on the two locks involved in inode deallocation which allows us to grab the locks out of order (compared with NFS which grabs the inode lock first and the iopen lock later). It is ok for us to fail while doing this since if it does fail it means that someone else is still using the inode and thus it wouldn't be possible to deallocate anyway. This fixes the bug reported to me by Rob Kenna. Cc: Rob Kenna <rkenna@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Remove redundant casts to/from voidDavid Teigland2006-04-27
| | | | Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [DLM] lock_dlm recover_status patchDavid Teigland2006-04-26
| | | | | | | | | This saves the journal recovery result and makes it visible through sysfs. User space needs to know if the node actually recovered the journal or tried and gave up. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Remove GL_NEVER_RECURSE flagSteven Whitehouse2006-04-26
| | | | | | | There is no point in keeping this flag since recursion is not now allowed for any glock. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Don't do recursive locking in glock layerSteven Whitehouse2006-04-26
| | | | | | | | | | | | | | | This patch changes the last user of recursive locking so that it no longer needs this feature and removes it from the glock layer. This makes the glock code a lot simpler and easier to understand. Its also a prerequsite to adding support for the AOP_TRUNCATED_PAGE return code (or at least it is if you don't want your brain to melt in the process) I've left in a couple of checks just in case there is some place else in the code which is still using this feature that I didn't spot yet, but they can probably be removed long term. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Update plock code in DLM locking moduleDavid Teigland2006-04-25
| | | | | | | We should be using fl_pid not fl_owner. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Remove inherited flags from exported flags.Steven Whitehouse2006-04-25
| | | | | | | | | | | We don't need the inherited flags since this action can be implied by setting the flags on directories where they wouldn't otherwise make sense. It reduces the number of extra flags by two. Also updated the list of flags to take account of one extra ext2/3 flag. Cc: Andreas Dilger <adilger@clusterfs.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Tidy up Makefile & KconfigSteven Whitehouse2006-04-24
| | | | | | | | | | | | | Remove select of SYSFS as requested by Greg KH. Change whitespace to tabs rather than spaces in places where it was incorrect and removed 'default m' as suggested by Adrian Bunk. Reorganised Makefile as suggested by Sam Ravnborg. Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Adrian Bunk <bunk@stusta.de> Cc: Greg KH <greg@kroah.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Tidy up daemon.cSteven Whitehouse2006-04-24
| | | | | | | | As per Andrew Morton's comments, remove uneeded casts and use wait_event_interruptible() rather than open code the wait. Cc: Andrew Morton <akpm@osdl.org> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Tidy up dir code as per Christoph Hellwig's commentsSteven Whitehouse2006-04-24
| | | | | | | | | 1. Comment whitespace fix 2. Removed unused header files from dir.c 3. Split the gfs2_dir_get_buffer() function into two functions Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Move BUG() back into the header fileSteven Whitehouse2006-04-21
| | | | | | | In order to make the file and line number reporting work correctly, this has been moved back into the header file. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Add back missing BUG()Steven Whitehouse2006-04-21
| | | | Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] sem -> mutex conversion in locking.cSteven Whitehouse2006-04-21
| | | | | | | Convert a semaphore to a mutex in locking.c and also tidy up one or two loose ends. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] journal recovery patchDavid Teigland2006-04-20
| | | | | | | | | | | | | | | | This is one of the changes related to journal recovery I mentioned a couple weeks ago. We can get into a situation where there are only readonly nodes currently mounting the fs, but there are journals that need to be recovered. Since the readonly nodes can't recover journals, the next rw mounter needs to go through and check all journals and recover any that are dirty (i.e. what the first node to mount the fs does). This rw mounter needs to skip the journals held by the existing readonly nodes. Skipping those journals amounts to using the TRY flag on the journal locks so acquiring the lock of a journal held by a readonly node will fail instead of blocking indefinately. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix a bug: scheduling under a spinlockSteven Whitehouse2006-04-20
| | | | | | | | | At some stage, a mutex was added to gfs2_glock_put() without checking all its call sites. Two of them were called from under a spinlock causing random delays at various points and crashes. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Use vmalloc() in dir codeSteven Whitehouse2006-04-18
| | | | | | | | | | | | When allocating memory to sort directory entries, use vmalloc() rather than kmalloc() since for larger directories, the required size can easily be graeter than the 128k maximum of kmalloc(). Also adding the first steps towards getting the AOP_TRUNCATED_PAGE return code get in the glock code by flagging all places where we request a glock and we are holding a page lock. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix bug which was causing postmark to failSteven Whitehouse2006-04-12
| | | | | | | | | A typo in the directory code was causing postmark to fail somewhere in the allocation code, since it was unable to find newly allocated directory leaf blocks under certain circumstances. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Update journal accounting code.Steven Whitehouse2006-04-11
| | | | | | | | | | | | | | | | | | | | | A small update to the journaling code to change the way that the "extra" blocks are accounted for in the journal. These are used at a rate of one per 503 metadata blocks or one per 251 journaled data blocks (or just one if the total number of journaled blocks in the transaction is smaller). Since we are using them at two different rates the old method of accounting for them no longer works and we count them up as required. Since the "per transaction" accounting can't handle this (there is no fixed number of header blocks per transaction) we have to account for it in the general journal code. We now require that each transaction reserves more blocks than it actually needs to take account of the possible extra blocks. Also a final fix to dir.c to ensure that all ref counts are handled correctly. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Finally get ref counting correctSteven Whitehouse2006-04-07
| | | | | | | The last patch missed some other instances of incorrect ref counting, this fixes all of those too. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix a ref count bug and other clean upsSteven Whitehouse2006-04-07
| | | | | | | | | | | | | | | | | | | This fixes a ref count bug that sometimes showed up a umount time (causing it to hang) but it otherwise mostly harmless. At the same time there are some clean ups including making the log operations structures const, moving a memory allocation so that its not done in the fast path of checking to see if there is an outstanding transaction related to a particular glock. Removes the sd_log_wrap varaible which was updated, but never actually used anywhere. Updates the gfs2 ioctl() to run without the kernel lock (which it never needed anyway). Removes the "invalidate inodes" loop from GFS2's put_super routine. This is done in kill super anyway so we don't need to do it here. The loop was also bogus in that if there are any inodes "stuck" at this point its a bug and we need to know about it rather than hide it by hanging forever. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Finish off ioctl supportSteven Whitehouse2006-04-04
| | | | | | | | This puts the finishing touches to the ioctl support and also removes a couple of unused fields from GFS2's private per file structure. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Update GFS2 for the recent pull from LinusSteven Whitehouse2006-03-31
| | | | | | | | | | | | | Some interfaces have changed. In particular one of the posix locking functions has changed prototype, along with the address space operation invalidatepage and the block getting callback to the direct IO function. In addition add the splice file operations. These will need to be updated to support AOP_TRUNCATED_PAGE before they will be of much use to us. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Update ioctl() to new interfaceSteven Whitehouse2006-03-31
| | | | | | | | | | | This is designed as a fs independent way to set flags on a particular inode. The values of the ioctl() and flags are designed to be identical to the ext2/3 values. Assuming that this plan is acceptable to people in general, the plan is to then move other fs across to using the same set of #defines, etc. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS] Fix bug in endian conversion for metadata headerSteven Whitehouse2006-03-30
| | | | | | | In some cases 16 bit functions were being used rather than 32 bit functions. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Add missing {} in trans.cSteven Whitehouse2006-03-30
| | | | | | | A conditional had missing {} around the two following statements. Now added. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix bug in directory expansion codeSteven Whitehouse2006-03-29
| | | | | | | We didn't properly check that leaf splitting was allowed. We do now. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Update debugging codeSteven Whitehouse2006-03-29
| | | | | | | | | | | | Update the debugging code in trans.c and at the same time improve the debugging code for gfs2_holders. The new code should be pretty fast during the normal case and provide just as much information in case of errors (or more). One small function from glock.c has moved to glock.h as a static inline so that its return address won't get in the way of the debugging. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Update locking in log.cSteven Whitehouse2006-03-29
| | | | | | | | | | | Replace the lock_for_trans()/lock_for_flush() functions with an rwsem. In fact the sd_log_flush_lock becomes an rwsem (the write part of it) and is extended slightly to cover everything that the lock_for_flush() used to cover. The read part of the lock is instead of lock_for_trans(). This corrects the races in the original code and reduces the code size. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [DLM] Look for "nodir" in the lockspace mount optionsDavid Teigland2006-03-28
| | | | | | | | Look for "nodir" in the hostdata mount option which is used to set the NODIR flag in dlm_new_lockspace(). Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Further updates to dir and logging codeSteven Whitehouse2006-03-28
| | | | | | | | | | | | | | | | | This reduces the size of the directory code by about 3k and gets readdir() to use the functions which were introduced in the previous directory code update. Two memory allocations are merged into one. Eliminates zeroing of some buffers which were never used before they were initialised by other data. There is still scope for further improvement in the directory code. On the logging side, a hand created mutex has been replaced by a standard Linux mutex in the log allocation code. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Remove ioctl supportSteven Whitehouse2006-03-21
| | | | | | | | The various flags on inodes will in future be set and queried via the extended attributes interface, so this interface is no longer required. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix bug in directory code and tidy upSteven Whitehouse2006-03-20
| | | | | | | | | | | | | | | | | | | | | | Due to a typo, the dir leaf split operation was (for the first split in a directory) writing the new hash vaules at the wrong offset. This is now fixed. Also some other tidy ups are included: - We use GFS2's hash function for dentries (see ops_dentry.c) so that we don't have to keep recalculating the hash values. - A lot of common code is eliminated between the various directory lookup routines. - Better error checking on directory lookup (previously different routines checked for different errors) - The leaf split operation has a couple of redundant operations removed from it, so it should be faster. There is still further scope for further clean ups in the directory code, and readdir in particular could do with slimming down a bit. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Add gfs2meta filesystemSteven Whitehouse2006-03-02
| | | | | | | | | | | | | | In order to separate out the filesystem's metadata from "normal" files and directories, a new filesystem type has been created. It is called gfs2meta and mounting it gives access to the files that were previously under .gfs2_admin (well still are until mkfs is altered, which is next on the adgenda). Its not currently possible to mount both gfs2 and gfs2meta on the same block device at the same time. A future patch will allow that to happen. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix some bugsSteven Whitehouse2006-03-01
| | | | | | | | | Fix a bug I introduced earlier with a kfree() and usage of a structure in the wrong order. Also try and get the counts of the journaled data buffers "more correct". Still some work to do in this area though. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Tidy up mount code.Steven Whitehouse2006-03-01
| | | | | | | | | | | | | | | | We no longer lookup ".gfs2_admin" in the root directory in order to find it, but instead use the inode number given in the superblock. Both the root directory and the admin directory are now looked up using the same routine, so the redundant code is removed. Also, there is no longer a reference to the root inode in the GFS2 super block. When required this can be retreived via sb->s_root->d_inode instead. Assuming that we introduce a metadata filesystem type for GFS, then this is a first step towards that goal. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Remove uneeded memory allocationSteven Whitehouse2006-03-01
| | | | | | | For every filesystem operation where we need a transaction, we now make one less memory allocation. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Macros removal in gfs2.hSteven Whitehouse2006-02-27
| | | | | | | | | | | | | | As suggested by Pekka Enberg <penberg@cs.helsinki.fi>. The DIV_RU macro is renamed DIV_ROUND_UP and and moved to kernel.h The other macros are gone from gfs2.h as (although not requested by Pekka Enberg) are a number of included header file which are now included individually. The inode number comparison function is now an inline function. The DT2IF and IF2DT may be addressed in a future patch. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Remove pointless comment from nolock/main.cSteven Whitehouse2006-02-27
| | | | | | | | | As requested by: Pavel Machek <pavel@suse.cz> Pavel's other comments will be dealt with in later patches. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] 80 Column audit of locking modulesSteven Whitehouse2006-02-27
| | | | | | | Requested by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] 80 Column audit of GFS2Steven Whitehouse2006-02-27
| | | | | | | Requested by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Use BUG_ON() rather then if (...) BUG();Steven Whitehouse2006-02-27
| | | | | | | This issue was raised by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Audit printk and kmallocSteven Whitehouse2006-02-27
| | | | | | | | | | | All printk calls now have KERN_ set where required and a couple of kmalloc(), memset(.., 0, ...) calls changed to kzalloc(). This is in response to comments from: Pekka Enberg <penberg@cs.helsinki.fi> and Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Patch to remove stats counters from GFS2 (II)David Teigland2006-02-23
| | | | | Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Patch to remove stats gathering from GFS2David Teigland2006-02-23
| | | | | Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [DLM] Remove support for range locks (II)David Teigland2006-02-23
| | | | | | | | This is the second of two patches removing support for range locks from the DLM Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Missed deletion of debugging codeSteven Whitehouse2006-02-22
| | | | | | | One line which should have been deleted in the last patch was missed. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Add list empty test to databuf_lo_addSteven Whitehouse2006-02-22
| | | | | | | | | | | Heinz had spotted that I'd forgotten to test in databuf_lo_add() that the data buffer in question hadn't already been added to the list. This was causing an infinite loop later on in the "before commit" routine. This means that GFS2 is now ready to be tested by everybody. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Use mutices rather than semaphoresSteven Whitehouse2006-02-21
| | | | | | | | As well as a number of minor bug fixes, this patch changes GFS to use mutices rather than semaphores. This results in better information in case there are any locking problems. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix a case where we didn't get unstuffing rightSteven Whitehouse2006-02-15
| | | | | | | There was a bug in the unstuffing logic which caused a crash under certain circumstances. This is now fixed. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>