From: NeilBrown Date: Mon, 13 Sep 2010 07:33:54 +0000 (+1000) Subject: Log symlink creation X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=3cdb8dde718a6da64ba11d02774a934de40728fe;p=LaFS.git Log symlink creation 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 --- diff --git a/dir.c b/dir.c index 50a7374..e1555f6 100644 --- 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);