u_int64_t device_size;
u_int64_t total_sectors;
u_int64_t wanted_total_sectors;
+ u_int64_t wanted_sector_size;
u_int64_t target_sectors;
u_int32_t sectors_per_blk;
u_int32_t blks_per_seg;
c.blks_per_seg = DEFAULT_BLOCKS_PER_SEGMENT;
c.rootdev_name = get_rootdev();
c.wanted_total_sectors = -1;
+ c.wanted_sector_size = -1;
c.zoned_mode = 0;
c.zoned_model = 0;
c.zone_blocks = 0;
dev->zone_blocks);
}
#endif
+ /* adjust wanted_total_sectors */
+ if (c.wanted_total_sectors != -1) {
+ MSG(0, "Info: wanted sectors = %"PRIu64" (in %"PRIu64" bytes)\n",
+ c.wanted_total_sectors, c.wanted_sector_size);
+ if (c.wanted_sector_size == -1) {
+ c.wanted_sector_size = dev->sector_size;
+ } else if (dev->sector_size != c.wanted_sector_size) {
+ c.wanted_total_sectors *= c.wanted_sector_size;
+ c.wanted_total_sectors /= dev->sector_size;
+ }
+ }
+
c.total_sectors += dev->total_sectors;
return 0;
}
.I nodiscard/discard
]
[
+.B \-w
+.I specific sector_size for target sectors
+]
+[
.B \-z
.I #-of-sections-per-zone
]
If the value is equal to 1, discard policy is enabled, otherwise is disable.
The default value is 1.
.TP
+.BI \-w "sector-size"
+Specify the sector size in bytes along with given target sectors.
+Without it, the sectors will be calculated by device sector size.
+.TP
.BI \-z " #-of-sections-per-zone"
Specify the number of sections per zone. A zone consists of multiple sections.
F2FS allocates segments for active logs with separated zones as much as possible.
MSG(0, " -s # of segments per section [default:1]\n");
MSG(0, " -S sparse mode\n");
MSG(0, " -t 0: nodiscard, 1: discard [default:1]\n");
+ MSG(0, " -w wanted sector size\n");
MSG(0, " -z # of sections per zone [default:1]\n");
MSG(0, "sectors: number of sectors. [default: determined by device size]\n");
exit(1);
static void f2fs_parse_options(int argc, char *argv[])
{
- static const char *option_string = "qa:c:d:e:l:mo:O:s:S:z:t:f";
+ static const char *option_string = "qa:c:d:e:l:mo:O:s:S:z:t:fw:";
int32_t option=0;
while ((option = getopt(argc,argv,option_string)) != EOF) {
case 'f':
force_overwrite = 1;
break;
+ case 'w':
+ c.wanted_sector_size = atoi(optarg);
+ break;
default:
MSG(0, "\tError: Unknown option %c\n",option);
mkfs_usage();