/* Need to allocate an inode and space in the directory */
struct fs *fs = fs_from_inode(dir);
struct datablock *db;
- struct inode *ino = lafs_new_inode(fs, dir, TypeFile, 0, mode, &db);
+ struct inode *ino = lafs_new_inode(fs, LAFSI(dir)->filesys,
+ dir, TypeFile, 0, mode, &db);
struct dirop_handle doh;
struct update_handle uh;
int err;
if (l > fs->blocksize-1)
return -ENAMETOOLONG;
- ino = lafs_new_inode(fs, dir, TypeSymlink, 0, 0666, &inodb);
+ ino = lafs_new_inode(fs, LAFSI(dir)->filesys, dir,
+ TypeSymlink, 0, 0666, &inodb);
if (IS_ERR(ino))
return PTR_ERR(ino);
b = lafs_get_block(ino, 0, NULL, GFP_KERNEL, MKREF(symlink));
if (dir->i_nlink >= LAFS_MAX_LINKS)
return -EMLINK;
- ino = lafs_new_inode(fs, dir, TypeDir, 0, mode, &inodb);
+ ino = lafs_new_inode(fs, LAFSI(dir)->filesys, dir,
+ TypeDir, 0, mode, &inodb);
if (IS_ERR(ino))
return PTR_ERR(ino);
default:
return -EINVAL;
}
- ino = lafs_new_inode(fs, dir, type, 0, mode, &inodb);
+ ino = lafs_new_inode(fs, LAFSI(dir)->filesys, dir,
+ type, 0, mode, &inodb);
if (IS_ERR(ino))
return PTR_ERR(ino);
init_special_inode(ino, ino->i_mode, rdev);
}
struct inode *
-lafs_new_inode(struct fs *fs, struct inode *dir, int type, int inum, int mode,
- struct datablock **inodbp)
+lafs_new_inode(struct fs *fs, struct inode *filesys, struct inode *dir,
+ int type, int inum, int mode, struct datablock **inodbp)
{
/* allocate and instantiate a new inode. If inum is non-zero,
* choose any number, otherwise we are creating a special inode
* successfully created
*
*/
- struct inode *filesys = LAFSI(dir)->filesys;
struct inode *ino;
struct datablock *b;
struct inode_map_new_info imni;
lafs_iounlock_block(&b->b);
inode_map_new_commit(&imni);
- ino = lafs_iget(dir->i_sb, b->b.fileaddr, SYNC);
+ ino = lafs_iget(filesys->i_sb, b->b.fileaddr, SYNC);
if (IS_ERR(ino)) {
lafs_cluster_update_abort(&ui);
LAFS_BUG(1, &b->b);
void lafs_delete_inode(struct inode *ino);
void lafs_dirty_inode(struct inode *ino);
int lafs_sync_inode(struct inode *ino, int wait);
-struct inode *lafs_new_inode(struct fs *fs, struct inode *dir, int type,
+struct inode *lafs_new_inode(struct fs *fs, struct inode *filesys,
+ struct inode *dir, int type,
int inum, int mode, struct datablock **inodbp);
int lafs_lock_inode(struct inode *ino);
void lafs_inode_fillblock(struct inode *ino);