Lines Matching +full:rcu +full:- +full:endian +full:- +full:offset

1 // SPDX-License-Identifier: GPL-2.0+
3 * super.c - NILFS module and super block management.
5 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
14 * Laboratoire MASI - Institut Blaise Pascal
23 * Big-endian to little-endian byte-swapping/bitmaps by
53 MODULE_DESCRIPTION("A New Implementation of the Log-structured Filesystem "
80 KERN_SOH_ASCII, level, sb->s_id, &vaf); in __nilfs_msg()
90 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_set_error()
93 down_write(&nilfs->ns_sem); in nilfs_set_error()
94 if (!(nilfs->ns_mount_state & NILFS_ERROR_FS)) { in nilfs_set_error()
95 nilfs->ns_mount_state |= NILFS_ERROR_FS; in nilfs_set_error()
98 sbp[0]->s_state |= cpu_to_le16(NILFS_ERROR_FS); in nilfs_set_error()
100 sbp[1]->s_state |= cpu_to_le16(NILFS_ERROR_FS); in nilfs_set_error()
104 up_write(&nilfs->ns_sem); in nilfs_set_error()
108 * __nilfs_error() - report failure condition on a filesystem
116 * single-shot I/O error, nilfs_err() should be used instead.
123 struct the_nilfs *nilfs = sb->s_fs_info; in __nilfs_error()
133 sb->s_id, function, &vaf); in __nilfs_error()
141 printk(KERN_CRIT "Remounting filesystem read-only\n"); in __nilfs_error()
142 sb->s_flags |= SB_RDONLY; in __nilfs_error()
148 sb->s_id); in __nilfs_error()
158 ii->i_bh = NULL; in nilfs_alloc_inode()
159 ii->i_state = 0; in nilfs_alloc_inode()
160 ii->i_cno = 0; in nilfs_alloc_inode()
161 ii->i_assoc_inode = NULL; in nilfs_alloc_inode()
162 ii->i_bmap = &ii->i_bmap_data; in nilfs_alloc_inode()
163 return &ii->vfs_inode; in nilfs_alloc_inode()
176 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_sync_super()
180 set_buffer_dirty(nilfs->ns_sbh[0]); in nilfs_sync_super()
182 err = __sync_dirty_buffer(nilfs->ns_sbh[0], in nilfs_sync_super()
185 err = sync_dirty_buffer(nilfs->ns_sbh[0]); in nilfs_sync_super()
190 if (err == -EIO && nilfs->ns_sbh[1]) { in nilfs_sync_super()
195 memcpy(nilfs->ns_sbp[1], nilfs->ns_sbp[0], in nilfs_sync_super()
196 nilfs->ns_sbsize); in nilfs_sync_super()
201 struct nilfs_super_block *sbp = nilfs->ns_sbp[0]; in nilfs_sync_super()
203 nilfs->ns_sbwcount++; in nilfs_sync_super()
212 if (nilfs->ns_sbh[1]) { in nilfs_sync_super()
214 set_buffer_dirty(nilfs->ns_sbh[1]); in nilfs_sync_super()
215 if (sync_dirty_buffer(nilfs->ns_sbh[1]) < 0) in nilfs_sync_super()
218 if (le64_to_cpu(nilfs->ns_sbp[1]->s_last_cno) < in nilfs_sync_super()
219 le64_to_cpu(nilfs->ns_sbp[0]->s_last_cno)) in nilfs_sync_super()
220 sbp = nilfs->ns_sbp[1]; in nilfs_sync_super()
223 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_sync_super()
224 nilfs->ns_prot_seq = le64_to_cpu(sbp->s_last_seq); in nilfs_sync_super()
225 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_sync_super()
236 /* nilfs->ns_sem must be locked by the caller. */ in nilfs_set_log_cursor()
238 sbp->s_free_blocks_count = cpu_to_le64(nfreeblocks); in nilfs_set_log_cursor()
240 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_set_log_cursor()
241 sbp->s_last_seq = cpu_to_le64(nilfs->ns_last_seq); in nilfs_set_log_cursor()
242 sbp->s_last_pseg = cpu_to_le64(nilfs->ns_last_pseg); in nilfs_set_log_cursor()
243 sbp->s_last_cno = cpu_to_le64(nilfs->ns_last_cno); in nilfs_set_log_cursor()
244 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_set_log_cursor()
250 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_prepare_super()
251 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_prepare_super()
253 /* nilfs->ns_sem must be locked by the caller. */ in nilfs_prepare_super()
254 if (sbp[0]->s_magic != cpu_to_le16(NILFS_SUPER_MAGIC)) { in nilfs_prepare_super()
256 sbp[1]->s_magic == cpu_to_le16(NILFS_SUPER_MAGIC)) { in nilfs_prepare_super()
257 memcpy(sbp[0], sbp[1], nilfs->ns_sbsize); in nilfs_prepare_super()
263 sbp[1]->s_magic != cpu_to_le16(NILFS_SUPER_MAGIC)) { in nilfs_prepare_super()
264 memcpy(sbp[1], sbp[0], nilfs->ns_sbsize); in nilfs_prepare_super()
275 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_commit_super()
276 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_commit_super()
279 /* nilfs->ns_sem must be locked by the caller. */ in nilfs_commit_super()
281 nilfs->ns_sbwtime = t; in nilfs_commit_super()
282 sbp[0]->s_wtime = cpu_to_le64(t); in nilfs_commit_super()
283 sbp[0]->s_sum = 0; in nilfs_commit_super()
284 sbp[0]->s_sum = cpu_to_le32(crc32_le(nilfs->ns_crc_seed, in nilfs_commit_super()
286 nilfs->ns_sbsize)); in nilfs_commit_super()
288 sbp[1]->s_wtime = sbp[0]->s_wtime; in nilfs_commit_super()
289 sbp[1]->s_sum = 0; in nilfs_commit_super()
290 sbp[1]->s_sum = cpu_to_le32(crc32_le(nilfs->ns_crc_seed, in nilfs_commit_super()
292 nilfs->ns_sbsize)); in nilfs_commit_super()
295 nilfs->ns_flushed_device = 1; in nilfs_commit_super()
302 * nilfs_cleanup_super() - write filesystem state for cleanup
303 * @sb: super block instance to be unmounted or degraded to read-only
305 * This function restores state flags in the on-disk super block.
311 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_cleanup_super()
314 int ret = -EIO; in nilfs_cleanup_super()
318 sbp[0]->s_state = cpu_to_le16(nilfs->ns_mount_state); in nilfs_cleanup_super()
320 if (sbp[1] && sbp[0]->s_last_cno == sbp[1]->s_last_cno) { in nilfs_cleanup_super()
326 sbp[1]->s_state = sbp[0]->s_state; in nilfs_cleanup_super()
335 * nilfs_move_2nd_super - relocate secondary super block
337 * @sb2off: new offset of the secondary super block (in bytes)
341 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_move_2nd_super()
345 unsigned long offset; in nilfs_move_2nd_super() local
349 /* nilfs->ns_sem must be locked by the caller. */ in nilfs_move_2nd_super()
350 if (nilfs->ns_sbh[1] && in nilfs_move_2nd_super()
351 nilfs->ns_sbh[1]->b_blocknr > nilfs->ns_first_data_block) { in nilfs_move_2nd_super()
353 blocknr = nilfs->ns_sbh[1]->b_blocknr; in nilfs_move_2nd_super()
354 } else if (nilfs->ns_sbh[0]->b_blocknr > nilfs->ns_first_data_block) { in nilfs_move_2nd_super()
356 blocknr = nilfs->ns_sbh[0]->b_blocknr; in nilfs_move_2nd_super()
358 sb2i = -1; in nilfs_move_2nd_super()
361 if (sb2i >= 0 && (u64)blocknr << nilfs->ns_blocksize_bits == sb2off) in nilfs_move_2nd_super()
365 newblocknr = sb2off >> nilfs->ns_blocksize_bits; in nilfs_move_2nd_super()
366 offset = sb2off & (nilfs->ns_blocksize - 1); in nilfs_move_2nd_super()
372 ret = -EIO; in nilfs_move_2nd_super()
375 nsbp = (void *)nsbh->b_data + offset; in nilfs_move_2nd_super()
376 memset(nsbp, 0, nilfs->ns_blocksize); in nilfs_move_2nd_super()
379 memcpy(nsbp, nilfs->ns_sbp[sb2i], nilfs->ns_sbsize); in nilfs_move_2nd_super()
380 brelse(nilfs->ns_sbh[sb2i]); in nilfs_move_2nd_super()
381 nilfs->ns_sbh[sb2i] = nsbh; in nilfs_move_2nd_super()
382 nilfs->ns_sbp[sb2i] = nsbp; in nilfs_move_2nd_super()
383 } else if (nilfs->ns_sbh[0]->b_blocknr < nilfs->ns_first_data_block) { in nilfs_move_2nd_super()
385 nilfs->ns_sbh[1] = nsbh; in nilfs_move_2nd_super()
386 nilfs->ns_sbp[1] = nsbp; in nilfs_move_2nd_super()
395 * nilfs_resize_fs - resize the filesystem
401 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_resize_fs()
407 ret = -ERANGE; in nilfs_resize_fs()
408 devsize = i_size_read(sb->s_bdev->bd_inode); in nilfs_resize_fs()
417 down_write(&nilfs->ns_segctor_sem); in nilfs_resize_fs()
420 newnsegs = sb2off >> nilfs->ns_blocksize_bits; in nilfs_resize_fs()
421 do_div(newnsegs, nilfs->ns_blocks_per_segment); in nilfs_resize_fs()
423 ret = nilfs_sufile_resize(nilfs->ns_sufile, newnsegs); in nilfs_resize_fs()
424 up_write(&nilfs->ns_segctor_sem); in nilfs_resize_fs()
432 down_write(&nilfs->ns_sem); in nilfs_resize_fs()
434 ret = -EIO; in nilfs_resize_fs()
440 * mount-time resize which may be implemented in a in nilfs_resize_fs()
443 sbp[0]->s_state = cpu_to_le16(le16_to_cpu(sbp[0]->s_state) & in nilfs_resize_fs()
445 sbp[0]->s_dev_size = cpu_to_le64(newsize); in nilfs_resize_fs()
446 sbp[0]->s_nsegments = cpu_to_le64(nilfs->ns_nsegments); in nilfs_resize_fs()
448 memcpy(sbp[1], sbp[0], nilfs->ns_sbsize); in nilfs_resize_fs()
451 up_write(&nilfs->ns_sem); in nilfs_resize_fs()
460 nilfs_sufile_set_alloc_range(nilfs->ns_sufile, 0, newnsegs - 1); in nilfs_resize_fs()
467 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_put_super()
472 down_write(&nilfs->ns_sem); in nilfs_put_super()
474 up_write(&nilfs->ns_sem); in nilfs_put_super()
477 iput(nilfs->ns_sufile); in nilfs_put_super()
478 iput(nilfs->ns_cpfile); in nilfs_put_super()
479 iput(nilfs->ns_dat); in nilfs_put_super()
482 sb->s_fs_info = NULL; in nilfs_put_super()
487 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_sync_fs()
495 down_write(&nilfs->ns_sem); in nilfs_sync_fs()
503 up_write(&nilfs->ns_sem); in nilfs_sync_fs()
514 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_attach_checkpoint()
518 int err = -ENOMEM; in nilfs_attach_checkpoint()
525 if (root->ifile) in nilfs_attach_checkpoint()
528 down_read(&nilfs->ns_segctor_sem); in nilfs_attach_checkpoint()
529 err = nilfs_cpfile_get_checkpoint(nilfs->ns_cpfile, cno, 0, &raw_cp, in nilfs_attach_checkpoint()
531 up_read(&nilfs->ns_segctor_sem); in nilfs_attach_checkpoint()
533 if (err == -ENOENT || err == -EINVAL) { in nilfs_attach_checkpoint()
537 err = -EINVAL; in nilfs_attach_checkpoint()
542 err = nilfs_ifile_read(sb, root, nilfs->ns_inode_size, in nilfs_attach_checkpoint()
543 &raw_cp->cp_ifile_inode, &root->ifile); in nilfs_attach_checkpoint()
547 atomic64_set(&root->inodes_count, in nilfs_attach_checkpoint()
548 le64_to_cpu(raw_cp->cp_inodes_count)); in nilfs_attach_checkpoint()
549 atomic64_set(&root->blocks_count, in nilfs_attach_checkpoint()
550 le64_to_cpu(raw_cp->cp_blocks_count)); in nilfs_attach_checkpoint()
552 nilfs_cpfile_put_checkpoint(nilfs->ns_cpfile, cno, bh_cp); in nilfs_attach_checkpoint()
559 nilfs_cpfile_put_checkpoint(nilfs->ns_cpfile, cno, bh_cp); in nilfs_attach_checkpoint()
568 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_freeze()
575 down_write(&nilfs->ns_sem); in nilfs_freeze()
577 up_write(&nilfs->ns_sem); in nilfs_freeze()
583 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_unfreeze()
588 down_write(&nilfs->ns_sem); in nilfs_unfreeze()
590 up_write(&nilfs->ns_sem); in nilfs_unfreeze()
596 struct super_block *sb = dentry->d_sb; in nilfs_statfs()
597 struct nilfs_root *root = NILFS_I(d_inode(dentry))->i_root; in nilfs_statfs()
598 struct the_nilfs *nilfs = root->nilfs; in nilfs_statfs()
599 u64 id = huge_encode_dev(sb->s_bdev->bd_dev); in nilfs_statfs()
613 blocks = nilfs->ns_blocks_per_segment * nilfs->ns_nsegments in nilfs_statfs()
614 - nilfs->ns_first_data_block; in nilfs_statfs()
615 nrsvblocks = nilfs->ns_nrsvsegs * nilfs->ns_blocks_per_segment; in nilfs_statfs()
629 err = nilfs_ifile_count_free_inodes(root->ifile, in nilfs_statfs()
633 if (err == -ERANGE) { in nilfs_statfs()
636 * -ERANGE error code then we simply treat in nilfs_statfs()
640 nmaxinodes = atomic64_read(&root->inodes_count); in nilfs_statfs()
647 buf->f_type = NILFS_SUPER_MAGIC; in nilfs_statfs()
648 buf->f_bsize = sb->s_blocksize; in nilfs_statfs()
649 buf->f_blocks = blocks - overhead; in nilfs_statfs()
650 buf->f_bfree = nfreeblocks; in nilfs_statfs()
651 buf->f_bavail = (buf->f_bfree >= nrsvblocks) ? in nilfs_statfs()
652 (buf->f_bfree - nrsvblocks) : 0; in nilfs_statfs()
653 buf->f_files = nmaxinodes; in nilfs_statfs()
654 buf->f_ffree = nfreeinodes; in nilfs_statfs()
655 buf->f_namelen = NILFS_NAME_LEN; in nilfs_statfs()
656 buf->f_fsid = u64_to_fsid(id); in nilfs_statfs()
663 struct super_block *sb = dentry->d_sb; in nilfs_show_options()
664 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_show_options()
665 struct nilfs_root *root = NILFS_I(d_inode(dentry))->i_root; in nilfs_show_options()
669 if (root->cno != NILFS_CPTREE_CURRENT_CNO) in nilfs_show_options()
670 seq_printf(seq, ",cp=%llu", (unsigned long long)root->cno); in nilfs_show_options()
708 {Opt_err_ro, "errors=remount-ro"},
721 struct the_nilfs *nilfs = sb->s_fs_info; in parse_options()
747 /* Strict in-order semantics */ in parse_options()
790 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_set_default_options()
792 nilfs->ns_mount_opt = in nilfs_set_default_options()
798 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_setup_super()
803 /* nilfs->ns_sem must be locked by the caller. */ in nilfs_setup_super()
806 return -EIO; in nilfs_setup_super()
811 max_mnt_count = le16_to_cpu(sbp[0]->s_max_mnt_count); in nilfs_setup_super()
812 mnt_count = le16_to_cpu(sbp[0]->s_mnt_count); in nilfs_setup_super()
814 if (nilfs->ns_mount_state & NILFS_ERROR_FS) { in nilfs_setup_super()
822 sbp[0]->s_max_mnt_count = cpu_to_le16(NILFS_DFL_MAX_MNT_COUNT); in nilfs_setup_super()
824 sbp[0]->s_mnt_count = cpu_to_le16(mnt_count + 1); in nilfs_setup_super()
825 sbp[0]->s_mtime = cpu_to_le64(ktime_get_real_seconds()); in nilfs_setup_super()
828 sbp[0]->s_state = in nilfs_setup_super()
829 cpu_to_le16(le16_to_cpu(sbp[0]->s_state) & ~NILFS_VALID_FS); in nilfs_setup_super()
832 memcpy(sbp[1], sbp[0], nilfs->ns_sbsize); in nilfs_setup_super()
841 unsigned long offset; in nilfs_read_super_block() local
843 offset = do_div(sb_index, blocksize); in nilfs_read_super_block()
847 return (struct nilfs_super_block *)((char *)(*pbh)->b_data + offset); in nilfs_read_super_block()
854 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_store_magic_and_option()
856 sb->s_magic = le16_to_cpu(sbp->s_magic); in nilfs_store_magic_and_option()
860 sb->s_flags |= SB_NOATIME; in nilfs_store_magic_and_option()
865 nilfs->ns_resuid = le16_to_cpu(sbp->s_def_resuid); in nilfs_store_magic_and_option()
866 nilfs->ns_resgid = le16_to_cpu(sbp->s_def_resgid); in nilfs_store_magic_and_option()
867 nilfs->ns_interval = le32_to_cpu(sbp->s_c_interval); in nilfs_store_magic_and_option()
868 nilfs->ns_watermark = le32_to_cpu(sbp->s_c_block_max); in nilfs_store_magic_and_option()
870 return !parse_options(data, sb, 0) ? -EINVAL : 0; in nilfs_store_magic_and_option()
878 features = le64_to_cpu(sbp->s_feature_incompat) & in nilfs_check_feature_compatibility()
884 return -EINVAL; in nilfs_check_feature_compatibility()
886 features = le64_to_cpu(sbp->s_feature_compat_ro) & in nilfs_check_feature_compatibility()
892 return -EINVAL; in nilfs_check_feature_compatibility()
911 if (!S_ISDIR(inode->i_mode) || !inode->i_blocks || !inode->i_size) { in nilfs_get_root_dentry()
914 ret = -EINVAL; in nilfs_get_root_dentry()
918 if (root->cno == NILFS_CPTREE_CURRENT_CNO) { in nilfs_get_root_dentry()
923 ret = -ENOMEM; in nilfs_get_root_dentry()
948 struct the_nilfs *nilfs = s->s_fs_info; in nilfs_attach_snapshot()
952 mutex_lock(&nilfs->ns_snapshot_mount_mutex); in nilfs_attach_snapshot()
954 down_read(&nilfs->ns_segctor_sem); in nilfs_attach_snapshot()
955 ret = nilfs_cpfile_is_snapshot(nilfs->ns_cpfile, cno); in nilfs_attach_snapshot()
956 up_read(&nilfs->ns_segctor_sem); in nilfs_attach_snapshot()
958 ret = (ret == -ENOENT) ? -EINVAL : ret; in nilfs_attach_snapshot()
964 ret = -EINVAL; in nilfs_attach_snapshot()
978 mutex_unlock(&nilfs->ns_snapshot_mount_mutex); in nilfs_attach_snapshot()
983 * nilfs_tree_is_busy() - try to shrink dentries of a checkpoint
986 * This function returns true if the tree was in-use.
996 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_checkpoint_is_mounted()
1002 if (cno > nilfs->ns_cno) in nilfs_checkpoint_is_mounted()
1026 * nilfs_fill_super() - initialize a super block instance
1031 * This function is called exclusively by nilfs->ns_mount_mutex.
1044 return -ENOMEM; in nilfs_fill_super()
1046 sb->s_fs_info = nilfs; in nilfs_fill_super()
1052 sb->s_op = &nilfs_sops; in nilfs_fill_super()
1053 sb->s_export_op = &nilfs_export_ops; in nilfs_fill_super()
1054 sb->s_root = NULL; in nilfs_fill_super()
1055 sb->s_time_gran = 1; in nilfs_fill_super()
1056 sb->s_max_links = NILFS_LINK_MAX; in nilfs_fill_super()
1058 sb->s_bdi = bdi_get(sb->s_bdev->bd_bdi); in nilfs_fill_super()
1079 err = nilfs_get_root_dentry(sb, fsroot, &sb->s_root); in nilfs_fill_super()
1086 down_write(&nilfs->ns_sem); in nilfs_fill_super()
1088 up_write(&nilfs->ns_sem); in nilfs_fill_super()
1100 iput(nilfs->ns_sufile); in nilfs_fill_super()
1101 iput(nilfs->ns_cpfile); in nilfs_fill_super()
1102 iput(nilfs->ns_dat); in nilfs_fill_super()
1111 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_remount()
1117 old_sb_flags = sb->s_flags; in nilfs_remount()
1118 old_mount_opt = nilfs->ns_mount_opt; in nilfs_remount()
1121 err = -EINVAL; in nilfs_remount()
1124 sb->s_flags = (sb->s_flags & ~SB_POSIXACL); in nilfs_remount()
1126 err = -EINVAL; in nilfs_remount()
1137 sb->s_flags |= SB_RDONLY; in nilfs_remount()
1143 down_write(&nilfs->ns_sem); in nilfs_remount()
1145 up_write(&nilfs->ns_sem); in nilfs_remount()
1151 * Mounting a RDONLY partition read-write, so reread and in nilfs_remount()
1155 down_read(&nilfs->ns_sem); in nilfs_remount()
1156 features = le64_to_cpu(nilfs->ns_sbp[0]->s_feature_compat_ro) & in nilfs_remount()
1158 up_read(&nilfs->ns_sem); in nilfs_remount()
1163 err = -EROFS; in nilfs_remount()
1167 sb->s_flags &= ~SB_RDONLY; in nilfs_remount()
1169 root = NILFS_I(d_inode(sb->s_root))->i_root; in nilfs_remount()
1174 down_write(&nilfs->ns_sem); in nilfs_remount()
1176 up_write(&nilfs->ns_sem); in nilfs_remount()
1182 sb->s_flags = old_sb_flags; in nilfs_remount()
1183 nilfs->ns_mount_opt = old_mount_opt; in nilfs_remount()
1201 if (!(sd->flags & SB_RDONLY)) { in nilfs_parse_snapshot_option()
1202 msg = "read-only option is not specified"; in nilfs_parse_snapshot_option()
1206 err = kstrtoull(arg->from, 0, &val); in nilfs_parse_snapshot_option()
1208 if (err == -ERANGE) in nilfs_parse_snapshot_option()
1217 sd->cno = val; in nilfs_parse_snapshot_option()
1226 * nilfs_identify - pre-read mount options needed to identify mount instance
1248 *(options - 1) = ','; in nilfs_identify()
1255 s->s_bdev = data; in nilfs_set_bdev_super()
1256 s->s_dev = s->s_bdev->bd_dev; in nilfs_set_bdev_super()
1262 return (void *)s->s_bdev == data; in nilfs_test_bdev_super()
1285 err = -EINVAL; in nilfs_mount()
1294 mutex_lock(&sd.bdev->bd_fsfreeze_mutex); in nilfs_mount()
1295 if (sd.bdev->bd_fsfreeze_count > 0) { in nilfs_mount()
1296 mutex_unlock(&sd.bdev->bd_fsfreeze_mutex); in nilfs_mount()
1297 err = -EBUSY; in nilfs_mount()
1302 mutex_unlock(&sd.bdev->bd_fsfreeze_mutex); in nilfs_mount()
1308 if (!s->s_root) { in nilfs_mount()
1312 s->s_mode = mode; in nilfs_mount()
1313 snprintf(s->s_id, sizeof(s->s_id), "%pg", sd.bdev); in nilfs_mount()
1320 s->s_flags |= SB_ACTIVE; in nilfs_mount()
1322 if (nilfs_tree_is_busy(s->s_root)) { in nilfs_mount()
1323 if ((flags ^ s->s_flags) & SB_RDONLY) { in nilfs_mount()
1326 sb_rdonly(s) ? "read-only" : "read/write"); in nilfs_mount()
1327 err = -EBUSY; in nilfs_mount()
1346 root_dentry = dget(s->s_root); in nilfs_mount()
1376 INIT_LIST_HEAD(&ii->i_dirty); in nilfs_inode_init_once()
1378 init_rwsem(&ii->xattr_sem); in nilfs_inode_init_once()
1380 inode_init_once(&ii->vfs_inode); in nilfs_inode_init_once()
1391 * Make sure all delayed rcu free inodes are flushed before we in nilfs_destroy_cachep()
1433 return -ENOMEM; in nilfs_init_cachep()