static void check_atime_ref(struct inode *ino, int async)
{
- /* If there is an time file in this filesystem the inode
+ /* If there is an atime file in this filesystem the inode
* should hold a reference to the relevant block in
* that file.
*/
LAFSI(ino)->md.file.atime_offset = 0;
/* "* 2" to get byte number, then shift to get block
- * number
+ * number. So just shift by 1 less than blkbits.
*/
bnum = ino->i_ino >> (at->i_blkbits-1);
b = lafs_get_block(at, bnum, NULL, GFP_NOFS, MKREF(atime));
i = (ino->i_ino * 2) & ((1<<at->i_blkbits)-1);
if (le16_to_cpu(atp[i]) != LAFSI(ino)->md.file.atime_offset) {
atp[i] = cpu_to_le16(LAFSI(ino)->md.file.atime_offset);
- lafs_dirty_dblock(b);
+ /* FIXME - I could lose an update here - do I care? */
+ /* Can only reserve NewSpace with checkpoint locked... */
+ lafs_checkpoint_lock(fs_from_inode(ino));
+ if (lafs_reserve_block(&b->b, NewSpace) == 0)
+ lafs_dirty_dblock(b);
+ lafs_checkpoint_unlock(fs_from_inode(ino));
}
unmap_dblock(b, atp);
putdref(b, MKREF(store_atime));
tftp 10.0.2.2 -m binary -c get /lafs.ko
insmod lafs.ko lafs_trace=1 || exit 1
#mount -r -t lafs -o 'dev=/dev/sdc' /dev/sdb /mnt/1
-mount -t lafs /dev/sdb /mnt/1
+#mount -t lafs /dev/sdb /mnt/1
#mount -r -t lafs_snap -o snapshot=first /mnt/1 /mnt/2
#mount -r -t lafs_snap -o snapshot=second /mnt/1 /mnt/3
#mount -r -t lafs -o 'snapshot=first /mnt/1 /mnt/2
a=`md5sum /mnt/1/afile`
echo $a
set $a
-if [ $1 != 'db53a848287fe6dc69da95678da94f6a' ]
+if [ "$1" != 'db53a848287fe6dc69da95678da94f6a' ]
then echo "Bad match" ; exit 1
fi
echo 'db53....4f6a'