convert incremental fsck to using sqlite database
Did not keep backwards compat for sticky bit records. An incremental fsck that is already in progress will start over on upgrade to this version. This is not yet ready for merging. The autobuilders need to have sqlite installed. Also, interrupting a fsck --incremental does not commit the database. So, resuming with fsck --more restarts from beginning. Memory: Constant during a fsck of tens of thousands of files. (But, it does seem to buffer whole transation in memory, so may really scale with number of files.) CPU: ?
This commit is contained in:
parent
bb242bdd82
commit
91e9146d1b
9 changed files with 185 additions and 177 deletions
27
Database/Types.hs
Normal file
27
Database/Types.hs
Normal file
|
@ -0,0 +1,27 @@
|
|||
{- types for SQL databases
|
||||
-
|
||||
- Copyright 2015 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU GPL version 3 or higher.
|
||||
-}
|
||||
|
||||
{-# LANGUAGE TemplateHaskell #-}
|
||||
|
||||
module Database.Types where
|
||||
|
||||
import Database.Persist.TH
|
||||
import Data.Maybe
|
||||
|
||||
import Types.Key
|
||||
|
||||
-- A serialized Key
|
||||
newtype SKey = SKey String
|
||||
deriving (Show, Read)
|
||||
|
||||
toSKey :: Key -> SKey
|
||||
toSKey = SKey . key2file
|
||||
|
||||
fromSKey :: SKey -> Key
|
||||
fromSKey (SKey s) = fromMaybe (error $ "bad serialied key " ++ s) (file2key s)
|
||||
|
||||
derivePersistField "SKey"
|
Loading…
Add table
Add a link
Reference in a new issue