aboutsummaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_log_recover.c
AgeCommit message (Collapse)AuthorFilesLines
2008-02-07[XFS] clean up some xfs_log_priv.h macrosChristoph Hellwig1-7/+5
- the various assign lsn macros are replaced by a single inline, xlog_assign_lsn, which is equivalent to ASSIGN_ANY_LSN_HOST except for a more sane calling convention. ASSIGN_LSN_DISK is replaced by xlog_assign_lsn and a manual bytespap, and ASSIGN_LSN by the same, except we pass the cycle and block arguments explicitly instead of a log paramter. The latter two variants only had 2, respectively one user anyway. - the GET_CYCLE is replaced by a xlog_get_cycle inline with exactly the same calling conventions. - GET_CLIENT_ID is replaced by xlog_get_client_id which leaves away the unused arch argument. Instead of conditional defintions depending on host endianess we now do an unconditional swap and shift then, which generates equal code. - the unused XLOG_SET macro is removed. SGI-PV: 971186 SGI-Modid: xfs-linux-melb:xfs-kern:29820a Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Lachlan McIlroy <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2008-02-07[XFS] clean up some xfs_log_priv.h macrosChristoph Hellwig1-13/+16
- the various assign lsn macros are replaced by a single inline, xlog_assign_lsn, which is equivalent to ASSIGN_ANY_LSN_HOST except for a more sane calling convention. ASSIGN_LSN_DISK is replaced by xlog_assign_lsn and a manual bytespap, and ASSIGN_LSN by the same, except we pass the cycle and block arguments explicitly instead of a log paramter. The latter two variants only had 2, respectively one user anyway. - the GET_CYCLE is replaced by a xlog_get_cycle inline with exactly the same calling conventions. - GET_CLIENT_ID is replaced by xlog_get_client_id which leaves away the unused arch argument. Instead of conditional defintions depending on host endianess we now do an unconditional swap and shift then, which generates equal code. - the unused XLOG_SET macro is removed. SGI-PV: 971186 SGI-Modid: xfs-linux-melb:xfs-kern:29819a Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Lachlan McIlroy <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2008-02-07[XFS] Unwrap AIL_LOCKDonald Douwsma1-12/+9
SGI-PV: 970382 SGI-Modid: xfs-linux-melb:xfs-kern:29739a Signed-off-by: Donald Douwsma <[email protected]> Signed-off-by: Eric Sandeen <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2007-10-16[XFS] Turn off XBF_ASYNC flag before re-reading superblock.Lachlan McIlroy1-0/+3
SGI-PV: 971603 SGI-Modid: xfs-linux-melb:xfs-kern:29871a Signed-off-by: Lachlan McIlroy <[email protected]> Signed-off-by: David Chinner <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2007-10-15[XFS] superblock endianess annotationsChristoph Hellwig1-2/+2
Creates a new xfs_dsb_t that is __be annotated and keeps xfs_sb_t for the incore one. xfs_xlatesb is renamed to xfs_sb_to_disk and only handles the incore -> disk conversion. A new helper xfs_sb_from_disk handles the other direction and doesn't need the slightly hacky table-driven approach because we only ever read the full sb from disk. The handling of shared r/o filesystems has been buggy on little endian system and fixing this required shuffling around of some code in that area. SGI-PV: 968563 SGI-Modid: xfs-linux-melb:xfs-kern:29477a Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: David Chinner <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2007-10-15[XFS] dinode endianess annotationsChristoph Hellwig1-14/+11
Biggest bit is duplicating the dinode structure so we have one annotated for native endianess and one for disk endianess. The other significant change is that xfs_xlate_dinode_core is split into one helper per direction to allow for proper annotations, everything else is trivial. As a sidenode splitting out the incore dinode means we can move it into xfs_inode.h in a later patch and severely improving on the include hell in xfs. SGI-PV: 968563 SGI-Modid: xfs-linux-melb:xfs-kern:29476a Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: David Chinner <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2007-10-01Revert "[XFS] Avoid replaying inode buffer initialisation log items if ↵Tim Shimmin1-48/+3
on-disk version is newer." This reverts commit b394e43e995d08821588a22561c6a71a63b4ff27. SGI-PV: 969656 SGI-Modid: xfs-linux-melb:xfs-kern:29804a Signed-off-by: Lachlan McIlroy <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2007-09-20[XFS] fix valid but harmless sparse warningChristoph Hellwig1-2/+2
The new xlog_recover_do_reg_buffer checks call be16_to_cpu on di_gen which is a 32bit value so sparse rightly complains. Fortunately the warning is harmless because we don't care for the value, but only whether it's non-NULL. Due to that fact we can simply kill the endian swaps on this and the previous di_mode check entirely. SGI-PV: 969656 SGI-Modid: xfs-linux-melb:xfs-kern:29709a Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Lachlan McIlroy <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2007-09-18[XFS] Avoid replaying inode buffer initialisation log items if on-disk ↵Lachlan McIlroy1-3/+48
version is newer. SGI-PV: 969656 SGI-Modid: xfs-linux-melb:xfs-kern:29676a Signed-off-by: Lachlan McIlroy <[email protected]> Signed-off-by: David Chinner <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2007-09-05[XFS] Fix sparse NULL vs 0 warningsChristoph Hellwig1-6/+6
Sparse now warns about comparing pointers to 0, so change all instance where that happens to NULL instead. SGI-PV: 968555 SGI-Modid: xfs-linux-melb:xfs-kern:29308a Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: David Chinner <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2007-07-14[XFS] Lazy Superblock CountersDavid Chinner1-0/+8
When we have a couple of hundred transactions on the fly at once, they all typically modify the on disk superblock in some way. create/unclink/mkdir/rmdir modify inode counts, allocation/freeing modify free block counts. When these counts are modified in a transaction, they must eventually lock the superblock buffer and apply the mods. The buffer then remains locked until the transaction is committed into the incore log buffer. The result of this is that with enough transactions on the fly the incore superblock buffer becomes a bottleneck. The result of contention on the incore superblock buffer is that transaction rates fall - the more pressure that is put on the superblock buffer, the slower things go. The key to removing the contention is to not require the superblock fields in question to be locked. We do that by not marking the superblock dirty in the transaction. IOWs, we modify the incore superblock but do not modify the cached superblock buffer. In short, we do not log superblock modifications to critical fields in the superblock on every transaction. In fact we only do it just before we write the superblock to disk every sync period or just before unmount. This creates an interesting problem - if we don't log or write out the fields in every transaction, then how do the values get recovered after a crash? the answer is simple - we keep enough duplicate, logged information in other structures that we can reconstruct the correct count after log recovery has been performed. It is the AGF and AGI structures that contain the duplicate information; after recovery, we walk every AGI and AGF and sum their individual counters to get the correct value, and we do a transaction into the log to correct them. An optimisation of this is that if we have a clean unmount record, we know the value in the superblock is correct, so we can avoid the summation walk under normal conditions and so mount/recovery times do not change under normal operation. One wrinkle that was discovered during development was that the blocks used in the freespace btrees are never accounted for in the AGF counters. This was once a valid optimisation to make; when the filesystem is full, the free space btrees are empty and consume no space. Hence when it matters, the "accounting" is correct. But that means the when we do the AGF summations, we would not have a correct count and xfs_check would complain. Hence a new counter was added to track the number of blocks used by the free space btrees. This is an *on-disk format change*. As a result of this, lazy superblock counters are a mkfs option and at the moment on linux there is no way to convert an old filesystem. This is possible - xfs_db can be used to twiddle the right bits and then xfs_repair will do the format conversion for you. Similarly, you can convert backwards as well. At some point we'll add functionality to xfs_admin to do the bit twiddling easily.... SGI-PV: 964999 SGI-Modid: xfs-linux-melb:xfs-kern:28652a Signed-off-by: David Chinner <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2007-05-08[XFS] Get rid of redundant "required" in msg.Utako Kusaka1-2/+1
SGI-PV: 963466 SGI-Modid: xfs-linux-melb:xfs-kern:28416a Signed-off-by: Utako Kusaka <[email protected]> Signed-off-by: Tim Shimmin <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2007-05-08[XFS] remove more misc. unused argsEric Sandeen1-5/+3
Patch provided by Eric Sandeen. SGI-PV: 961695 SGI-Modid: xfs-linux-melb:xfs-kern:28205a Signed-off-by: Eric Sandeen <[email protected]> Signed-off-by: Lachlan McIlroy <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2007-05-08[XFS] The last argument "lsn" of xfs_trans_commit() is always called withEric Sandeen1-2/+2
NULL. Patch provided by Eric Sandeen. SGI-PV: 961693 SGI-Modid: xfs-linux-melb:xfs-kern:28199a Signed-off-by: Eric Sandeen <[email protected]> Signed-off-by: Lachlan McIlroy <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2007-02-10[XFS] Re-initialize the per-cpu superblock counters after recovery.Lachlan McIlroy1-0/+3
After filesystem recovery the superblock is re-read to bring in any changes. If the per-cpu superblock counters are not re-initialized from the superblock then the next time the per-cpu counters are disabled they might overwrite the global counter with a bogus value. SGI-PV: 957348 SGI-Modid: xfs-linux-melb:xfs-kern:27999a Signed-off-by: Lachlan McIlroy <[email protected]> Signed-off-by: David Chinner <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2007-02-10[XFS] Get rid of old 5.3/6.1 v1 log items. Cleanup patch sent in by EricEric Sandeen1-56/+2
Sandeen. SGI-PV: 958736 SGI-Modid: xfs-linux-melb:xfs-kern:27596a Signed-off-by: Eric Sandeen <[email protected]> Signed-off-by: Tim Shimmin <[email protected]>
2006-06-28[XFS] Rework code snippets slightly to remove remaining recent-gccNathan Scott1-0/+2
warnings. SGI-PV: 904196 SGI-Modid: xfs-linux-melb:xfs-kern:26364a Signed-off-by: Nathan Scott <[email protected]>
2006-06-20[XFS] Remove version 1 directory code. Never functioned on Linux, justNathan Scott1-2/+0
pure bloat. SGI-PV: 952969 SGI-Modid: xfs-linux-melb:xfs-kern:26251a Signed-off-by: Nathan Scott <[email protected]>
2006-06-09[XFS] Portability changes: remove prdev, stick to one diagnosticNathan Scott1-9/+9
interface. SGI-PV: 953338 SGI-Modid: xfs-linux-melb:xfs-kern:26103a Signed-off-by: Nathan Scott <[email protected]>
2006-06-09[XFS] Shutdown the filesystem if all device paths have gone. MadeNathan Scott1-1/+1
shutdown vop flags consistent with sync vop flags declarations too. SGI-PV: 939911 SGI-Modid: xfs-linux-melb:xfs-kern:26096a Signed-off-by: Nathan Scott <[email protected]>
2006-06-09[XFS] Over zealous with doing endian conversions. We endian converted theTim Shimmin1-2/+2
logged version of di_next_unlinked which is actually always stored in the correct ondisk format. This was pointed out to us by Shailendra Tripathi. And is evident in the xfs qa test of 121. SGI-PV: 953263 SGI-Modid: xfs-linux-melb:xfs-kern:26044a Signed-off-by: Tim Shimmin <[email protected]> Signed-off-by: Nathan Scott <[email protected]>
2006-06-09[XFS] inode items and EFI/EFDs have different ondisk format for 32bit andTim Shimmin1-31/+56
64bit kernels allow recovery to handle both versions and do the necessary decoding SGI-PV: 952214 SGI-Modid: xfs-linux-melb:xfs-kern:26011a Signed-off-by: Tim Shimmin <[email protected]> Signed-off-by: Nathan Scott <[email protected]>
2006-03-29[XFS] We really suck at spulling. Thanks to Chris Pascoe for fixing allNathan Scott1-2/+2
these typos. SGI-PV: 904196 SGI-Modid: xfs-linux-melb:xfs-kern:25539a Signed-off-by: Nathan Scott <[email protected]>
2006-03-17[XFS] Fix an infinite loop issue in bulkstat when a corrupt inode isNathan Scott1-1/+1
detected. Thanks to Roger Willcocks. SGI-PV: 951054 SGI-Modid: xfs-linux-melb:xfs-kern:25477a Signed-off-by: Nathan Scott <[email protected]>
2006-01-11[XFS] Fix quotaoff logitem for project quota, affects log recovery only.Nathan Scott1-1/+3
SGI-PV: 946444 SGI-Modid: xfs-linux-melb:xfs-kern:24768a Signed-off-by: Nathan Scott <[email protected]>
2006-01-11[XFS] remove unused "readonly" arg from xlog_find_tail and xlog_recoverEric Sandeen1-5/+3
SGI-PV: 946611 SGI-Modid: xfs-linux-melb:xfs-kern:203307a Signed-off-by: Eric Sandeen <[email protected]> Signed-off-by: Nathan Scott <[email protected]>
2005-11-02[XFS] Endianess annotations for various allocator data structuresChristoph Hellwig1-24/+18
SGI-PV: 943272 SGI-Modid: xfs-linux:xfs-kern:201006a Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nathan Scott <[email protected]>
2005-11-02[XFS] endianess annotations and cleanup for the quota codeChristoph Hellwig1-31/+27
SGI-PV: 943272 SGI-Modid: xfs-linux:xfs-kern:199767a Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nathan Scott <[email protected]>
2005-11-02[XFS] Update license/copyright notices to match the prefered SGINathan Scott1-25/+11
boilerplate. SGI-PV: 913862 SGI-Modid: xfs-linux:xfs-kern:23903a Signed-off-by: Nathan Scott <[email protected]>
2005-11-02[XFS] Remove xfs_macros.c, xfs_macros.h, rework headers a whole lot.Nathan Scott1-12/+11
SGI-PV: 943122 SGI-Modid: xfs-linux:xfs-kern:23901a Signed-off-by: Nathan Scott <[email protected]>
2005-11-02[XFS] Track external log/realtime device names for correct reporting inNathan Scott1-6/+9
/proc/mounts. SGI-PV: 942984 SGI-Modid: xfs-linux:xfs-kern:23862a Signed-off-by: Nathan Scott <[email protected]>
2005-09-02[XFS] Fix sparse warnings in kmem_* functions Patch from Victor FuscoChristoph Hellwig1-1/+1
<[email protected]> SGI-PV: 940376 SGI-Modid: xfs-linux:xfs-kern:196705a Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nathan Scott <[email protected]>
2005-06-21[XFS] consolidate extent item freeingChristoph Hellwig1-11/+3
SGI-PV: 938062 SGI-Modid: xfs-linux:xfs-kern:194415a Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nathan Scott <[email protected]>
2005-06-21[XFS] Add support for project quota, based on Dan Knappes earlier work.Nathan Scott1-3/+8
SGI-PV: 932952 SGI-Modid: xfs-linux:xfs-kern:22805a Signed-off-by: Nathan Scott <[email protected]>
2005-06-21[XFS] mark various symbols static Patch from Adrian BunkChristoph Hellwig1-3/+3
SGI-PV: 936255 SGI-Modid: xfs-linux:xfs-kern:192760a Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Nathan Scott <[email protected]>
2005-04-16Linux-2.6.12-rc2Linus Torvalds1-0/+4098
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!