/* FIXME always use this branch?
* FIXME is this OK for all sub-filesystems?
*/
- struct fs *fs = sb->s_fs_info;
- inodefile = fs->ss[0].root;
+ inodefile = fs_from_sb(sb)->ss[0].root;
}
if (async) {
unlock_new_inode(ino);
out:
if (b && test_and_clear_bit(B_Async, &b->b.flags)) {
- struct fs *fs = sb->s_fs_info;
putdref(b, MKREF(async));
- lafs_wake_cleaner(fs);
+ lafs_wake_cleaner(fs_from_sb(sb));
}
putdref(b, MKREF(iget));
return ino;
return t | tn;
}
-static inline struct fs *fs_from_inode(struct inode *ino)
+static inline struct fs *fs_from_sb(struct super_block *sb)
{
- struct fs *fs = ino->i_sb->s_fs_info;
+ struct fs *fs = sb->s_fs_info;
return fs;
}
+static inline struct fs *fs_from_inode(struct inode *ino)
+{
+ return fs_from_sb(ino->i_sb);
+}
+
static inline int set_phase(struct block *b, int ph)
{
if (b->inode->i_ino == 0 && b->fileaddr == 0)
err = -EINVAL;
if (sb->s_type != &lafs_fs_type)
goto fail;
- fs = sb->s_fs_info;
+ fs = fs_from_sb(sb);
for (s = 1; s < fs->maxsnapshot; s++) {
struct datablock *b;
static void lafs_snap_kill_sb(struct super_block *sb)
{
- struct fs *fs = sb->s_fs_info;
+ struct fs *fs = fs_from_sb(sb);
printk("Generic_shutdown_super being called....\n");
generic_shutdown_super(sb);
static void lafs_kill_sb(struct super_block *sb)
{
- struct fs *fs = sb->s_fs_info;
+ struct fs *fs = fs_from_sb(sb);
/* Release the 'struct fs' */
int i;
static void
lafs_put_super(struct super_block *sb)
{
- struct fs *fs = sb->s_fs_info;
+ struct fs *fs = fs_from_sb(sb);
int ss;
struct lafs_inode *li;
}
/* So they seem to be the same - better create our
- * s_fs_info structure and fill it in
+ * 'fs' structure and fill it in
*/
err = lafs_load(fs, &op, newest);
if (err)
static int lafs_sync_fs(struct super_block *sb, int wait)
{
- struct fs *fs = sb->s_fs_info;
if (!wait)
/* We only reach here if s_dirt was set, so it
* is reasonable to force a checkpoint.
*/
- lafs_checkpoint_start(fs);
+ lafs_checkpoint_start(fs_from_sb(sb));
else
printk("FIXME I should wait for the checkpoint to finish\n");
return 0;