newfs_udf(8): Nix trailing whitespace.
No functional change intended.
This commit is contained in:
parent
95e0535276
commit
60df76e82b
|
@ -1,9 +1,9 @@
|
||||||
/* $NetBSD: newfs_udf.c,v 1.23 2022/04/06 13:29:15 reinoud Exp $ */
|
/* $NetBSD: newfs_udf.c,v 1.24 2022/04/09 09:58:11 riastradh Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006, 2008, 2013, 2021, 2022 Reinoud Zandijk
|
* Copyright (c) 2006, 2008, 2013, 2021, 2022 Reinoud Zandijk
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -321,4 +321,3 @@ main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/* $NetBSD: newfs_udf.h,v 1.8 2022/04/06 13:29:15 reinoud Exp $ */
|
/* $NetBSD: newfs_udf.h,v 1.9 2022/04/09 09:58:11 riastradh Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
|
* Copyright (c) 2006, 2008, 2013 Reinoud Zandijk
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _FS_UDF_NEWFS_UDF_H_
|
#ifndef _FS_UDF_NEWFS_UDF_H_
|
||||||
|
@ -33,4 +33,3 @@
|
||||||
#define UDF_512_TRACK 0 /* NOT recommended */
|
#define UDF_512_TRACK 0 /* NOT recommended */
|
||||||
|
|
||||||
#endif /* _FS_UDF_NEWFS_UDF_H_ */
|
#endif /* _FS_UDF_NEWFS_UDF_H_ */
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/* $NetBSD: udf_core.c,v 1.1 2022/04/06 13:29:15 reinoud Exp $ */
|
/* $NetBSD: udf_core.c,v 1.2 2022/04/09 09:58:11 riastradh Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006, 2008, 2021, 2022 Reinoud Zandijk
|
* Copyright (c) 2006, 2008, 2021, 2022 Reinoud Zandijk
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
@ -23,14 +23,14 @@
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#if HAVE_NBTOOL_CONFIG_H
|
#if HAVE_NBTOOL_CONFIG_H
|
||||||
#include "nbtool_config.h"
|
#include "nbtool_config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__RCSID("$NetBSD: udf_core.c,v 1.1 2022/04/06 13:29:15 reinoud Exp $");
|
__RCSID("$NetBSD: udf_core.c,v 1.2 2022/04/09 09:58:11 riastradh Exp $");
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -818,7 +818,7 @@ udf_add_app_regid(struct regid *regid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Timestamp to timespec conversion code is taken with small modifications
|
* Timestamp to timespec conversion code is taken with small modifications
|
||||||
* from FreeBSD /sys/fs/udf by Scott Long <scottl@freebsd.org>
|
* from FreeBSD /sys/fs/udf by Scott Long <scottl@freebsd.org>
|
||||||
*/
|
*/
|
||||||
|
@ -831,13 +831,13 @@ static int mon_lens[2][12] = {
|
||||||
|
|
||||||
static int
|
static int
|
||||||
udf_isaleapyear(int year)
|
udf_isaleapyear(int year)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
i = (year % 4) ? 0 : 1;
|
i = (year % 4) ? 0 : 1;
|
||||||
i &= (year % 100) ? 1 : 0;
|
i &= (year % 100) ? 1 : 0;
|
||||||
i |= (year % 400) ? 0 : 1;
|
i |= (year % 400) ? 0 : 1;
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -861,21 +861,21 @@ udf_timestamp_to_timespec(struct timestamp *timestamp, struct timespec *timespec
|
||||||
if ((year < 1970) || (timestamp->month > 12)) {
|
if ((year < 1970) || (timestamp->month > 12)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate the time and day */
|
/* Calculate the time and day */
|
||||||
usecs = timestamp->usec + 100*timestamp->hund_usec + 10000*timestamp->centisec;
|
usecs = timestamp->usec + 100*timestamp->hund_usec + 10000*timestamp->centisec;
|
||||||
nsecs = usecs * 1000;
|
nsecs = usecs * 1000;
|
||||||
secs = timestamp->second;
|
secs = timestamp->second;
|
||||||
secs += timestamp->minute * 60;
|
secs += timestamp->minute * 60;
|
||||||
secs += timestamp->hour * 3600;
|
secs += timestamp->hour * 3600;
|
||||||
secs += (timestamp->day-1) * 3600 * 24; /* day : 1-31 */
|
secs += (timestamp->day-1) * 3600 * 24; /* day : 1-31 */
|
||||||
|
|
||||||
/* Calclulate the month */
|
/* Calclulate the month */
|
||||||
lpyear = udf_isaleapyear(year);
|
lpyear = udf_isaleapyear(year);
|
||||||
for (i = 1; i < timestamp->month; i++)
|
for (i = 1; i < timestamp->month; i++)
|
||||||
secs += mon_lens[lpyear][i-1] * 3600 * 24; /* month: 1-12 */
|
secs += mon_lens[lpyear][i-1] * 3600 * 24; /* month: 1-12 */
|
||||||
|
|
||||||
for (i = 1970; i < year; i++) {
|
for (i = 1970; i < year; i++) {
|
||||||
daysinyear = udf_isaleapyear(i) + 365 ;
|
daysinyear = udf_isaleapyear(i) + 365 ;
|
||||||
secs += daysinyear * 3600 * 24;
|
secs += daysinyear * 3600 * 24;
|
||||||
}
|
}
|
||||||
|
@ -966,7 +966,7 @@ static uint32_t
|
||||||
unix_mode_to_udf_perm(mode_t mode)
|
unix_mode_to_udf_perm(mode_t mode)
|
||||||
{
|
{
|
||||||
uint32_t perm;
|
uint32_t perm;
|
||||||
|
|
||||||
perm = ((mode & S_IRWXO) );
|
perm = ((mode & S_IRWXO) );
|
||||||
perm |= ((mode & S_IRWXG) << 2);
|
perm |= ((mode & S_IRWXG) << 2);
|
||||||
perm |= ((mode & S_IRWXU) << 4);
|
perm |= ((mode & S_IRWXU) << 4);
|
||||||
|
@ -1219,7 +1219,7 @@ udf_create_base_logical_dscr(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
udf_add_logvol_part_physical(uint16_t phys_part)
|
udf_add_logvol_part_physical(uint16_t phys_part)
|
||||||
{
|
{
|
||||||
struct logvol_desc *logvol = context.logical_vol;
|
struct logvol_desc *logvol = context.logical_vol;
|
||||||
|
@ -1666,7 +1666,7 @@ udf_create_space_bitmap(uint32_t dscr_size, uint32_t part_size_lba,
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
|
||||||
int
|
int
|
||||||
udf_register_bad_block(uint32_t location)
|
udf_register_bad_block(uint32_t location)
|
||||||
{
|
{
|
||||||
struct udf_sparing_table *spt;
|
struct udf_sparing_table *spt;
|
||||||
|
@ -2810,12 +2810,12 @@ udf_vat_update(uint32_t virt, uint32_t phys)
|
||||||
|
|
||||||
if (context.vtop_tp[context.metadata_part] != UDF_VTOP_TYPE_VIRT)
|
if (context.vtop_tp[context.metadata_part] != UDF_VTOP_TYPE_VIRT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
new_size = MAX(context.vat_size,
|
new_size = MAX(context.vat_size,
|
||||||
(context.vat_start + (virt+1)*sizeof(uint32_t)));
|
(context.vat_start + (virt+1)*sizeof(uint32_t)));
|
||||||
|
|
||||||
if (new_size > context.vat_allocated) {
|
if (new_size > context.vat_allocated) {
|
||||||
context.vat_allocated =
|
context.vat_allocated =
|
||||||
UDF_ROUNDUP(new_size, context.sector_size);
|
UDF_ROUNDUP(new_size, context.sector_size);
|
||||||
context.vat_contents = realloc(context.vat_contents,
|
context.vat_contents = realloc(context.vat_contents,
|
||||||
context.vat_allocated);
|
context.vat_allocated);
|
||||||
|
@ -3015,7 +3015,7 @@ udf_create_VAT(union dscrptr **vat_dscr, struct long_ad *vatdata_loc)
|
||||||
*vat_dscr = (union dscrptr *) fe;
|
*vat_dscr = (union dscrptr *) fe;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3197,7 +3197,7 @@ udf_update_discinfo(void)
|
||||||
emul_mmc_profile = 0x01;
|
emul_mmc_profile = 0x01;
|
||||||
if (emul_mmc_profile != 0x01) {
|
if (emul_mmc_profile != 0x01) {
|
||||||
warnx("format incompatible with disc partition");
|
warnx("format incompatible with disc partition");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get our disc info */
|
/* get our disc info */
|
||||||
|
@ -4766,7 +4766,7 @@ udf_do_newfs_prefix(void)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
udf_create_terminator(terminator_dscr, 0);
|
udf_create_terminator(terminator_dscr, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create the two Volume Descriptor Sets (VDS) each containing the
|
* Create the two Volume Descriptor Sets (VDS) each containing the
|
||||||
* following descriptors : primary volume, partition space,
|
* following descriptors : primary volume, partition space,
|
||||||
* unallocated space, logical volume, implementation use and the
|
* unallocated space, logical volume, implementation use and the
|
||||||
|
@ -4808,7 +4808,7 @@ udf_do_newfs_prefix(void)
|
||||||
* Write out what we've created so far.
|
* Write out what we've created so far.
|
||||||
*
|
*
|
||||||
* Start with wipeout of VRS1 upto start of partition. This allows
|
* Start with wipeout of VRS1 upto start of partition. This allows
|
||||||
* formatting for sequentials with the track reservation and it
|
* formatting for sequentials with the track reservation and it
|
||||||
* cleans old rubbish on rewritables. For sequentials without the
|
* cleans old rubbish on rewritables. For sequentials without the
|
||||||
* track reservation all is wiped from track start.
|
* track reservation all is wiped from track start.
|
||||||
*/
|
*/
|
||||||
|
@ -4949,7 +4949,7 @@ udf_do_newfs_prefix(void)
|
||||||
&context.part_unalloc_bits[metadata_part]);
|
&context.part_unalloc_bits[metadata_part]);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
udf_mark_allocated(layout.meta_bitmap, data_part, 1);
|
udf_mark_allocated(layout.meta_bitmap, data_part, 1);
|
||||||
/* mark space allocated for the unallocated space bitmap */
|
/* mark space allocated for the unallocated space bitmap */
|
||||||
udf_mark_allocated(layout.meta_bitmap_space,
|
udf_mark_allocated(layout.meta_bitmap_space,
|
||||||
|
@ -5068,7 +5068,7 @@ udf_do_newfs_postfix(void)
|
||||||
error = udf_write_dscr_virt(dscr, loc, data_part, 1);
|
error = udf_write_dscr_virt(dscr, loc, data_part, 1);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
loc = layout.meta_mirror;
|
loc = layout.meta_mirror;
|
||||||
dscr = (union dscrptr *) context.meta_mirror;
|
dscr = (union dscrptr *) context.meta_mirror;
|
||||||
error = udf_write_dscr_virt(dscr, loc, data_part, 1);
|
error = udf_write_dscr_virt(dscr, loc, data_part, 1);
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/* $NetBSD: udf_core.h,v 1.1 2022/04/06 13:29:15 reinoud Exp $ */
|
/* $NetBSD: udf_core.h,v 1.2 2022/04/09 09:58:11 riastradh Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2006, 2008, 2021, 2022 Reinoud Zandijk
|
* Copyright (c) 2006, 2008, 2021, 2022 Reinoud Zandijk
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _FS_UDF_CORE_H_
|
#ifndef _FS_UDF_CORE_H_
|
||||||
|
|
Loading…
Reference in New Issue