Lines Matching defs:vol
238 static int change_serial(ntfs_volume *vol, u64 sector, le64 serial_number,
246 if ((ntfs_pread(vol->dev, sector << vol->sector_size_bits,
247 vol->sector_size, bs) == vol->sector_size)) {
251 memcpy(oldbs, bs, vol->sector_size);
254 same = !memcmp(oldbs, bs, vol->sector_size);
265 || (ntfs_pwrite(vol->dev,
266 sector << vol->sector_size_bits,
267 vol->sector_size, bs) == vol->sector_size)) {
279 static int set_new_serial(ntfs_volume *vol)
289 bs = (NTFS_BOOT_SECTOR*)ntfs_malloc(vol->sector_size);
290 oldbs = (NTFS_BOOT_SECTOR*)ntfs_malloc(vol->sector_size);
301 if (!change_serial(vol, 0, serial_number, bs, oldbs)) {
302 number_of_sectors = ntfs_device_size_get(vol->dev,
303 vol->sector_size);
304 if (!change_serial(vol, number_of_sectors - 1,
320 static int print_serial(ntfs_volume *vol)
326 bs = (NTFS_BOOT_SECTOR*)ntfs_malloc(vol->sector_size);
328 && (ntfs_pread(vol->dev, 0,
329 vol->sector_size, bs) == vol->sector_size)) {
348 static int print_label(ntfs_volume *vol, unsigned long mnt_flags)
360 ntfs_log_info("Volume label : %s\n", vol->vol_name);
362 ntfs_log_info("%s\n", vol->vol_name);
375 static int change_label(ntfs_volume *vol, char *label)
397 result = ntfs_volume_rename(vol, new_label, label_len) ? 1 : 0;
415 ntfs_volume *vol;
439 vol = utils_mount_volume(opts.device,
442 if (!vol)
446 result = set_new_serial(vol);
451 result = print_serial(vol);
454 result = change_label(vol, opts.label);
456 result = print_label(vol, mnt_flags);
459 ntfs_umount(vol, FALSE);