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

Configure Feed

Select the types of activity you want to include in your feed.

nilfs2: convert to use the new mount API

Convert nilfs2 to use the new mount API.

[sandeen@redhat.com: v2]
Link: https://lkml.kernel.org/r/33d078a7-9072-4d8e-a3a9-dec23d4191da@redhat.com
Link: https://lkml.kernel.org/r/20240425190526.10905-1-konishi.ryusuke@gmail.com
[konishi.ryusuke: fixed missing SB_RDONLY flag repair in nilfs_reconfigure]
Link: https://lkml.kernel.org/r/33d078a7-9072-4d8e-a3a9-dec23d4191da@redhat.com
Link: https://lkml.kernel.org/r/20240424182716.6024-1-konishi.ryusuke@gmail.com
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Eric Sandeen and committed by
Andrew Morton
36defdd9 f4af41bf

+173 -228
+2 -2
fs/nilfs2/nilfs.h
··· 335 335 336 336 extern struct nilfs_super_block * 337 337 nilfs_read_super_block(struct super_block *, u64, int, struct buffer_head **); 338 - extern int nilfs_store_magic_and_option(struct super_block *, 339 - struct nilfs_super_block *, char *); 338 + extern int nilfs_store_magic(struct super_block *sb, 339 + struct nilfs_super_block *sbp); 340 340 extern int nilfs_check_feature_compatibility(struct super_block *, 341 341 struct nilfs_super_block *); 342 342 extern void nilfs_set_log_cursor(struct nilfs_super_block *,
+168 -218
fs/nilfs2/super.c
··· 29 29 #include <linux/slab.h> 30 30 #include <linux/init.h> 31 31 #include <linux/blkdev.h> 32 - #include <linux/parser.h> 33 32 #include <linux/crc32.h> 34 33 #include <linux/vfs.h> 35 34 #include <linux/writeback.h> 36 35 #include <linux/seq_file.h> 37 36 #include <linux/mount.h> 38 37 #include <linux/fs_context.h> 38 + #include <linux/fs_parser.h> 39 39 #include "nilfs.h" 40 40 #include "export.h" 41 41 #include "mdt.h" ··· 61 61 struct kmem_cache *nilfs_btree_path_cache; 62 62 63 63 static int nilfs_setup_super(struct super_block *sb, int is_mount); 64 - static int nilfs_remount(struct super_block *sb, int *flags, char *data); 65 64 66 65 void __nilfs_msg(struct super_block *sb, const char *fmt, ...) 67 66 { ··· 701 702 .freeze_fs = nilfs_freeze, 702 703 .unfreeze_fs = nilfs_unfreeze, 703 704 .statfs = nilfs_statfs, 704 - .remount_fs = nilfs_remount, 705 705 .show_options = nilfs_show_options 706 706 }; 707 707 708 708 enum { 709 - Opt_err_cont, Opt_err_panic, Opt_err_ro, 710 - Opt_barrier, Opt_nobarrier, Opt_snapshot, Opt_order, Opt_norecovery, 711 - Opt_discard, Opt_nodiscard, Opt_err, 709 + Opt_err, Opt_barrier, Opt_snapshot, Opt_order, Opt_norecovery, 710 + Opt_discard, 712 711 }; 713 712 714 - static match_table_t tokens = { 715 - {Opt_err_cont, "errors=continue"}, 716 - {Opt_err_panic, "errors=panic"}, 717 - {Opt_err_ro, "errors=remount-ro"}, 718 - {Opt_barrier, "barrier"}, 719 - {Opt_nobarrier, "nobarrier"}, 720 - {Opt_snapshot, "cp=%u"}, 721 - {Opt_order, "order=%s"}, 722 - {Opt_norecovery, "norecovery"}, 723 - {Opt_discard, "discard"}, 724 - {Opt_nodiscard, "nodiscard"}, 725 - {Opt_err, NULL} 713 + static const struct constant_table nilfs_param_err[] = { 714 + {"continue", NILFS_MOUNT_ERRORS_CONT}, 715 + {"panic", NILFS_MOUNT_ERRORS_PANIC}, 716 + {"remount-ro", NILFS_MOUNT_ERRORS_RO}, 717 + {} 726 718 }; 727 719 728 - static int parse_options(char *options, struct super_block *sb, int is_remount) 720 + static const struct fs_parameter_spec nilfs_param_spec[] = { 721 + fsparam_enum ("errors", Opt_err, nilfs_param_err), 722 + fsparam_flag_no ("barrier", Opt_barrier), 723 + fsparam_u64 ("cp", Opt_snapshot), 724 + fsparam_string ("order", Opt_order), 725 + fsparam_flag ("norecovery", Opt_norecovery), 726 + fsparam_flag_no ("discard", Opt_discard), 727 + {} 728 + }; 729 + 730 + struct nilfs_fs_context { 731 + unsigned long ns_mount_opt; 732 + __u64 cno; 733 + }; 734 + 735 + static int nilfs_parse_param(struct fs_context *fc, struct fs_parameter *param) 729 736 { 730 - struct the_nilfs *nilfs = sb->s_fs_info; 731 - char *p; 732 - substring_t args[MAX_OPT_ARGS]; 737 + struct nilfs_fs_context *nilfs = fc->fs_private; 738 + int is_remount = fc->purpose == FS_CONTEXT_FOR_RECONFIGURE; 739 + struct fs_parse_result result; 740 + int opt; 733 741 734 - if (!options) 735 - return 1; 742 + opt = fs_parse(fc, nilfs_param_spec, param, &result); 743 + if (opt < 0) 744 + return opt; 736 745 737 - while ((p = strsep(&options, ",")) != NULL) { 738 - int token; 739 - 740 - if (!*p) 741 - continue; 742 - 743 - token = match_token(p, tokens, args); 744 - switch (token) { 745 - case Opt_barrier: 746 - nilfs_set_opt(nilfs, BARRIER); 747 - break; 748 - case Opt_nobarrier: 746 + switch (opt) { 747 + case Opt_barrier: 748 + if (result.negated) 749 749 nilfs_clear_opt(nilfs, BARRIER); 750 - break; 751 - case Opt_order: 752 - if (strcmp(args[0].from, "relaxed") == 0) 753 - /* Ordered data semantics */ 754 - nilfs_clear_opt(nilfs, STRICT_ORDER); 755 - else if (strcmp(args[0].from, "strict") == 0) 756 - /* Strict in-order semantics */ 757 - nilfs_set_opt(nilfs, STRICT_ORDER); 758 - else 759 - return 0; 760 - break; 761 - case Opt_err_panic: 762 - nilfs_write_opt(nilfs, ERROR_MODE, ERRORS_PANIC); 763 - break; 764 - case Opt_err_ro: 765 - nilfs_write_opt(nilfs, ERROR_MODE, ERRORS_RO); 766 - break; 767 - case Opt_err_cont: 768 - nilfs_write_opt(nilfs, ERROR_MODE, ERRORS_CONT); 769 - break; 770 - case Opt_snapshot: 771 - if (is_remount) { 772 - nilfs_err(sb, 773 - "\"%s\" option is invalid for remount", 774 - p); 775 - return 0; 776 - } 777 - break; 778 - case Opt_norecovery: 779 - nilfs_set_opt(nilfs, NORECOVERY); 780 - break; 781 - case Opt_discard: 782 - nilfs_set_opt(nilfs, DISCARD); 783 - break; 784 - case Opt_nodiscard: 785 - nilfs_clear_opt(nilfs, DISCARD); 786 - break; 787 - default: 788 - nilfs_err(sb, "unrecognized mount option \"%s\"", p); 789 - return 0; 750 + else 751 + nilfs_set_opt(nilfs, BARRIER); 752 + break; 753 + case Opt_order: 754 + if (strcmp(param->string, "relaxed") == 0) 755 + /* Ordered data semantics */ 756 + nilfs_clear_opt(nilfs, STRICT_ORDER); 757 + else if (strcmp(param->string, "strict") == 0) 758 + /* Strict in-order semantics */ 759 + nilfs_set_opt(nilfs, STRICT_ORDER); 760 + else 761 + return -EINVAL; 762 + break; 763 + case Opt_err: 764 + nilfs->ns_mount_opt &= ~NILFS_MOUNT_ERROR_MODE; 765 + nilfs->ns_mount_opt |= result.uint_32; 766 + break; 767 + case Opt_snapshot: 768 + if (is_remount) { 769 + struct super_block *sb = fc->root->d_sb; 770 + 771 + nilfs_err(sb, 772 + "\"%s\" option is invalid for remount", 773 + param->key); 774 + return -EINVAL; 790 775 } 776 + if (result.uint_64 == 0) { 777 + nilfs_err(NULL, 778 + "invalid option \"cp=0\": invalid checkpoint number 0"); 779 + return -EINVAL; 780 + } 781 + nilfs->cno = result.uint_64; 782 + break; 783 + case Opt_norecovery: 784 + nilfs_set_opt(nilfs, NORECOVERY); 785 + break; 786 + case Opt_discard: 787 + if (result.negated) 788 + nilfs_clear_opt(nilfs, DISCARD); 789 + else 790 + nilfs_set_opt(nilfs, DISCARD); 791 + break; 792 + default: 793 + return -EINVAL; 791 794 } 792 - return 1; 793 - } 794 795 795 - static inline void 796 - nilfs_set_default_options(struct super_block *sb, 797 - struct nilfs_super_block *sbp) 798 - { 799 - struct the_nilfs *nilfs = sb->s_fs_info; 800 - 801 - nilfs->ns_mount_opt = 802 - NILFS_MOUNT_ERRORS_RO | NILFS_MOUNT_BARRIER; 796 + return 0; 803 797 } 804 798 805 799 static int nilfs_setup_super(struct super_block *sb, int is_mount) ··· 849 857 return (struct nilfs_super_block *)((char *)(*pbh)->b_data + offset); 850 858 } 851 859 852 - int nilfs_store_magic_and_option(struct super_block *sb, 853 - struct nilfs_super_block *sbp, 854 - char *data) 860 + int nilfs_store_magic(struct super_block *sb, 861 + struct nilfs_super_block *sbp) 855 862 { 856 863 struct the_nilfs *nilfs = sb->s_fs_info; 857 864 ··· 861 870 sb->s_flags |= SB_NOATIME; 862 871 #endif 863 872 864 - nilfs_set_default_options(sb, sbp); 865 - 866 873 nilfs->ns_resuid = le16_to_cpu(sbp->s_def_resuid); 867 874 nilfs->ns_resgid = le16_to_cpu(sbp->s_def_resgid); 868 875 nilfs->ns_interval = le32_to_cpu(sbp->s_c_interval); 869 876 nilfs->ns_watermark = le32_to_cpu(sbp->s_c_block_max); 870 877 871 - return !parse_options(data, sb, 0) ? -EINVAL : 0; 878 + return 0; 872 879 } 873 880 874 881 int nilfs_check_feature_compatibility(struct super_block *sb, ··· 1024 1035 /** 1025 1036 * nilfs_fill_super() - initialize a super block instance 1026 1037 * @sb: super_block 1027 - * @data: mount options 1028 - * @silent: silent mode flag 1038 + * @fc: filesystem context 1029 1039 * 1030 1040 * This function is called exclusively by nilfs->ns_mount_mutex. 1031 1041 * So, the recovery process is protected from other simultaneous mounts. 1032 1042 */ 1033 1043 static int 1034 - nilfs_fill_super(struct super_block *sb, void *data, int silent) 1044 + nilfs_fill_super(struct super_block *sb, struct fs_context *fc) 1035 1045 { 1036 1046 struct the_nilfs *nilfs; 1037 1047 struct nilfs_root *fsroot; 1048 + struct nilfs_fs_context *ctx = fc->fs_private; 1038 1049 __u64 cno; 1039 1050 int err; 1040 1051 ··· 1044 1055 1045 1056 sb->s_fs_info = nilfs; 1046 1057 1047 - err = init_nilfs(nilfs, sb, (char *)data); 1058 + err = init_nilfs(nilfs, sb); 1048 1059 if (err) 1049 1060 goto failed_nilfs; 1061 + 1062 + /* Copy in parsed mount options */ 1063 + nilfs->ns_mount_opt = ctx->ns_mount_opt; 1050 1064 1051 1065 sb->s_op = &nilfs_sops; 1052 1066 sb->s_export_op = &nilfs_export_ops; ··· 1109 1117 return err; 1110 1118 } 1111 1119 1112 - static int nilfs_remount(struct super_block *sb, int *flags, char *data) 1120 + static int nilfs_reconfigure(struct fs_context *fc) 1113 1121 { 1122 + struct nilfs_fs_context *ctx = fc->fs_private; 1123 + struct super_block *sb = fc->root->d_sb; 1114 1124 struct the_nilfs *nilfs = sb->s_fs_info; 1115 - unsigned long old_sb_flags; 1116 - unsigned long old_mount_opt; 1117 1125 int err; 1118 1126 1119 1127 sync_filesystem(sb); 1120 - old_sb_flags = sb->s_flags; 1121 - old_mount_opt = nilfs->ns_mount_opt; 1122 - 1123 - if (!parse_options(data, sb, 1)) { 1124 - err = -EINVAL; 1125 - goto restore_opts; 1126 - } 1127 - sb->s_flags = (sb->s_flags & ~SB_POSIXACL); 1128 1128 1129 1129 err = -EINVAL; 1130 1130 1131 1131 if (!nilfs_valid_fs(nilfs)) { 1132 1132 nilfs_warn(sb, 1133 1133 "couldn't remount because the filesystem is in an incomplete recovery state"); 1134 - goto restore_opts; 1134 + goto ignore_opts; 1135 1135 } 1136 - 1137 - if ((bool)(*flags & SB_RDONLY) == sb_rdonly(sb)) 1136 + if ((bool)(fc->sb_flags & SB_RDONLY) == sb_rdonly(sb)) 1138 1137 goto out; 1139 - if (*flags & SB_RDONLY) { 1138 + if (fc->sb_flags & SB_RDONLY) { 1140 1139 sb->s_flags |= SB_RDONLY; 1141 1140 1142 1141 /* ··· 1155 1172 "couldn't remount RDWR because of unsupported optional features (%llx)", 1156 1173 (unsigned long long)features); 1157 1174 err = -EROFS; 1158 - goto restore_opts; 1175 + goto ignore_opts; 1159 1176 } 1160 1177 1161 1178 sb->s_flags &= ~SB_RDONLY; 1162 1179 1163 1180 root = NILFS_I(d_inode(sb->s_root))->i_root; 1164 1181 err = nilfs_attach_log_writer(sb, root); 1165 - if (err) 1166 - goto restore_opts; 1182 + if (err) { 1183 + sb->s_flags |= SB_RDONLY; 1184 + goto ignore_opts; 1185 + } 1167 1186 1168 1187 down_write(&nilfs->ns_sem); 1169 1188 nilfs_setup_super(sb, true); 1170 1189 up_write(&nilfs->ns_sem); 1171 1190 } 1172 1191 out: 1192 + sb->s_flags = (sb->s_flags & ~SB_POSIXACL); 1193 + /* Copy over parsed remount options */ 1194 + nilfs->ns_mount_opt = ctx->ns_mount_opt; 1195 + 1173 1196 return 0; 1174 1197 1175 - restore_opts: 1176 - sb->s_flags = old_sb_flags; 1177 - nilfs->ns_mount_opt = old_mount_opt; 1198 + ignore_opts: 1178 1199 return err; 1179 1200 } 1180 1201 1181 - struct nilfs_super_data { 1182 - __u64 cno; 1183 - int flags; 1184 - }; 1185 - 1186 - static int nilfs_parse_snapshot_option(const char *option, 1187 - const substring_t *arg, 1188 - struct nilfs_super_data *sd) 1202 + static int 1203 + nilfs_get_tree(struct fs_context *fc) 1189 1204 { 1190 - unsigned long long val; 1191 - const char *msg = NULL; 1192 - int err; 1193 - 1194 - if (!(sd->flags & SB_RDONLY)) { 1195 - msg = "read-only option is not specified"; 1196 - goto parse_error; 1197 - } 1198 - 1199 - err = kstrtoull(arg->from, 0, &val); 1200 - if (err) { 1201 - if (err == -ERANGE) 1202 - msg = "too large checkpoint number"; 1203 - else 1204 - msg = "malformed argument"; 1205 - goto parse_error; 1206 - } else if (val == 0) { 1207 - msg = "invalid checkpoint number 0"; 1208 - goto parse_error; 1209 - } 1210 - sd->cno = val; 1211 - return 0; 1212 - 1213 - parse_error: 1214 - nilfs_err(NULL, "invalid option \"%s\": %s", option, msg); 1215 - return 1; 1216 - } 1217 - 1218 - /** 1219 - * nilfs_identify - pre-read mount options needed to identify mount instance 1220 - * @data: mount options 1221 - * @sd: nilfs_super_data 1222 - */ 1223 - static int nilfs_identify(char *data, struct nilfs_super_data *sd) 1224 - { 1225 - char *p, *options = data; 1226 - substring_t args[MAX_OPT_ARGS]; 1227 - int token; 1228 - int ret = 0; 1229 - 1230 - do { 1231 - p = strsep(&options, ","); 1232 - if (p != NULL && *p) { 1233 - token = match_token(p, tokens, args); 1234 - if (token == Opt_snapshot) 1235 - ret = nilfs_parse_snapshot_option(p, &args[0], 1236 - sd); 1237 - } 1238 - if (!options) 1239 - break; 1240 - BUG_ON(options == data); 1241 - *(options - 1) = ','; 1242 - } while (!ret); 1243 - return ret; 1244 - } 1245 - 1246 - static int nilfs_set_bdev_super(struct super_block *s, void *data) 1247 - { 1248 - s->s_dev = *(dev_t *)data; 1249 - return 0; 1250 - } 1251 - 1252 - static int nilfs_test_bdev_super(struct super_block *s, void *data) 1253 - { 1254 - return !(s->s_iflags & SB_I_RETIRED) && s->s_dev == *(dev_t *)data; 1255 - } 1256 - 1257 - static struct dentry * 1258 - nilfs_mount(struct file_system_type *fs_type, int flags, 1259 - const char *dev_name, void *data) 1260 - { 1261 - struct nilfs_super_data sd = { .flags = flags }; 1205 + struct nilfs_fs_context *ctx = fc->fs_private; 1262 1206 struct super_block *s; 1263 1207 dev_t dev; 1264 1208 int err; 1265 1209 1266 - if (nilfs_identify(data, &sd)) 1267 - return ERR_PTR(-EINVAL); 1210 + if (ctx->cno && !(fc->sb_flags & SB_RDONLY)) { 1211 + nilfs_err(NULL, 1212 + "invalid option \"cp=%llu\": read-only option is not specified", 1213 + ctx->cno); 1214 + return -EINVAL; 1215 + } 1268 1216 1269 - err = lookup_bdev(dev_name, &dev); 1217 + err = lookup_bdev(fc->source, &dev); 1270 1218 if (err) 1271 - return ERR_PTR(err); 1219 + return err; 1272 1220 1273 - s = sget(fs_type, nilfs_test_bdev_super, nilfs_set_bdev_super, flags, 1274 - &dev); 1221 + s = sget_dev(fc, dev); 1275 1222 if (IS_ERR(s)) 1276 - return ERR_CAST(s); 1223 + return PTR_ERR(s); 1277 1224 1278 1225 if (!s->s_root) { 1279 - err = setup_bdev_super(s, flags, NULL); 1226 + err = setup_bdev_super(s, fc->sb_flags, fc); 1280 1227 if (!err) 1281 - err = nilfs_fill_super(s, data, 1282 - flags & SB_SILENT ? 1 : 0); 1228 + err = nilfs_fill_super(s, fc); 1283 1229 if (err) 1284 1230 goto failed_super; 1285 1231 1286 1232 s->s_flags |= SB_ACTIVE; 1287 - } else if (!sd.cno) { 1233 + } else if (!ctx->cno) { 1288 1234 if (nilfs_tree_is_busy(s->s_root)) { 1289 - if ((flags ^ s->s_flags) & SB_RDONLY) { 1235 + if ((fc->sb_flags ^ s->s_flags) & SB_RDONLY) { 1290 1236 nilfs_err(s, 1291 1237 "the device already has a %s mount.", 1292 1238 sb_rdonly(s) ? "read-only" : "read/write"); ··· 1224 1312 } 1225 1313 } else { 1226 1314 /* 1227 - * Try remount to setup mount states if the current 1315 + * Try reconfigure to setup mount states if the current 1228 1316 * tree is not mounted and only snapshots use this sb. 1317 + * 1318 + * Since nilfs_reconfigure() requires fc->root to be 1319 + * set, set it first and release it on failure. 1229 1320 */ 1230 - err = nilfs_remount(s, &flags, data); 1231 - if (err) 1321 + fc->root = dget(s->s_root); 1322 + err = nilfs_reconfigure(fc); 1323 + if (err) { 1324 + dput(fc->root); 1325 + fc->root = NULL; /* prevent double release */ 1232 1326 goto failed_super; 1327 + } 1328 + return 0; 1233 1329 } 1234 1330 } 1235 1331 1236 - if (sd.cno) { 1332 + if (ctx->cno) { 1237 1333 struct dentry *root_dentry; 1238 1334 1239 - err = nilfs_attach_snapshot(s, sd.cno, &root_dentry); 1335 + err = nilfs_attach_snapshot(s, ctx->cno, &root_dentry); 1240 1336 if (err) 1241 1337 goto failed_super; 1242 - return root_dentry; 1338 + fc->root = root_dentry; 1339 + return 0; 1243 1340 } 1244 1341 1245 - return dget(s->s_root); 1342 + fc->root = dget(s->s_root); 1343 + return 0; 1246 1344 1247 1345 failed_super: 1248 1346 deactivate_locked_super(s); 1249 - return ERR_PTR(err); 1347 + return err; 1348 + } 1349 + 1350 + static void nilfs_free_fc(struct fs_context *fc) 1351 + { 1352 + kfree(fc->fs_private); 1353 + } 1354 + 1355 + static const struct fs_context_operations nilfs_context_ops = { 1356 + .parse_param = nilfs_parse_param, 1357 + .get_tree = nilfs_get_tree, 1358 + .reconfigure = nilfs_reconfigure, 1359 + .free = nilfs_free_fc, 1360 + }; 1361 + 1362 + static int nilfs_init_fs_context(struct fs_context *fc) 1363 + { 1364 + struct nilfs_fs_context *ctx; 1365 + 1366 + ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); 1367 + if (!ctx) 1368 + return -ENOMEM; 1369 + 1370 + ctx->ns_mount_opt = NILFS_MOUNT_ERRORS_RO | NILFS_MOUNT_BARRIER; 1371 + fc->fs_private = ctx; 1372 + fc->ops = &nilfs_context_ops; 1373 + 1374 + return 0; 1250 1375 } 1251 1376 1252 1377 struct file_system_type nilfs_fs_type = { 1253 1378 .owner = THIS_MODULE, 1254 1379 .name = "nilfs2", 1255 - .mount = nilfs_mount, 1256 1380 .kill_sb = kill_block_super, 1257 1381 .fs_flags = FS_REQUIRES_DEV, 1382 + .init_fs_context = nilfs_init_fs_context, 1383 + .parameters = nilfs_param_spec, 1258 1384 }; 1259 1385 MODULE_ALIAS_FS("nilfs2"); 1260 1386
+2 -3
fs/nilfs2/the_nilfs.c
··· 659 659 * init_nilfs - initialize a NILFS instance. 660 660 * @nilfs: the_nilfs structure 661 661 * @sb: super block 662 - * @data: mount options 663 662 * 664 663 * init_nilfs() performs common initialization per block device (e.g. 665 664 * reading the super block, getting disk layout information, initializing ··· 667 668 * Return Value: On success, 0 is returned. On error, a negative error 668 669 * code is returned. 669 670 */ 670 - int init_nilfs(struct the_nilfs *nilfs, struct super_block *sb, char *data) 671 + int init_nilfs(struct the_nilfs *nilfs, struct super_block *sb) 671 672 { 672 673 struct nilfs_super_block *sbp; 673 674 int blocksize; ··· 685 686 if (err) 686 687 goto out; 687 688 688 - err = nilfs_store_magic_and_option(sb, sbp, data); 689 + err = nilfs_store_magic(sb, sbp); 689 690 if (err) 690 691 goto failed_sbh; 691 692
+1 -5
fs/nilfs2/the_nilfs.h
··· 219 219 #define nilfs_set_opt(nilfs, opt) \ 220 220 ((nilfs)->ns_mount_opt |= NILFS_MOUNT_##opt) 221 221 #define nilfs_test_opt(nilfs, opt) ((nilfs)->ns_mount_opt & NILFS_MOUNT_##opt) 222 - #define nilfs_write_opt(nilfs, mask, opt) \ 223 - ((nilfs)->ns_mount_opt = \ 224 - (((nilfs)->ns_mount_opt & ~NILFS_MOUNT_##mask) | \ 225 - NILFS_MOUNT_##opt)) \ 226 222 227 223 /** 228 224 * struct nilfs_root - nilfs root object ··· 272 276 void nilfs_set_last_segment(struct the_nilfs *, sector_t, u64, __u64); 273 277 struct the_nilfs *alloc_nilfs(struct super_block *sb); 274 278 void destroy_nilfs(struct the_nilfs *nilfs); 275 - int init_nilfs(struct the_nilfs *nilfs, struct super_block *sb, char *data); 279 + int init_nilfs(struct the_nilfs *nilfs, struct super_block *sb); 276 280 int load_nilfs(struct the_nilfs *nilfs, struct super_block *sb); 277 281 unsigned long nilfs_nrsvsegs(struct the_nilfs *nilfs, unsigned long nsegs); 278 282 void nilfs_set_nsegments(struct the_nilfs *nilfs, unsigned long nsegs);