]> git.neil.brown.name Git - LaFS.git/commitdiff
Log symlink creation
authorNeilBrown <neilb@suse.de>
Mon, 13 Sep 2010 07:33:54 +0000 (17:33 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 13 Sep 2010 07:33:54 +0000 (17:33 +1000)
We cannot include it in an update, so just make sure it goes in the
next write cluster.  This will be before an sync or fsync and
roll-forward should pick it up, so all is OK

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

diff --git a/dir.c b/dir.c
index 50a7374c5eb979448505a09fade5aaa69ac0f458..e1555f63e192b951ef9e3288f22e6865e5d2b93e 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -904,7 +904,6 @@ abort:
        return err;
 }
 
-/* FIXME I'm not logging the body of the symlink being created */
 static int
 lafs_symlink(struct inode *dir, struct dentry *de,
             const char *symlink)
@@ -956,6 +955,7 @@ retry:
        LAFSI(ino)->md.file.parent = dir->i_ino;
        lafs_add_orphan(fs, inodb);
 
+       lafs_iolock_block(&b->b);
        buf = map_dblock(b);
        memcpy(buf, symlink, l);
        buf[l] = 0;
@@ -963,6 +963,8 @@ retry:
        set_bit(B_Valid, &b->b.flags);
        lafs_dirty_dblock(b);
        clear_bit(B_PinPending, &b->b.flags);
+       lafs_cluster_allocate(&b->b, 0); /* Content will go in the next cluster - almost like
+                                         * an update */
        putdref(b, MKREF(symlink));
        i_size_write(ino, l);
        lafs_dirty_inode(ino);