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

1 // SPDX-License-Identifier: GPL-2.0+
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
54 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()
385 memcpy(nsbp, nilfs->ns_sbp[sb2i], nilfs->ns_sbsize); in nilfs_move_2nd_super()
391 memset(nsbh->b_data, 0, offset); in nilfs_move_2nd_super()
392 memset((void *)nsbp + nilfs->ns_sbsize, 0, in nilfs_move_2nd_super()
393 nsbh->b_size - offset - nilfs->ns_sbsize); in nilfs_move_2nd_super()
395 memset(nsbh->b_data, 0, nsbh->b_size); in nilfs_move_2nd_super()
401 brelse(nilfs->ns_sbh[sb2i]); in nilfs_move_2nd_super()
402 nilfs->ns_sbh[sb2i] = nsbh; in nilfs_move_2nd_super()
403 nilfs->ns_sbp[sb2i] = nsbp; in nilfs_move_2nd_super()
404 } else if (nilfs->ns_sbh[0]->b_blocknr < nilfs->ns_first_data_block) { in nilfs_move_2nd_super()
406 nilfs->ns_sbh[1] = nsbh; in nilfs_move_2nd_super()
407 nilfs->ns_sbp[1] = nsbp; in nilfs_move_2nd_super()
416 * nilfs_resize_fs - resize the filesystem
422 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_resize_fs()
428 ret = -ERANGE; in nilfs_resize_fs()
429 devsize = bdev_nr_bytes(sb->s_bdev); in nilfs_resize_fs()
438 ret = -ENOSPC; in nilfs_resize_fs()
447 down_write(&nilfs->ns_segctor_sem); in nilfs_resize_fs()
450 newnsegs = sb2off >> nilfs->ns_blocksize_bits; in nilfs_resize_fs()
451 do_div(newnsegs, nilfs->ns_blocks_per_segment); in nilfs_resize_fs()
453 ret = nilfs_sufile_resize(nilfs->ns_sufile, newnsegs); in nilfs_resize_fs()
454 up_write(&nilfs->ns_segctor_sem); in nilfs_resize_fs()
462 down_write(&nilfs->ns_sem); in nilfs_resize_fs()
464 ret = -EIO; in nilfs_resize_fs()
470 * mount-time resize which may be implemented in a in nilfs_resize_fs()
473 sbp[0]->s_state = cpu_to_le16(le16_to_cpu(sbp[0]->s_state) & in nilfs_resize_fs()
475 sbp[0]->s_dev_size = cpu_to_le64(newsize); in nilfs_resize_fs()
476 sbp[0]->s_nsegments = cpu_to_le64(nilfs->ns_nsegments); in nilfs_resize_fs()
478 memcpy(sbp[1], sbp[0], nilfs->ns_sbsize); in nilfs_resize_fs()
481 up_write(&nilfs->ns_sem); in nilfs_resize_fs()
490 nilfs_sufile_set_alloc_range(nilfs->ns_sufile, 0, newnsegs - 1); in nilfs_resize_fs()
497 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_put_super()
502 down_write(&nilfs->ns_sem); in nilfs_put_super()
504 up_write(&nilfs->ns_sem); in nilfs_put_super()
508 iput(nilfs->ns_sufile); in nilfs_put_super()
509 iput(nilfs->ns_cpfile); in nilfs_put_super()
510 iput(nilfs->ns_dat); in nilfs_put_super()
513 sb->s_fs_info = NULL; in nilfs_put_super()
518 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_sync_fs()
526 down_write(&nilfs->ns_sem); in nilfs_sync_fs()
534 up_write(&nilfs->ns_sem); in nilfs_sync_fs()
545 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_attach_checkpoint()
549 int err = -ENOMEM; in nilfs_attach_checkpoint()
556 if (root->ifile) in nilfs_attach_checkpoint()
559 down_read(&nilfs->ns_segctor_sem); in nilfs_attach_checkpoint()
560 err = nilfs_cpfile_get_checkpoint(nilfs->ns_cpfile, cno, 0, &raw_cp, in nilfs_attach_checkpoint()
562 up_read(&nilfs->ns_segctor_sem); in nilfs_attach_checkpoint()
564 if (err == -ENOENT || err == -EINVAL) { in nilfs_attach_checkpoint()
568 err = -EINVAL; in nilfs_attach_checkpoint()
573 err = nilfs_ifile_read(sb, root, nilfs->ns_inode_size, in nilfs_attach_checkpoint()
574 &raw_cp->cp_ifile_inode, &root->ifile); in nilfs_attach_checkpoint()
578 atomic64_set(&root->inodes_count, in nilfs_attach_checkpoint()
579 le64_to_cpu(raw_cp->cp_inodes_count)); in nilfs_attach_checkpoint()
580 atomic64_set(&root->blocks_count, in nilfs_attach_checkpoint()
581 le64_to_cpu(raw_cp->cp_blocks_count)); in nilfs_attach_checkpoint()
583 nilfs_cpfile_put_checkpoint(nilfs->ns_cpfile, cno, bh_cp); in nilfs_attach_checkpoint()
590 nilfs_cpfile_put_checkpoint(nilfs->ns_cpfile, cno, bh_cp); in nilfs_attach_checkpoint()
599 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_freeze()
606 down_write(&nilfs->ns_sem); in nilfs_freeze()
608 up_write(&nilfs->ns_sem); in nilfs_freeze()
614 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_unfreeze()
619 down_write(&nilfs->ns_sem); in nilfs_unfreeze()
621 up_write(&nilfs->ns_sem); in nilfs_unfreeze()
627 struct super_block *sb = dentry->d_sb; in nilfs_statfs()
628 struct nilfs_root *root = NILFS_I(d_inode(dentry))->i_root; in nilfs_statfs()
629 struct the_nilfs *nilfs = root->nilfs; in nilfs_statfs()
630 u64 id = huge_encode_dev(sb->s_bdev->bd_dev); in nilfs_statfs()
644 blocks = nilfs->ns_blocks_per_segment * nilfs->ns_nsegments in nilfs_statfs()
645 - nilfs->ns_first_data_block; in nilfs_statfs()
646 nrsvblocks = nilfs->ns_nrsvsegs * nilfs->ns_blocks_per_segment; in nilfs_statfs()
660 err = nilfs_ifile_count_free_inodes(root->ifile, in nilfs_statfs()
664 if (err == -ERANGE) { in nilfs_statfs()
667 * -ERANGE error code then we simply treat in nilfs_statfs()
671 nmaxinodes = atomic64_read(&root->inodes_count); in nilfs_statfs()
678 buf->f_type = NILFS_SUPER_MAGIC; in nilfs_statfs()
679 buf->f_bsize = sb->s_blocksize; in nilfs_statfs()
680 buf->f_blocks = blocks - overhead; in nilfs_statfs()
681 buf->f_bfree = nfreeblocks; in nilfs_statfs()
682 buf->f_bavail = (buf->f_bfree >= nrsvblocks) ? in nilfs_statfs()
683 (buf->f_bfree - nrsvblocks) : 0; in nilfs_statfs()
684 buf->f_files = nmaxinodes; in nilfs_statfs()
685 buf->f_ffree = nfreeinodes; in nilfs_statfs()
686 buf->f_namelen = NILFS_NAME_LEN; in nilfs_statfs()
687 buf->f_fsid = u64_to_fsid(id); in nilfs_statfs()
694 struct super_block *sb = dentry->d_sb; in nilfs_show_options()
695 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_show_options()
696 struct nilfs_root *root = NILFS_I(d_inode(dentry))->i_root; in nilfs_show_options()
700 if (root->cno != NILFS_CPTREE_CURRENT_CNO) in nilfs_show_options()
701 seq_printf(seq, ",cp=%llu", (unsigned long long)root->cno); in nilfs_show_options()
739 {Opt_err_ro, "errors=remount-ro"},
752 struct the_nilfs *nilfs = sb->s_fs_info; in parse_options()
778 /* Strict in-order semantics */ in parse_options()
821 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_set_default_options()
823 nilfs->ns_mount_opt = in nilfs_set_default_options()
829 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_setup_super()
834 /* nilfs->ns_sem must be locked by the caller. */ in nilfs_setup_super()
837 return -EIO; in nilfs_setup_super()
842 max_mnt_count = le16_to_cpu(sbp[0]->s_max_mnt_count); in nilfs_setup_super()
843 mnt_count = le16_to_cpu(sbp[0]->s_mnt_count); in nilfs_setup_super()
845 if (nilfs->ns_mount_state & NILFS_ERROR_FS) { in nilfs_setup_super()
853 sbp[0]->s_max_mnt_count = cpu_to_le16(NILFS_DFL_MAX_MNT_COUNT); in nilfs_setup_super()
855 sbp[0]->s_mnt_count = cpu_to_le16(mnt_count + 1); in nilfs_setup_super()
856 sbp[0]->s_mtime = cpu_to_le64(ktime_get_real_seconds()); in nilfs_setup_super()
859 sbp[0]->s_state = in nilfs_setup_super()
860 cpu_to_le16(le16_to_cpu(sbp[0]->s_state) & ~NILFS_VALID_FS); in nilfs_setup_super()
863 memcpy(sbp[1], sbp[0], nilfs->ns_sbsize); in nilfs_setup_super()
872 unsigned long offset; in nilfs_read_super_block() local
874 offset = do_div(sb_index, blocksize); in nilfs_read_super_block()
878 return (struct nilfs_super_block *)((char *)(*pbh)->b_data + offset); in nilfs_read_super_block()
885 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_store_magic_and_option()
887 sb->s_magic = le16_to_cpu(sbp->s_magic); in nilfs_store_magic_and_option()
891 sb->s_flags |= SB_NOATIME; in nilfs_store_magic_and_option()
896 nilfs->ns_resuid = le16_to_cpu(sbp->s_def_resuid); in nilfs_store_magic_and_option()
897 nilfs->ns_resgid = le16_to_cpu(sbp->s_def_resgid); in nilfs_store_magic_and_option()
898 nilfs->ns_interval = le32_to_cpu(sbp->s_c_interval); in nilfs_store_magic_and_option()
899 nilfs->ns_watermark = le32_to_cpu(sbp->s_c_block_max); in nilfs_store_magic_and_option()
901 return !parse_options(data, sb, 0) ? -EINVAL : 0; in nilfs_store_magic_and_option()
909 features = le64_to_cpu(sbp->s_feature_incompat) & in nilfs_check_feature_compatibility()
915 return -EINVAL; in nilfs_check_feature_compatibility()
917 features = le64_to_cpu(sbp->s_feature_compat_ro) & in nilfs_check_feature_compatibility()
923 return -EINVAL; in nilfs_check_feature_compatibility()
942 if (!S_ISDIR(inode->i_mode) || !inode->i_blocks || !inode->i_size) { in nilfs_get_root_dentry()
945 ret = -EINVAL; in nilfs_get_root_dentry()
949 if (root->cno == NILFS_CPTREE_CURRENT_CNO) { in nilfs_get_root_dentry()
954 ret = -ENOMEM; in nilfs_get_root_dentry()
979 struct the_nilfs *nilfs = s->s_fs_info; in nilfs_attach_snapshot()
983 mutex_lock(&nilfs->ns_snapshot_mount_mutex); in nilfs_attach_snapshot()
985 down_read(&nilfs->ns_segctor_sem); in nilfs_attach_snapshot()
986 ret = nilfs_cpfile_is_snapshot(nilfs->ns_cpfile, cno); in nilfs_attach_snapshot()
987 up_read(&nilfs->ns_segctor_sem); in nilfs_attach_snapshot()
989 ret = (ret == -ENOENT) ? -EINVAL : ret; in nilfs_attach_snapshot()
995 ret = -EINVAL; in nilfs_attach_snapshot()
1009 mutex_unlock(&nilfs->ns_snapshot_mount_mutex); in nilfs_attach_snapshot()
1014 * nilfs_tree_is_busy() - try to shrink dentries of a checkpoint
1017 * This function returns true if the tree was in-use.
1027 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_checkpoint_is_mounted()
1033 if (cno > nilfs->ns_cno) in nilfs_checkpoint_is_mounted()
1057 * nilfs_fill_super() - initialize a super block instance
1062 * This function is called exclusively by nilfs->ns_mount_mutex.
1075 return -ENOMEM; in nilfs_fill_super()
1077 sb->s_fs_info = nilfs; in nilfs_fill_super()
1083 sb->s_op = &nilfs_sops; in nilfs_fill_super()
1084 sb->s_export_op = &nilfs_export_ops; in nilfs_fill_super()
1085 sb->s_root = NULL; in nilfs_fill_super()
1086 sb->s_time_gran = 1; in nilfs_fill_super()
1087 sb->s_max_links = NILFS_LINK_MAX; in nilfs_fill_super()
1089 sb->s_bdi = bdi_get(sb->s_bdev->bd_disk->bdi); in nilfs_fill_super()
1110 err = nilfs_get_root_dentry(sb, fsroot, &sb->s_root); in nilfs_fill_super()
1117 down_write(&nilfs->ns_sem); in nilfs_fill_super()
1119 up_write(&nilfs->ns_sem); in nilfs_fill_super()
1132 iput(nilfs->ns_sufile); in nilfs_fill_super()
1133 iput(nilfs->ns_cpfile); in nilfs_fill_super()
1134 iput(nilfs->ns_dat); in nilfs_fill_super()
1143 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_remount()
1149 old_sb_flags = sb->s_flags; in nilfs_remount()
1150 old_mount_opt = nilfs->ns_mount_opt; in nilfs_remount()
1153 err = -EINVAL; in nilfs_remount()
1156 sb->s_flags = (sb->s_flags & ~SB_POSIXACL); in nilfs_remount()
1158 err = -EINVAL; in nilfs_remount()
1169 sb->s_flags |= SB_RDONLY; in nilfs_remount()
1175 down_write(&nilfs->ns_sem); in nilfs_remount()
1177 up_write(&nilfs->ns_sem); in nilfs_remount()
1183 * Mounting a RDONLY partition read-write, so reread and in nilfs_remount()
1187 down_read(&nilfs->ns_sem); in nilfs_remount()
1188 features = le64_to_cpu(nilfs->ns_sbp[0]->s_feature_compat_ro) & in nilfs_remount()
1190 up_read(&nilfs->ns_sem); in nilfs_remount()
1195 err = -EROFS; in nilfs_remount()
1199 sb->s_flags &= ~SB_RDONLY; in nilfs_remount()
1201 root = NILFS_I(d_inode(sb->s_root))->i_root; in nilfs_remount()
1206 down_write(&nilfs->ns_sem); in nilfs_remount()
1208 up_write(&nilfs->ns_sem); in nilfs_remount()
1214 sb->s_flags = old_sb_flags; in nilfs_remount()
1215 nilfs->ns_mount_opt = old_mount_opt; in nilfs_remount()
1232 if (!(sd->flags & SB_RDONLY)) { in nilfs_parse_snapshot_option()
1233 msg = "read-only option is not specified"; in nilfs_parse_snapshot_option()
1237 err = kstrtoull(arg->from, 0, &val); in nilfs_parse_snapshot_option()
1239 if (err == -ERANGE) in nilfs_parse_snapshot_option()
1248 sd->cno = val; in nilfs_parse_snapshot_option()
1257 * nilfs_identify - pre-read mount options needed to identify mount instance
1279 *(options - 1) = ','; in nilfs_identify()
1286 s->s_dev = *(dev_t *)data; in nilfs_set_bdev_super()
1292 return !(s->s_iflags & SB_I_RETIRED) && s->s_dev == *(dev_t *)data; in nilfs_test_bdev_super()
1305 return ERR_PTR(-EINVAL); in nilfs_mount()
1316 if (!s->s_root) { in nilfs_mount()
1319 * bdev->open_mutex ranks above s_umount (blkdev_put() -> in nilfs_mount()
1323 up_write(&s->s_umount); in nilfs_mount()
1325 down_write(&s->s_umount); in nilfs_mount()
1332 s->s_flags |= SB_ACTIVE; in nilfs_mount()
1334 if (nilfs_tree_is_busy(s->s_root)) { in nilfs_mount()
1335 if ((flags ^ s->s_flags) & SB_RDONLY) { in nilfs_mount()
1338 sb_rdonly(s) ? "read-only" : "read/write"); in nilfs_mount()
1339 err = -EBUSY; in nilfs_mount()
1362 return dget(s->s_root); in nilfs_mount()
1382 INIT_LIST_HEAD(&ii->i_dirty); in nilfs_inode_init_once()
1384 init_rwsem(&ii->xattr_sem); in nilfs_inode_init_once()
1386 inode_init_once(&ii->vfs_inode); in nilfs_inode_init_once()
1397 * Make sure all delayed rcu free inodes are flushed before we in nilfs_destroy_cachep()
1439 return -ENOMEM; in nilfs_init_cachep()