Lines Matching +full:super +full:- +full:set
24 #include <linux/backing-dev.h>
42 return !strncmp(rs->s_v1.s_magic, reiserfs_3_5_magic_string, in is_reiserfs_3_5()
48 return !strncmp(rs->s_v1.s_magic, reiserfs_3_6_magic_string, in is_reiserfs_3_6()
54 return !strncmp(rs->s_v1.s_magic, reiserfs_jr_magic_string, in is_reiserfs_jr()
72 * Writeback quota in non-journalled quota case - journalled quota has in reiserfs_sync_fs()
75 dquot_writeback_dquots(s, -1); in reiserfs_sync_fs()
90 s = sbi->s_journal->j_work_sb; in flush_old_commits()
97 if (!down_read_trylock(&s->s_umount)) { in flush_old_commits()
99 spin_lock(&sbi->old_work_lock); in flush_old_commits()
100 if (sbi->work_queued == 1) in flush_old_commits()
101 queue_delayed_work(system_long_wq, &sbi->old_work, HZ); in flush_old_commits()
102 spin_unlock(&sbi->old_work_lock); in flush_old_commits()
105 spin_lock(&sbi->old_work_lock); in flush_old_commits()
107 if (sbi->work_queued == 1) in flush_old_commits()
108 sbi->work_queued = 0; in flush_old_commits()
109 spin_unlock(&sbi->old_work_lock); in flush_old_commits()
112 up_read(&s->s_umount); in flush_old_commits()
124 if (sb_rdonly(s) || !(s->s_flags & SB_ACTIVE)) in reiserfs_schedule_old_flush()
127 spin_lock(&sbi->old_work_lock); in reiserfs_schedule_old_flush()
128 if (!sbi->work_queued) { in reiserfs_schedule_old_flush()
130 queue_delayed_work(system_long_wq, &sbi->old_work, delay); in reiserfs_schedule_old_flush()
131 sbi->work_queued = 1; in reiserfs_schedule_old_flush()
133 spin_unlock(&sbi->old_work_lock); in reiserfs_schedule_old_flush()
140 spin_lock(&sbi->old_work_lock); in reiserfs_cancel_old_flush()
142 sbi->work_queued = 2; in reiserfs_cancel_old_flush()
143 spin_unlock(&sbi->old_work_lock); in reiserfs_cancel_old_flush()
144 cancel_delayed_work_sync(&REISERFS_SB(s)->old_work); in reiserfs_cancel_old_flush()
175 spin_lock(&sbi->old_work_lock); in reiserfs_unfreeze()
177 sbi->work_queued = 0; in reiserfs_unfreeze()
178 spin_unlock(&sbi->old_work_lock); in reiserfs_unfreeze()
207 reiserfs_release_objectid(&th, le32_to_cpu(key->k_objectid)); in remove_save_link_only()
255 if (s->s_flags & SB_ACTIVE) { in finish_unfinished()
259 s->s_flags |= SB_ACTIVE; in finish_unfinished()
264 if (REISERFS_SB(s)->s_qf_names[i]) { in finish_unfinished()
275 reiserfs_warning(s, "reiserfs-2500", in finish_unfinished()
283 REISERFS_SB(s)->s_is_unlinked_ok = 1; in finish_unfinished()
288 reiserfs_error(s, "vs-2140", in finish_unfinished()
296 reiserfs_warning(s, "vs-2060", in finish_unfinished()
300 item_pos--; in finish_unfinished()
303 if (le32_to_cpu(ih->ih_key.k_dir_id) != MAX_KEY_OBJECTID) in finish_unfinished()
307 save_link_key = ih->ih_key; in finish_unfinished()
317 le32_to_cpu(ih->ih_key.k_objectid); in finish_unfinished()
329 reiserfs_warning(s, "vs-2180", "iget failed for %K", in finish_unfinished()
335 if (!truncate && inode->i_nlink) { in finish_unfinished()
337 reiserfs_warning(s, "vs-2185", in finish_unfinished()
343 depth = reiserfs_write_unlock_nested(inode->i_sb); in finish_unfinished()
345 reiserfs_write_lock_nested(inode->i_sb, depth); in finish_unfinished()
347 if (truncate && S_ISDIR(inode->i_mode)) { in finish_unfinished()
355 reiserfs_warning(s, "green-2101", in finish_unfinished()
366 REISERFS_I(inode)->i_flags |= in finish_unfinished()
373 INODE_PKEY(inode), inode->i_size); in finish_unfinished()
380 REISERFS_I(inode)->i_flags |= i_link_saved_unlink_mask; in finish_unfinished()
389 reiserfs_warning(s, "super-2189", "Dead loop " in finish_unfinished()
402 REISERFS_SB(s)->s_is_unlinked_ok = 0; in finish_unfinished()
408 if (sb_dqopt(s)->files[i] && quota_enabled[i]) in finish_unfinished()
414 s->s_flags &= ~SB_ACTIVE; in finish_unfinished()
438 BUG_ON(!th->t_trans_id); in add_save_link()
442 (REISERFS_I(inode)->i_flags & i_link_saved_truncate_mask), in add_save_link()
444 (long)inode->i_ino); in add_save_link()
446 (REISERFS_I(inode)->i_flags & i_link_saved_unlink_mask), in add_save_link()
448 (long)inode->i_ino); in add_save_link()
453 key.on_disk_key.k_objectid = inode->i_ino; in add_save_link()
456 set_cpu_key_k_offset(&key, 1 + inode->i_sb->s_blocksize); in add_save_link()
461 1 + inode->i_sb->s_blocksize, TYPE_DIRECT, in add_save_link()
465 if (S_ISDIR(inode->i_mode)) in add_save_link()
466 reiserfs_warning(inode->i_sb, "green-2102", in add_save_link()
480 retval = search_item(inode->i_sb, &key, &path); in add_save_link()
482 if (retval != -ENOSPC) in add_save_link()
483 reiserfs_error(inode->i_sb, "vs-2100", in add_save_link()
491 link = INODE_PKEY(inode)->k_dir_id; in add_save_link()
497 if (retval != -ENOSPC) in add_save_link()
498 reiserfs_error(inode->i_sb, "vs-2120", in add_save_link()
502 REISERFS_I(inode)->i_flags |= in add_save_link()
505 REISERFS_I(inode)->i_flags |= i_link_saved_unlink_mask; in add_save_link()
517 err = journal_begin(&th, inode->i_sb, JOURNAL_PER_BALANCE_CNT); in remove_save_link()
523 key.k_objectid = INODE_PKEY(inode)->k_objectid; in remove_save_link()
527 1 + inode->i_sb->s_blocksize); in remove_save_link()
536 (REISERFS_I(inode)->i_flags & i_link_saved_truncate_mask)) || in remove_save_link()
538 (REISERFS_I(inode)->i_flags & i_link_saved_unlink_mask))) in remove_save_link()
542 reiserfs_release_objectid(&th, inode->i_ino); in remove_save_link()
543 REISERFS_I(inode)->i_flags &= ~i_link_saved_unlink_mask; in remove_save_link()
545 REISERFS_I(inode)->i_flags &= ~i_link_saved_truncate_mask; in remove_save_link()
560 * those before it's called so ->put_super is too late. in reiserfs_kill_sb()
564 dput(REISERFS_SB(s)->xattr_root); in reiserfs_kill_sb()
565 REISERFS_SB(s)->xattr_root = NULL; in reiserfs_kill_sb()
566 dput(REISERFS_SB(s)->priv_root); in reiserfs_kill_sb()
567 REISERFS_SB(s)->priv_root = NULL; in reiserfs_kill_sb()
600 * with read-write permissions in reiserfs_put_super()
607 REISERFS_SB(s)->s_mount_state); in reiserfs_put_super()
624 if (REISERFS_SB(s)->reserved_blocks != 0) { in reiserfs_put_super()
625 reiserfs_warning(s, "green-2005", "reserved blocks left %d", in reiserfs_put_super()
626 REISERFS_SB(s)->reserved_blocks); in reiserfs_put_super()
630 mutex_destroy(&REISERFS_SB(s)->lock); in reiserfs_put_super()
631 destroy_workqueue(REISERFS_SB(s)->commit_wq); in reiserfs_put_super()
632 kfree(REISERFS_SB(s)->s_jdev); in reiserfs_put_super()
633 kfree(s->s_fs_info); in reiserfs_put_super()
634 s->s_fs_info = NULL; in reiserfs_put_super()
645 atomic_set(&ei->openers, 0); in reiserfs_alloc_inode()
646 mutex_init(&ei->tailpack); in reiserfs_alloc_inode()
648 memset(&ei->i_dquot, 0, sizeof(ei->i_dquot)); in reiserfs_alloc_inode()
651 return &ei->vfs_inode; in reiserfs_alloc_inode()
663 INIT_LIST_HEAD(&ei->i_prealloc_list); in init_once()
664 inode_init_once(&ei->vfs_inode); in init_once()
676 return -ENOMEM; in init_inodecache()
697 if (sb_rdonly(inode->i_sb)) { in reiserfs_dirty_inode()
698 reiserfs_warning(inode->i_sb, "clm-6006", in reiserfs_dirty_inode()
700 inode->i_ino); in reiserfs_dirty_inode()
703 reiserfs_write_lock(inode->i_sb); in reiserfs_dirty_inode()
709 err = journal_begin(&th, inode->i_sb, 1); in reiserfs_dirty_inode()
717 reiserfs_write_unlock(inode->i_sb); in reiserfs_dirty_inode()
722 struct super_block *s = root->d_sb; in reiserfs_show_options()
724 long opts = REISERFS_SB(s)->s_mount_opt; in reiserfs_show_options()
760 if (REISERFS_SB(s)->s_jdev) in reiserfs_show_options()
761 seq_show_option(seq, "jdev", REISERFS_SB(s)->s_jdev); in reiserfs_show_options()
763 if (journal->j_max_commit_age != journal->j_default_max_commit_age) in reiserfs_show_options()
764 seq_printf(seq, ",commit=%d", journal->j_max_commit_age); in reiserfs_show_options()
767 if (REISERFS_SB(s)->s_qf_names[USRQUOTA]) in reiserfs_show_options()
769 REISERFS_SB(s)->s_qf_names[USRQUOTA]); in reiserfs_show_options()
772 if (REISERFS_SB(s)->s_qf_names[GRPQUOTA]) in reiserfs_show_options()
774 REISERFS_SB(s)->s_qf_names[GRPQUOTA]); in reiserfs_show_options()
777 if (REISERFS_SB(s)->s_jquota_fmt) { in reiserfs_show_options()
778 if (REISERFS_SB(s)->s_jquota_fmt == QFMT_VFS_OLD) in reiserfs_show_options()
780 else if (REISERFS_SB(s)->s_jquota_fmt == QFMT_VFS_V0) in reiserfs_show_options()
787 seq_puts(seq, ",block-allocator=noborder"); in reiserfs_show_options()
789 seq_puts(seq, ",block-allocator=no_unhashed_relocation"); in reiserfs_show_options()
791 seq_puts(seq, ",block-allocator=hashed_relocation"); in reiserfs_show_options()
793 seq_puts(seq, ",block-allocator=test4"); in reiserfs_show_options()
806 return REISERFS_I(inode)->i_dquot; in reiserfs_get_dquots()
876 * bitmask which is to set on mount_options bitmask
888 /* Set this bit in arg_required to allow empty arguments */
893 * set of reiserfs mount options
905 * bitmask which is to set on mount_options bitmask
918 /* possible values for -o data= */
929 /* possible values for -o barrier= */
937 * possible values for "-o block-allocator=" and bits which are to be set in
938 * s_mount_opt of reiserfs specific part of in-core super block
960 {"ro-remount", 1 << REISERFS_ERROR_RO,
970 * proceed only one option from a list *cur - string containing of mount
972 * opts - array of options which are accepted
973 * opt_arg - if option is found and requires an argument and if it is specifed
974 * in the input - pointer to the argument is stored here
975 * bit_flags - if option requires to set a certain bit - it is set here
976 * return -1 if unknown option is found, opt->arg_required otherwise
985 * | | +-- option_end in reiserfs_getopt()
986 * | +-- arg_start in reiserfs_getopt()
987 * +-- option_start in reiserfs_getopt()
1009 return -1; in reiserfs_getopt()
1016 for (opt = opts; opt->option_name; opt++) { in reiserfs_getopt()
1017 if (!strncmp(p, opt->option_name, strlen(opt->option_name))) { in reiserfs_getopt()
1019 if (opt->clrmask == in reiserfs_getopt()
1021 reiserfs_warning(s, "super-6500", in reiserfs_getopt()
1025 *bit_flags &= ~opt->clrmask; in reiserfs_getopt()
1026 if (opt->setmask == in reiserfs_getopt()
1028 reiserfs_warning(s, "super-6501", in reiserfs_getopt()
1032 *bit_flags |= opt->setmask; in reiserfs_getopt()
1037 if (!opt->option_name) { in reiserfs_getopt()
1038 reiserfs_warning(s, "super-6502", in reiserfs_getopt()
1040 return -1; in reiserfs_getopt()
1043 p += strlen(opt->option_name); in reiserfs_getopt()
1046 if (!opt->arg_required) { in reiserfs_getopt()
1047 reiserfs_warning(s, "super-6503", in reiserfs_getopt()
1050 opt->option_name); in reiserfs_getopt()
1051 return -1; in reiserfs_getopt()
1056 if (opt->arg_required) { in reiserfs_getopt()
1057 reiserfs_warning(s, "super-6504", in reiserfs_getopt()
1059 "argument\n", opt->option_name); in reiserfs_getopt()
1060 return -1; in reiserfs_getopt()
1064 reiserfs_warning(s, "super-6505", in reiserfs_getopt()
1066 opt->option_name); in reiserfs_getopt()
1067 return -1; in reiserfs_getopt()
1076 if (opt->arg_required in reiserfs_getopt()
1077 && !(opt->arg_required & (1 << REISERFS_OPT_ALLOWEMPTY)) in reiserfs_getopt()
1080 reiserfs_warning(s, "super-6506", in reiserfs_getopt()
1082 opt->option_name); in reiserfs_getopt()
1083 return -1; in reiserfs_getopt()
1086 if (!opt->values) { in reiserfs_getopt()
1089 return opt->arg_required & ~(1 << REISERFS_OPT_ALLOWEMPTY); in reiserfs_getopt()
1092 /* values possible for this option are listed in opt->values */ in reiserfs_getopt()
1093 for (arg = opt->values; arg->value; arg++) { in reiserfs_getopt()
1094 if (!strcmp(p, arg->value)) { in reiserfs_getopt()
1096 *bit_flags &= ~arg->clrmask; in reiserfs_getopt()
1097 *bit_flags |= arg->setmask; in reiserfs_getopt()
1099 return opt->arg_required; in reiserfs_getopt()
1103 reiserfs_warning(s, "super-6506", in reiserfs_getopt()
1105 opt->option_name); in reiserfs_getopt()
1106 return -1; in reiserfs_getopt()
1109 /* returns 0 if something is wrong in option string, 1 - otherwise */
1112 /* string given via mount's -o */ in reiserfs_parse_options()
1122 /* strtol-ed from NNN of resize=NNN */ in reiserfs_parse_options()
1134 * Compatibility stuff, so that -o notail for old in reiserfs_parse_options()
1160 {"block-allocator",.arg_required = 'a',.values = balloc}, in reiserfs_parse_options()
1189 if (c == -1) in reiserfs_parse_options()
1200 /* From JFS code, to auto-get the size. */ in reiserfs_parse_options()
1206 reiserfs_warning(s, "super-6507", in reiserfs_parse_options()
1208 "-oresize\n", arg); in reiserfs_parse_options()
1218 if (*p != '\0' || val >= (unsigned int)-1) { in reiserfs_parse_options()
1219 reiserfs_warning(s, "super-6508", in reiserfs_parse_options()
1220 "bad value %s for -ocommit\n", in reiserfs_parse_options()
1228 reiserfs_warning(s, "super-6509", "nolargeio option " in reiserfs_parse_options()
1237 reiserfs_warning(s, "super-6510", in reiserfs_parse_options()
1251 (!*arg != !REISERFS_SB(s)->s_qf_names[qtype])) { in reiserfs_parse_options()
1252 reiserfs_warning(s, "super-6511", in reiserfs_parse_options()
1259 REISERFS_SB(s)->s_qf_names[qtype]) in reiserfs_parse_options()
1263 if (REISERFS_SB(s)->s_qf_names[qtype] in reiserfs_parse_options()
1264 && strcmp(REISERFS_SB(s)->s_qf_names[qtype], in reiserfs_parse_options()
1266 reiserfs_warning(s, "super-6512", in reiserfs_parse_options()
1273 reiserfs_warning(s, "super-6513", in reiserfs_parse_options()
1280 reiserfs_warning(s, "reiserfs-2502", in reiserfs_parse_options()
1303 reiserfs_warning(s, "super-6514", in reiserfs_parse_options()
1309 *qfmt != REISERFS_SB(s)->s_jquota_fmt) { in reiserfs_parse_options()
1310 reiserfs_warning(s, "super-6515", in reiserfs_parse_options()
1319 reiserfs_warning(s, "reiserfs-2503", "journaled " in reiserfs_parse_options()
1327 if (!REISERFS_SB(s)->s_jquota_fmt && !*qfmt in reiserfs_parse_options()
1329 reiserfs_warning(s, "super-6515", in reiserfs_parse_options()
1337 reiserfs_warning(s, "super-6516", "quota options must " in reiserfs_parse_options()
1348 REISERFS_SB(s)->s_mount_opt &= ~((1 << REISERFS_DATA_LOG) | in switch_data_mode()
1351 REISERFS_SB(s)->s_mount_opt |= (1 << mode); in switch_data_mode()
1381 REISERFS_SB(s)->s_mount_opt &= ~all_barrier; in handle_barrier_mode()
1383 REISERFS_SB(s)->s_mount_opt |= flush; in handle_barrier_mode()
1386 REISERFS_SB(s)->s_mount_opt |= none; in handle_barrier_mode()
1398 reiserfs_warning(s, "super-6517", "cannot support " in handle_attrs()
1400 REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS); in handle_attrs()
1403 if (!(le32_to_cpu(rs->s_flags) & reiserfs_attrs_cleared)) { in handle_attrs()
1404 reiserfs_warning(s, "super-6518", "cannot support " in handle_attrs()
1405 "attributes until flag is set in " in handle_attrs()
1406 "super-block"); in handle_attrs()
1407 REISERFS_SB(s)->s_mount_opt &= ~(1 << REISERFS_ATTRS); in handle_attrs()
1419 if (qf_names[i] != REISERFS_SB(s)->s_qf_names[i]) in handle_quota_files()
1420 kfree(REISERFS_SB(s)->s_qf_names[i]); in handle_quota_files()
1421 REISERFS_SB(s)->s_qf_names[i] = qf_names[i]; in handle_quota_files()
1424 REISERFS_SB(s)->s_jquota_fmt = *qfmt; in handle_quota_files()
1433 unsigned long mount_options = REISERFS_SB(s)->s_mount_opt; in reiserfs_remount()
1435 unsigned int commit_max_age = (unsigned int)-1; in reiserfs_remount()
1448 memcpy(qf_names, REISERFS_SB(s)->s_qf_names, sizeof(qf_names)); in reiserfs_remount()
1458 if (qf_names[i] != REISERFS_SB(s)->s_qf_names[i]) in reiserfs_remount()
1461 err = -EINVAL; in reiserfs_remount()
1492 REISERFS_SB(s)->s_mount_opt = in reiserfs_remount()
1493 (REISERFS_SB(s)-> in reiserfs_remount()
1496 if (commit_max_age != 0 && commit_max_age != (unsigned int)-1) { in reiserfs_remount()
1497 journal->j_max_commit_age = commit_max_age; in reiserfs_remount()
1498 journal->j_max_trans_age = commit_max_age; in reiserfs_remount()
1501 journal->j_max_commit_age = journal->j_default_max_commit_age; in reiserfs_remount()
1502 journal->j_max_trans_age = JOURNAL_MAX_TRANS_AGE; in reiserfs_remount()
1514 /* remount read-only */ in reiserfs_remount()
1516 /* it is read-only already */ in reiserfs_remount()
1519 err = dquot_suspend(s, -1); in reiserfs_remount()
1523 /* try to remount file system with read-only permissions */ in reiserfs_remount()
1525 || REISERFS_SB(s)->s_mount_state != REISERFS_VALID_FS) { in reiserfs_remount()
1535 /* Mounting a rw partition read-only. */ in reiserfs_remount()
1537 set_sb_umount_state(rs, REISERFS_SB(s)->s_mount_state); in reiserfs_remount()
1540 /* remount read-write */ in reiserfs_remount()
1544 goto out_ok_unlocked; /* We are read-write already */ in reiserfs_remount()
1548 err = journal->j_errno; in reiserfs_remount()
1554 REISERFS_SB(s)->s_mount_state = sb_umount_state(rs); in reiserfs_remount()
1557 s->s_flags &= ~SB_RDONLY; in reiserfs_remount()
1562 /* Mount a partition which is read-only, read-write */ in reiserfs_remount()
1564 REISERFS_SB(s)->s_mount_state = sb_umount_state(rs); in reiserfs_remount()
1565 s->s_flags &= ~SB_RDONLY; in reiserfs_remount()
1571 REISERFS_SB(s)->s_mount_state = REISERFS_VALID_FS; in reiserfs_remount()
1574 SB_JOURNAL(s)->j_must_wait = 1; in reiserfs_remount()
1581 dquot_resume(s, -1); in reiserfs_remount()
1603 bh = sb_bread(s, offset / s->s_blocksize); in read_super_block()
1605 reiserfs_warning(s, "sh-2006", in read_super_block()
1607 s->s_id, offset / s->s_blocksize, in read_super_block()
1608 s->s_blocksize); in read_super_block()
1612 rs = (struct reiserfs_super_block *)bh->b_data; in read_super_block()
1624 bh = sb_bread(s, offset / s->s_blocksize); in read_super_block()
1626 reiserfs_warning(s, "sh-2007", in read_super_block()
1628 s->s_id, offset / s->s_blocksize, in read_super_block()
1629 s->s_blocksize); in read_super_block()
1633 rs = (struct reiserfs_super_block *)bh->b_data; in read_super_block()
1634 if (sb_blocksize(rs) != s->s_blocksize) { in read_super_block()
1635 reiserfs_warning(s, "sh-2011", "can't find a reiserfs " in read_super_block()
1637 s->s_id, in read_super_block()
1638 (unsigned long long)bh->b_blocknr, in read_super_block()
1639 s->s_blocksize); in read_super_block()
1644 if (rs->s_v1.s_root_block == cpu_to_le32(-1)) { in read_super_block()
1646 reiserfs_warning(s, "super-6519", "Unfinished reiserfsck " in read_super_block()
1647 "--rebuild-tree run detected. Please run\n" in read_super_block()
1648 "reiserfsck --rebuild-tree and wait for a " in read_super_block()
1660 * magic is of non-standard journal filesystem, look at s_version to in read_super_block()
1666 " with non-standard journal\n"); in read_super_block()
1669 " with non-standard journal\n"); in read_super_block()
1671 reiserfs_warning(s, "sh-2012", "found unknown " in read_super_block()
1673 "non-standard magic", sb_version(rs)); in read_super_block()
1685 s->s_op = &reiserfs_sops; in read_super_block()
1686 s->s_export_op = &reiserfs_export_ops; in read_super_block()
1688 s->s_qcop = &reiserfs_qctl_operations; in read_super_block()
1689 s->dq_op = &reiserfs_quota_operations; in read_super_block()
1690 s->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; in read_super_block()
1697 s->s_maxbytes = (512LL << 32) - s->s_blocksize; in read_super_block()
1701 /* after journal replay, reread all bitmap and super blocks */
1705 reiserfs_warning(s, "reiserfs-2504", "error reading the super"); in reread_meta_blocks()
1715 * if root directory is empty - we set default - Yura's - hash and
1718 * both have the same value - we ask user to send report to the
1732 inode = d_inode(s->s_root); in find_hash_out()
1741 de.de_entry_num--; in find_hash_out()
1762 reiserfs_warning(s, "reiserfs-2506", in find_hash_out()
1764 "function. Please mount with -o " in find_hash_out()
1777 reiserfs_warning(s, "reiserfs-2506", in find_hash_out()
1807 reiserfs_warning(s, "reiserfs-2507", in what_hash()
1813 reiserfs_warning(s, "reiserfs-2508", in what_hash()
1819 reiserfs_warning(s, "reiserfs-2509", in what_hash()
1841 * the super in what_hash()
1868 /* this is used to set up correct value for old partitions */
1899 int errval = -EINVAL; in reiserfs_fill_super()
1905 return -ENOMEM; in reiserfs_fill_super()
1906 s->s_fs_info = sbi; in reiserfs_fill_super()
1907 /* Set default values for options: non-aggressive tails, RO on errors */ in reiserfs_fill_super()
1908 sbi->s_mount_opt |= (1 << REISERFS_SMALLTAIL); in reiserfs_fill_super()
1909 sbi->s_mount_opt |= (1 << REISERFS_ERROR_RO); in reiserfs_fill_super()
1910 sbi->s_mount_opt |= (1 << REISERFS_BARRIER_FLUSH); in reiserfs_fill_super()
1912 sbi->s_alloc_options.preallocmin = 0; in reiserfs_fill_super()
1913 /* Preallocate by 16 blocks (17-1) at once */ in reiserfs_fill_super()
1914 sbi->s_alloc_options.preallocsize = 17; in reiserfs_fill_super()
1918 spin_lock_init(&sbi->old_work_lock); in reiserfs_fill_super()
1919 INIT_DELAYED_WORK(&sbi->old_work, flush_old_commits); in reiserfs_fill_super()
1920 mutex_init(&sbi->lock); in reiserfs_fill_super()
1921 sbi->lock_depth = -1; in reiserfs_fill_super()
1923 sbi->commit_wq = alloc_workqueue("reiserfs/%s", WQ_MEM_RECLAIM, 0, in reiserfs_fill_super()
1924 s->s_id); in reiserfs_fill_super()
1925 if (!sbi->commit_wq) { in reiserfs_fill_super()
1927 errval = -ENOMEM; in reiserfs_fill_super()
1933 (s, (char *)data, &sbi->s_mount_opt, &blocks, &jdev_name, in reiserfs_fill_super()
1938 sbi->s_jdev = kstrdup(jdev_name, GFP_KERNEL); in reiserfs_fill_super()
1939 if (!sbi->s_jdev) { in reiserfs_fill_super()
1950 SWARN(silent, s, "jmacd-7", "resize option for remount only"); in reiserfs_fill_super()
1955 * try old format (undistributed bitmap, super block in 8-th 1k in reiserfs_fill_super()
1962 * try new format (64-th 1k block), which can contain reiserfs in reiserfs_fill_super()
1963 * super block in reiserfs_fill_super()
1966 SWARN(silent, s, "sh-2021", "can not find reiserfs on %s", in reiserfs_fill_super()
1967 s->s_id); in reiserfs_fill_super()
1971 s->s_time_min = 0; in reiserfs_fill_super()
1972 s->s_time_max = U32_MAX; in reiserfs_fill_super()
1980 if (bdev_nr_bytes(s->s_bdev) < sb_block_count(rs) * sb_blocksize(rs)) { in reiserfs_fill_super()
1990 sbi->s_mount_state = SB_REISERFS_STATE(s); in reiserfs_fill_super()
1991 sbi->s_mount_state = REISERFS_VALID_FS; in reiserfs_fill_super()
1994 SWARN(silent, s, "jmacd-8", "unable to read bitmap"); in reiserfs_fill_super()
1998 errval = -EINVAL; in reiserfs_fill_super()
2000 SWARN(silent, s, "", "CONFIG_REISERFS_CHECK is set ON"); in reiserfs_fill_super()
2001 SWARN(silent, s, "", "- it is slow mode for debugging."); in reiserfs_fill_super()
2007 sbi->s_mount_opt |= (1 << REISERFS_DATA_ORDERED); in reiserfs_fill_super()
2022 SWARN(silent, s, "sh-2022", in reiserfs_fill_super()
2027 * once this is set, journal_release must be called in reiserfs_fill_super()
2034 SWARN(silent, s, "jmacd-9", in reiserfs_fill_super()
2042 s->s_xattr = reiserfs_xattr_handlers; in reiserfs_fill_super()
2044 if (bdev_read_only(s->s_bdev) && !sb_rdonly(s)) { in reiserfs_fill_super()
2045 SWARN(silent, s, "clm-7000", in reiserfs_fill_super()
2047 s->s_flags |= SB_RDONLY; in reiserfs_fill_super()
2055 SWARN(silent, s, "jmacd-10", "get root inode failed"); in reiserfs_fill_super()
2069 if (root_inode->i_state & I_NEW) { in reiserfs_fill_super()
2074 if (!S_ISDIR(root_inode->i_mode) || !inode_get_bytes(root_inode) || in reiserfs_fill_super()
2075 !root_inode->i_size) { in reiserfs_fill_super()
2078 errval = -EUCLEAN; in reiserfs_fill_super()
2082 s->s_root = d_make_root(root_inode); in reiserfs_fill_super()
2083 if (!s->s_root) in reiserfs_fill_super()
2086 sbi->s_hash_function = hash_function(s); in reiserfs_fill_super()
2087 if (sbi->s_hash_function == NULL) { in reiserfs_fill_super()
2088 dput(s->s_root); in reiserfs_fill_super()
2089 s->s_root = NULL; in reiserfs_fill_super()
2095 set_bit(REISERFS_3_5, &sbi->s_properties); in reiserfs_fill_super()
2097 set_bit(REISERFS_OLD_FORMAT, &sbi->s_properties); in reiserfs_fill_super()
2099 set_bit(REISERFS_3_6, &sbi->s_properties); in reiserfs_fill_super()
2105 dput(s->s_root); in reiserfs_fill_super()
2106 s->s_root = NULL; in reiserfs_fill_super()
2118 * avoiding corruption. -jeffm in reiserfs_fill_super()
2122 reiserfs_warning(s, "super-2030", "This file system " in reiserfs_fill_super()
2124 "its super block, but requires %u. " in reiserfs_fill_super()
2134 * or non-standard journal in reiserfs_fill_super()
2137 /* and -o conv is given */ in reiserfs_fill_super()
2148 memcpy(rs->s_v1.s_magic, in reiserfs_fill_super()
2155 set_bit(REISERFS_3_6, &sbi->s_properties); in reiserfs_fill_super()
2156 clear_bit(REISERFS_3_5, &sbi->s_properties); in reiserfs_fill_super()
2167 dput(s->s_root); in reiserfs_fill_super()
2168 s->s_root = NULL; in reiserfs_fill_super()
2174 (errval = reiserfs_xattr_init(s, s->s_flags))) { in reiserfs_fill_super()
2175 dput(s->s_root); in reiserfs_fill_super()
2176 s->s_root = NULL; in reiserfs_fill_super()
2192 (errval = reiserfs_xattr_init(s, s->s_flags))) { in reiserfs_fill_super()
2193 dput(s->s_root); in reiserfs_fill_super()
2194 s->s_root = NULL; in reiserfs_fill_super()
2200 * mark hash in super block: it could be unset. overwrite should be ok in reiserfs_fill_super()
2202 set_sb_hash_function_code(rs, function2code(sbi->s_hash_function)); in reiserfs_fill_super()
2208 init_waitqueue_head(&(sbi->s_wait)); in reiserfs_fill_super()
2209 spin_lock_init(&sbi->bitmap_lock); in reiserfs_fill_super()
2226 if (sbi->commit_wq) in reiserfs_fill_super()
2227 destroy_workqueue(sbi->commit_wq); in reiserfs_fill_super()
2241 kfree(sbi->s_jdev); in reiserfs_fill_super()
2244 s->s_fs_info = NULL; in reiserfs_fill_super()
2250 struct reiserfs_super_block *rs = SB_DISK_SUPER_BLOCK(dentry->d_sb); in reiserfs_statfs()
2252 buf->f_namelen = (REISERFS_MAX_NAME(s->s_blocksize)); in reiserfs_statfs()
2253 buf->f_bfree = sb_free_blocks(rs); in reiserfs_statfs()
2254 buf->f_bavail = buf->f_bfree; in reiserfs_statfs()
2255 buf->f_blocks = sb_block_count(rs) - sb_bmap_nr(rs) - 1; in reiserfs_statfs()
2256 buf->f_bsize = dentry->d_sb->s_blocksize; in reiserfs_statfs()
2258 buf->f_type = REISERFS_SUPER_MAGIC; in reiserfs_statfs()
2259 buf->f_fsid.val[0] = (u32)crc32_le(0, rs->s_uuid, sizeof(rs->s_uuid)/2); in reiserfs_statfs()
2260 buf->f_fsid.val[1] = (u32)crc32_le(0, rs->s_uuid + sizeof(rs->s_uuid)/2, in reiserfs_statfs()
2261 sizeof(rs->s_uuid)/2); in reiserfs_statfs()
2273 reiserfs_write_lock(dquot->dq_sb); in reiserfs_write_dquot()
2275 journal_begin(&th, dquot->dq_sb, in reiserfs_write_dquot()
2276 REISERFS_QUOTA_TRANS_BLOCKS(dquot->dq_sb)); in reiserfs_write_dquot()
2279 depth = reiserfs_write_unlock_nested(dquot->dq_sb); in reiserfs_write_dquot()
2281 reiserfs_write_lock_nested(dquot->dq_sb, depth); in reiserfs_write_dquot()
2286 reiserfs_write_unlock(dquot->dq_sb); in reiserfs_write_dquot()
2296 reiserfs_write_lock(dquot->dq_sb); in reiserfs_acquire_dquot()
2298 journal_begin(&th, dquot->dq_sb, in reiserfs_acquire_dquot()
2299 REISERFS_QUOTA_INIT_BLOCKS(dquot->dq_sb)); in reiserfs_acquire_dquot()
2302 depth = reiserfs_write_unlock_nested(dquot->dq_sb); in reiserfs_acquire_dquot()
2304 reiserfs_write_lock_nested(dquot->dq_sb, depth); in reiserfs_acquire_dquot()
2309 reiserfs_write_unlock(dquot->dq_sb); in reiserfs_acquire_dquot()
2318 reiserfs_write_lock(dquot->dq_sb); in reiserfs_release_dquot()
2320 journal_begin(&th, dquot->dq_sb, in reiserfs_release_dquot()
2321 REISERFS_QUOTA_DEL_BLOCKS(dquot->dq_sb)); in reiserfs_release_dquot()
2322 reiserfs_write_unlock(dquot->dq_sb); in reiserfs_release_dquot()
2329 reiserfs_write_lock(dquot->dq_sb); in reiserfs_release_dquot()
2333 reiserfs_write_unlock(dquot->dq_sb); in reiserfs_release_dquot()
2341 if (REISERFS_SB(dquot->dq_sb)->s_qf_names[USRQUOTA] || in reiserfs_mark_dquot_dirty()
2342 REISERFS_SB(dquot->dq_sb)->s_qf_names[GRPQUOTA]) { in reiserfs_mark_dquot_dirty()
2372 * Turn on quotas during mount time - we need to find the quota file and such...
2376 return dquot_quota_on_mount(sb, REISERFS_SB(sb)->s_qf_names[type], in reiserfs_quota_on_mount()
2377 REISERFS_SB(sb)->s_jquota_fmt, type); in reiserfs_quota_on_mount()
2392 if (!(REISERFS_SB(sb)->s_mount_opt & (1 << opt))) { in reiserfs_quota_on()
2393 err = -EINVAL; in reiserfs_quota_on()
2398 if (path->dentry->d_sb != sb) { in reiserfs_quota_on()
2399 err = -EXDEV; in reiserfs_quota_on()
2402 inode = d_inode(path->dentry); in reiserfs_quota_on()
2407 if (!(REISERFS_I(inode)->i_flags & i_nopack_mask)) { in reiserfs_quota_on()
2410 reiserfs_warning(sb, "super-6520", in reiserfs_quota_on()
2413 err = -EINVAL; in reiserfs_quota_on()
2419 if (REISERFS_SB(sb)->s_qf_names[type]) { in reiserfs_quota_on()
2421 if (path->dentry->d_parent != sb->s_root) in reiserfs_quota_on()
2422 reiserfs_warning(sb, "super-6521", in reiserfs_quota_on()
2444 REISERFS_I(inode)->i_attrs |= REISERFS_IMMUTABLE_FL | in reiserfs_quota_on()
2460 struct inode *inode = sb_dqopt(sb)->files[type]; in reiserfs_quota_off()
2470 REISERFS_I(inode)->i_attrs &= ~(REISERFS_IMMUTABLE_FL | in reiserfs_quota_off()
2483 * Read data from quotafile - avoid pagecache and such because we cannot afford
2491 struct inode *inode = sb_dqopt(sb)->files[type]; in reiserfs_quota_read()
2492 unsigned long blk = off >> sb->s_blocksize_bits; in reiserfs_quota_read()
2493 int err = 0, offset = off & (sb->s_blocksize - 1), tocopy; in reiserfs_quota_read()
2501 len = i_size - off; in reiserfs_quota_read()
2504 tocopy = min_t(unsigned long, sb->s_blocksize - offset, toread); in reiserfs_quota_read()
2520 return -EIO; in reiserfs_quota_read()
2521 memcpy(data, bh->b_data + offset, tocopy); in reiserfs_quota_read()
2525 toread -= tocopy; in reiserfs_quota_read()
2539 struct inode *inode = sb_dqopt(sb)->files[type]; in reiserfs_quota_write()
2540 unsigned long blk = off >> sb->s_blocksize_bits; in reiserfs_quota_write()
2541 int err = 0, offset = off & (sb->s_blocksize - 1), tocopy; in reiserfs_quota_write()
2542 int journal_quota = REISERFS_SB(sb)->s_qf_names[type] != NULL; in reiserfs_quota_write()
2546 if (!current->journal_info) { in reiserfs_quota_write()
2549 return -EIO; in reiserfs_quota_write()
2552 tocopy = min_t(unsigned long, sb->s_blocksize - offset, towrite); in reiserfs_quota_write()
2559 if (offset || tocopy != sb->s_blocksize) in reiserfs_quota_write()
2564 err = -EIO; in reiserfs_quota_write()
2568 memcpy(bh->b_data + offset, data, tocopy); in reiserfs_quota_write()
2569 flush_dcache_page(bh->b_page); in reiserfs_quota_write()
2574 journal_mark_dirty(current->journal_info, bh); in reiserfs_quota_write()
2580 towrite -= tocopy; in reiserfs_quota_write()
2587 if (inode->i_size < off + len - towrite) in reiserfs_quota_write()
2588 i_size_write(inode, off + len - towrite); in reiserfs_quota_write()
2591 return len - towrite; in reiserfs_quota_write()