Lines Matching refs:size
157 /* Page size on ia32. Can change to 8192 on Alpha. */
225 long long num_sectors; /* size of device in sectors */
226 long cluster_size; /* -c, format with this cluster-size */
256 " -c, --cluster-size BYTES Specify the cluster size for the volume\n"
257 " -s, --sector-size BYTES Specify the sector size for the device\n"
307 static uint64_t crc64(uint64_t crc, const byte * data, size_t size)
331 while (size) {
333 size--;
598 { "cluster-size", required_argument, NULL, 'c' },
613 { "sector-size", required_argument, NULL, 's' },
650 if (!mkntfs_parse_long(optarg, "cluster size",
697 if (!mkntfs_parse_long(optarg, "sector size",
988 * @size: byte size to make available at this position
1000 static int make_room_for_attribute(MFT_RECORD *m, char *pos, const u32 size)
1004 if (!size)
1011 if (size != ((size + 7) & ~7)) {
1013 "size.\n");
1018 if (pos < (char*)m || pos + size < (char*)m ||
1020 pos + size > (char*)m + le32_to_cpu(m->bytes_allocated))
1028 if (biu + size > le32_to_cpu(m->bytes_allocated))
1030 /* Move everything after pos to pos + size. */
1031 memmove(pos + size, pos, biu - (pos - (char*)m));
1033 m->bytes_in_use = cpu_to_le32(biu + size);
1067 * TODO: We should be returning the size as well, but for mkntfs this is not
1477 /* val accordingly and save the compressed size. */
1500 ntfs_log_error("Failed to get size for mapping "
1513 /* Does the value fit inside the allocated size? */
1515 ntfs_log_error("BUG: Allocated size is smaller than data size!\n");
1560 /* FIXME: Allocated size depends on compression. */
1574 /* FIXME: Set the compressed size. */
1668 /* val accordingly and save the compressed size. */
1702 ntfs_log_error("Failed to get size for mapping "
1755 /* FIXME: Allocated size depends on compression. */
1770 /* FIXME: Set the compressed size. */
1941 /* NTFS 1.2: size of si = 48, NTFS 3.[01]: size of si = 72 */
2154 * FIXME: Introduced arbitrary limit of mft record allocated size - 512.
2293 ntfs_log_error("add_attr_index_root: index block size is not "
2294 "a multiple of the cluster size.\n");
2302 ntfs_log_error("add_attr_index_root: index block size is not "
2308 ntfs_log_error("add_attr_index_root: index block size "
2309 "is smaller than the sector size.\n");
2474 /* Bitmap has to be at least 8 bytes in size. */
2491 ntfs_log_error("Sector size is bigger than index block size. "
2573 * Create space of @size bytes at position @pos inside the index block @idx.
2578 INDEX_ENTRY *pos, u32 size)
2582 if (!size)
2589 if (size != ((size + 7) & ~7)) {
2591 "non 8-byte aligned size.\n");
2596 if ((char*)pos < (char*)idx || (char*)pos + size < (char*)idx ||
2600 (char*)pos + size > (char*)idx + sizeof(INDEX_BLOCK) -
2612 if (biu + size > le32_to_cpu(idx->index.allocated_size))
2614 /* Move everything after pos to pos + size. */
2615 memmove((char*)pos + size, (char*)pos, biu - ((char*)pos -
2618 idx->index.index_length = cpu_to_le32(biu + size);
3294 /* allocated size depends on unnamed data being resident */
3382 * First determine the size of the index entry to be inserted. This
3548 * mkntfs_get_page_size - detect the system's memory page size.
3558 ntfs_log_warning("Failed to determine system page size. "
3562 ntfs_log_debug("System page size is %li bytes.\n", page_size);
3576 /* If user didn't specify the sector size, determine it now. */
3580 ntfs_log_warning("The sector size was not specified "
3587 /* Validate sector size. */
3589 ntfs_log_error("The sector size is invalid. It must be a "
3594 ntfs_log_error("The sector size is invalid. The minimum size "
3598 ntfs_log_debug("sector size = %ld bytes\n", opts.sector_size);
3599 /* Now set the device block size to the sector size. */
3601 ntfs_log_debug("Failed to set the device block size to the "
3602 "sector size. This may cause problems when "
3611 ntfs_log_error("Couldn't determine the size of %s. "
3621 * sector size is less than 512 bytes in which case reserve 512 bytes
3701 /* Validate volume size. */
3704 "volume size is 1MiB.\n",
3708 ntfs_log_debug("volume size = %llikiB\n",
3710 /* If user didn't specify the cluster size, determine it now. */
3714 * size regardless of the volume size so we do it, too.
3721 * For huge volumes, grow the cluster size until the number of
3722 * clusters fits into 32 bits or the cluster size exceeds the
3729 "NTFS volume (maximum size is "
3734 ntfs_log_quiet("Cluster size has been automatically set to %u "
3737 /* Validate cluster size. */
3739 ntfs_log_error("The cluster size is invalid. It must be a "
3744 ntfs_log_error("The cluster size is invalid. It must be equal "
3745 "to, or larger than, the sector size.\n");
3750 ntfs_log_error("The cluster size is invalid. It cannot be "
3751 "more that 4096 times the size of the sector "
3752 "size.\n");
3756 ntfs_log_error("The cluster size is invalid. The maximum "
3757 "cluster size is %lu bytes (%lukiB).\n",
3763 ntfs_log_debug("cluster size = %u bytes\n",
3769 "when the cluster size is "
3776 "cluster size is larger than 4096 bytes. "
3793 "size and/or cluster/sector number.\n");
3803 "volume (maximum size is 256TiB).\n");
3807 "try again with a larger\ncluster size or "
3808 "leave the cluster size unspecified and the "
3809 "smallest possible cluster size for the size "
3815 * Set the mft record size. By default this is 1024 but it has to be
3818 * TODO: The mft record size should be user specifiable just like the
3819 * "inode size" can be specified on other Linux/Unix file systems.
3825 ntfs_log_warning("Mft record size (%u bytes) exceeds system "
3826 "page size (%li bytes). You will not be able "
3831 ntfs_log_debug("mft record size = %u bytes\n",
3834 * Set the index record size. By default this is 4096 but it has to be
3837 * FIXME: Should we make the index record size to be user specifiable?
3843 ntfs_log_warning("Index record size (%u bytes) exceeds system "
3844 "page size (%li bytes). You will not be able "
3849 ntfs_log_debug("index record size = %u bytes\n",
3870 /* Determine lcn bitmap byte size and allocate it. */
3890 * Mft size is 27 (NTFS 3.0+) mft records or one cluster, whichever is
3897 ntfs_log_debug("MFT size = %i (0x%x) bytes\n", g_mft_size, g_mft_size);
3898 /* Determine mft bitmap size and allocate it. */
3919 * Size is always one cluster, even though valid data size and
3920 * initialized data size are only 8 bytes.
3950 /* Determine MFT zone size. */
3952 switch (opts.mft_zone_multiplier) { /* % of volume size in clusters */
3967 ntfs_log_debug("MFT zone size = %lldkiB\n", g_mft_zone_end <<
3981 /* rounded up division by cluster size */
4003 * in size, which ever is bigger. In either case, it contains a
4051 * FIXME: The $LogFile size is 64 MiB upwards from 12GiB but
4053 * some other value as the volume size decreases. For example:
4054 * Volume size LogFile size Ratio
4071 * the standard size. It's ok as we are creating a non-standard
4079 ntfs_log_debug("$LogFile (journal) size = %ikiB\n",
4086 ntfs_log_error("$LogFile would be created with invalid size. "
4339 int size, e;
4347 size = 512;
4348 if (size < opts.sector_size)
4349 size = opts.sector_size;
4351 opts.sector_size - size, SEEK_SET) == (off_t)-1) {
4355 if (size > 8192)
4356 size = 8192;
4357 bw = mkntfs_write(g_vol->dev, buff, size);
4358 if (bw == size)
4737 * odd and we failed to set the device block size to the sector
4738 * size, hence we schedule chkdsk to create it.
4762 /* Create a sparse named stream of size equal to the volume size. */
5027 * Decide on the sector size, cluster size, mft record and index record
5028 * sizes as well as the number of sectors/tracks/heads/size, etc.