]> git.neil.brown.name Git - LaFS.git/commitdiff
Allow cleaner to skip new filesystems.
authorNeilBrown <neilb@suse.de>
Sat, 14 Aug 2010 11:09:40 +0000 (21:09 +1000)
committerNeilBrown <neilb@suse.de>
Sat, 14 Aug 2010 11:09:40 +0000 (21:09 +1000)
If we can tell the a subset-filesystem is too new to
match what we find in the write-cluster, we can skip it
quickly.

Signed-off-by: NeilBrown <neilb@suse.de>
clean.c

diff --git a/clean.c b/clean.c
index 115892eabeabff64f8c8db473e88a486971783ed..d436a324d64960c7254e1af9a91fef6de77155a2 100644 (file)
--- a/clean.c
+++ b/clean.c
@@ -277,6 +277,20 @@ static void cleaner_parse(struct fs *fs, struct toclean *tc)
                    ino_from_sb(ino->i_sb)->i_ino != fsnum) {
                        if (ino)
                                iput(ino);
+                       if (fsnum) {
+                               struct inode *fsino =
+                                       lafs_iget_fs(fs, 0, fsnum, ASYNC);
+                               if (IS_ERR(fsino))
+                                       ino = fsino;
+                               else if (LAFSI(fsino)->md.fs.creation_age > tc->seq) {
+                                       /* skip this inode as filesystem
+                                        * is newer
+                                        */
+                                       iput(fsino);
+                                       ino = NULL;
+                                       goto skip_inode;
+                               }
+                       }
                        ino = lafs_iget_fs(fs, fsnum, inum, ASYNC);
                }
                if (!IS_ERR(ino)) {