summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/dir.c
Commit message (Collapse)AuthorAgeFilesLines
...
* [GFS2] Fix unlinked file handlingSteven Whitehouse2006-06-141-30/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the way we have been dealing with unlinked, but still open files. It removes all limits (other than memory for inodes, as per every other filesystem) on numbers of these which we can support on GFS2. It also means that (like other fs) its the responsibility of the last process to close the file to deallocate the storage, rather than the person who did the unlinking. Note that with GFS2, those two events might take place on different nodes. Also there are a number of other changes: o We use the Linux inode subsystem as it was intended to be used, wrt allocating GFS2 inodes o The Linux inode cache is now the point which we use for local enforcement of only holding one copy of the inode in core at once (previous to this we used the glock layer). o We no longer use the unlinked "special" file. We just ignore it completely. This makes unlinking more efficient. o We now use the 4th block allocation state. The previously unused state is used to track unlinked but still open inodes. o gfs2_inoded is no longer needed o Several fields are now no longer needed (and removed) from the in core struct gfs2_inode o Several fields are no longer needed (and removed) from the in core superblock There are a number of future possible optimisations and clean ups which have been made possible by this patch. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Update copyright date to 2006Steven Whitehouse2006-05-181-1/+1
| | | | Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Readpages supportSteven Whitehouse2006-05-051-4/+4
| | | | | | | | | | | | | | | | | | This adds readpages support (and also corrects a small bug in the readpage error path at the same time). Hopefully this will improve performance by allowing GFS to submit larger lumps of I/O at a time. In order to simplify the setting of BH_Boundary, it currently gets set when we hit the end of a indirect pointer block. There is always a boundary at this point with the current allocation code. It doesn't get all the boundaries right though, so there is still room for improvement in this. See comments in fs/gfs2/ops_address.c for further information about readpages with GFS2. Signed-off-by: Steven Whitehouse
* [GFS2] [-mm patch] fs/gfs2/: possible cleanupsAdrian Bunk2006-04-281-4/+4
| | | | | | | | | | | | 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] Tidy up dir code as per Christoph Hellwig's commentsSteven Whitehouse2006-04-241-69/+75
| | | | | | | | | 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] Use vmalloc() in dir codeSteven Whitehouse2006-04-181-2/+3
| | | | | | | | | | | | 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-121-3/+2
| | | | | | | | | 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-111-6/+2
| | | | | | | | | | | | | | | | | | | | | 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-071-5/+12
| | | | | | | 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-071-0/+2
| | | | | | | | | | | | | | | | | | | 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>
* [GFS] Fix bug in endian conversion for metadata headerSteven Whitehouse2006-03-301-3/+3
| | | | | | | In some cases 16 bit functions were being used rather than 32 bit functions. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix bug in directory expansion codeSteven Whitehouse2006-03-291-9/+14
| | | | | | | We didn't properly check that leaf splitting was allowed. We do now. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Further updates to dir and logging codeSteven Whitehouse2006-03-281-251/+161
| | | | | | | | | | | | | | | | | 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] Fix bug in directory code and tidy upSteven Whitehouse2006-03-201-841/+519
| | | | | | | | | | | | | | | | | | | | | | 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] Macros removal in gfs2.hSteven Whitehouse2006-02-271-2/+6
| | | | | | | | | | | | | | 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] 80 Column audit of GFS2Steven Whitehouse2006-02-271-10/+20
| | | | | | | Requested by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Fix the bugs I introduced in the last patch but oneSteven Whitehouse2006-02-141-27/+29
| | | | | | Various endianess changes required in the directory code. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Change ondisk format (hopefully for the last time)Steven Whitehouse2006-02-131-17/+19
| | | | | | | | | | | | | There were one or two fields in structures which didn't get changed last time back to their gfs1 sizes and alignments. One or two constants have also changed back to their original values which were missed the first time. Its possible that indirect pointer blocks might need to change. If they don't we'll have to rewrite them all on upgrade due to a change in the amount of padding that they use. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Make journaled data files identical to normal files on diskSteven Whitehouse2006-02-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a very large patch, with a few still to be resolved issues so you might want to check out the previous head of the tree since this is known to be unstable. Fixes for the various bugs will be forthcoming shortly. This patch removes the special data format which has been used up till now for journaled data files. Directories still retain the old format so that they will remain on disk compatible with earlier releases. As a result you can now do the following with journaled data files: 1) mmap them 2) export them over NFS 3) convert to/from normal files whenever you want to (the zero length restriction is gone) In addition the level at which GFS' locking is done has changed for all files (since they all now use the page cache) such that the locking is done at the page cache level rather than the level of the fs operations. This should mean that things like loopback mounts and other things which touch the page cache directly should now work. Current known issues: 1. There is a lock mode inversion problem related to the resource group hold function which needs to be resolved. 2. Any significant amount of I/O causes an oops with an offset of hex 320 (NULL pointer dereference) which appears to be related to a journaled data buffer appearing on a list where it shouldn't be. 3. Direct I/O writes are disabled for the time being (will reappear later) 4. There is probably a deadlock between the page lock and GFS' locks under certain combinations of mmap and fs operation I/O. 5. Issue relating to ref counting on internally used inodes causes a hang on umount (discovered before this patch, and not fixed by it) 6. One part of the directory metadata is different from GFS1 and will need to be resolved before next release. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Make dir.c independant of jdata.cSteven Whitehouse2006-01-301-9/+255
| | | | | | | | Copy & rename various jdata functions into dir.c. The plan being that directory metadata format will not change although the journalled data format for "normal" files will change. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Add an additional argument to gfs2_trans_add_bh()Steven Whitehouse2006-01-181-16/+16
| | | | | | | | | This adds an extra argument to gfs2_trans_add_bh() to indicate whether the bh being added to the transaction is metadata or data. Its currently unused since all existing callers set it to 1 (metadata) but following patches will make use of it. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] Remove unused code from various filesSteven Whitehouse2006-01-181-51/+0
| | | | Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
* [GFS2] The core of GFS2David Teigland2006-01-161-0/+2157
This patch contains all the core files for GFS2. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
OpenPOWER on IntegriCloud