Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

minixfs: switch to d_make_root()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro ca85c078 68acb8e6

+12 -16
+12 -16
fs/minix/inode.c
··· 254 254 minix_set_bit(0,sbi->s_imap[0]->b_data); 255 255 minix_set_bit(0,sbi->s_zmap[0]->b_data); 256 256 257 - /* set up enough so that it can read an inode */ 258 - s->s_op = &minix_sops; 259 - root_inode = minix_iget(s, MINIX_ROOT_INO); 260 - if (IS_ERR(root_inode)) { 261 - ret = PTR_ERR(root_inode); 262 - goto out_no_root; 263 - } 264 - 265 257 /* Apparently minix can create filesystems that allocate more blocks for 266 258 * the bitmaps than needed. We simply ignore that, but verify it didn't 267 259 * create one with not enough blocks and bail out if so. ··· 262 270 if (sbi->s_imap_blocks < block) { 263 271 printk("MINIX-fs: file system does not have enough " 264 272 "imap blocks allocated. Refusing to mount\n"); 265 - goto out_iput; 273 + goto out_no_bitmap; 266 274 } 267 275 268 276 block = minix_blocks_needed( ··· 271 279 if (sbi->s_zmap_blocks < block) { 272 280 printk("MINIX-fs: file system does not have enough " 273 281 "zmap blocks allocated. Refusing to mount.\n"); 274 - goto out_iput; 282 + goto out_no_bitmap; 283 + } 284 + 285 + /* set up enough so that it can read an inode */ 286 + s->s_op = &minix_sops; 287 + root_inode = minix_iget(s, MINIX_ROOT_INO); 288 + if (IS_ERR(root_inode)) { 289 + ret = PTR_ERR(root_inode); 290 + goto out_no_root; 275 291 } 276 292 277 293 ret = -ENOMEM; 278 - s->s_root = d_alloc_root(root_inode); 294 + s->s_root = d_make_root(root_inode); 279 295 if (!s->s_root) 280 - goto out_iput; 296 + goto out_no_root; 281 297 282 298 if (!(s->s_flags & MS_RDONLY)) { 283 299 if (sbi->s_version != MINIX_V3) /* s_state is now out from V3 sb */ ··· 300 300 "running fsck is recommended\n"); 301 301 302 302 return 0; 303 - 304 - out_iput: 305 - iput(root_inode); 306 - goto out_freemap; 307 303 308 304 out_no_root: 309 305 if (!silent)