[Glibc-bsd-commits] r3939 - in trunk/ufsutils/debian: . patches
Robert Millan
rmh at alioth.debian.org
Thu Dec 8 12:40:46 UTC 2011
Author: rmh
Date: 2011-12-08 12:40:45 +0000 (Thu, 08 Dec 2011)
New Revision: 3939
Added:
trunk/ufsutils/debian/patches/00_portable_berase.patch
trunk/ufsutils/debian/patches/04_avoid_diocgdelete.patch
Removed:
trunk/ufsutils/debian/patches/04_portable_berase.patch
Modified:
trunk/ufsutils/debian/changelog
trunk/ufsutils/debian/patches/00_mount.patch
trunk/ufsutils/debian/patches/00_param.patch
trunk/ufsutils/debian/patches/01_libufs.patch
trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch
trunk/ufsutils/debian/patches/02_dumpfs.ufs.patch
trunk/ufsutils/debian/patches/02_fsck.ufs.patch
trunk/ufsutils/debian/patches/02_fsdb.ufs.patch
trunk/ufsutils/debian/patches/02_growfs.ufs.patch
trunk/ufsutils/debian/patches/02_mkfs.ufs.patch
trunk/ufsutils/debian/patches/02_tunefs.ufs.patch
trunk/ufsutils/debian/patches/series
Log:
Import 00_portable_berase.patch from upstream trunk. Refresh all patches.
Modified: trunk/ufsutils/debian/changelog
===================================================================
--- trunk/ufsutils/debian/changelog 2011-12-07 20:39:07 UTC (rev 3938)
+++ trunk/ufsutils/debian/changelog 2011-12-08 12:40:45 UTC (rev 3939)
@@ -1,3 +1,10 @@
+ufsutils (8.2-4) UNRELEASED; urgency=low
+
+ * Import 00_portable_berase.patch from upstream trunk. Refresh all
+ patches.
+
+ -- Robert Millan <rmh at debian.org> Thu, 08 Dec 2011 13:40:32 +0100
+
ufsutils (8.2-3) unstable; urgency=low
* Add myself to Uploaders.
Modified: trunk/ufsutils/debian/patches/00_mount.patch
===================================================================
--- trunk/ufsutils/debian/patches/00_mount.patch 2011-12-07 20:39:07 UTC (rev 3938)
+++ trunk/ufsutils/debian/patches/00_mount.patch 2011-12-08 12:40:45 UTC (rev 3939)
@@ -29,7 +29,7 @@
/*
* File identifier.
* These are unique per filesystem on a single machine.
-@@ -65,6 +61,7 @@ struct fid {
+@@ -65,6 +61,7 @@
*/
#define MFSNAMELEN 16 /* length of type name including null */
#define MNAMELEN 88 /* size of on/from name bufs */
@@ -37,7 +37,7 @@
#define STATFS_VERSION 0x20030518 /* current version number */
struct statfs {
uint32_t f_version; /* structure version number */
-@@ -220,6 +217,7 @@ void __mnt_vnode_markerfree(str
+@@ -220,6 +217,7 @@
} while (0)
#endif /* _KERNEL */
@@ -45,7 +45,7 @@
/*
* User specifiable flags, stored in mnt_flag.
-@@ -415,6 +413,7 @@ struct nfs_public {
+@@ -415,6 +413,7 @@
char *np_index; /* Index file */
};
@@ -53,7 +53,7 @@
/*
* Filesystem configuration information. One of these exists for each
* type of filesystem supported by the kernel. These are searched at
-@@ -452,6 +451,7 @@ struct ovfsconf {
+@@ -452,6 +451,7 @@
int vfc_flags;
};
#endif
@@ -61,7 +61,7 @@
/*
* NB: these flags refer to IMPLEMENTATION properties, not properties of
-@@ -517,6 +517,7 @@ struct vfsquery {
+@@ -517,6 +517,7 @@
#define VQ_FLAG4000 0x4000 /* placeholder */
#define VQ_FLAG8000 0x8000 /* placeholder */
@@ -69,7 +69,7 @@
#ifdef _KERNEL
/* Point a sysctl request at a vfsidctl's data. */
#define VCTLTOREQ(vc, req) \
-@@ -794,5 +795,5 @@ int getvfsbyname(const char *, struct xv
+@@ -794,5 +795,5 @@
__END_DECLS
#endif /* _KERNEL */
Modified: trunk/ufsutils/debian/patches/00_param.patch
===================================================================
--- trunk/ufsutils/debian/patches/00_param.patch 2011-12-07 20:39:07 UTC (rev 3938)
+++ trunk/ufsutils/debian/patches/00_param.patch 2011-12-08 12:40:45 UTC (rev 3939)
@@ -56,7 +56,7 @@
#ifdef _KERNEL
/*
* Basic byte order function prototypes for non-inline functions.
-@@ -317,4 +326,5 @@ __END_DECLS
+@@ -317,4 +326,5 @@
#define member2struct(s, m, x) \
((struct s *)(void *)((char *)(x) - offsetof(struct s, m)))
Added: trunk/ufsutils/debian/patches/00_portable_berase.patch
===================================================================
--- trunk/ufsutils/debian/patches/00_portable_berase.patch (rev 0)
+++ trunk/ufsutils/debian/patches/00_portable_berase.patch 2011-12-08 12:40:45 UTC (rev 3939)
@@ -0,0 +1,76 @@
+
+Replace DIOCGDELETE call in berase() with a portable implementation instead
+of just disabling it.
+
+Patch from upstream (r228349).
+
+--- a/lib/libufs/block.c
++++ b/lib/libufs/block.c
+@@ -139,10 +139,56 @@
+ return (cnt);
+ }
+
++#ifdef __FreeBSD_kernel__
++
++static int
++berase_helper(struct uufsd *disk, ufs2_daddr_t blockno, ufs2_daddr_t size)
++{
++ off_t ioarg[2];
++
++ ioarg[0] = blockno * disk->d_bsize;
++ ioarg[1] = size;
++ return (ioctl(disk->d_fd, DIOCGDELETE, ioarg));
++}
++
++#else
++
++static int
++berase_helper(struct uufsd *disk, ufs2_daddr_t blockno, ufs2_daddr_t size)
++{
++ char *zero_chunk;
++ off_t offset, zero_chunk_size, pwrite_size;
++ int rv;
++
++ offset = blockno * disk->d_bsize;
++ zero_chunk_size = 65536 * disk->d_bsize;
++ zero_chunk = calloc(1, zero_chunk_size);
++ if (zero_chunk == NULL) {
++ ERROR(disk, "failed to allocate memory");
++ return (-1);
++ }
++ while (size > 0) {
++ pwrite_size = size;
++ if (pwrite_size > zero_chunk_size)
++ pwrite_size = zero_chunk_size;
++ rv = pwrite(disk->d_fd, zero_chunk, pwrite_size, offset);
++ if (rv == -1) {
++ ERROR(disk, "failed writing to disk");
++ break;
++ }
++ size -= rv;
++ offset += rv;
++ rv = 0;
++ }
++ free(zero_chunk);
++ return (rv);
++}
++
++#endif
++
+ int
+ berase(struct uufsd *disk, ufs2_daddr_t blockno, ufs2_daddr_t size)
+ {
+- off_t ioarg[2];
+ int rv;
+
+ ERROR(disk, NULL);
+@@ -151,8 +197,5 @@
+ ERROR(disk, "failed to open disk for writing");
+ return(rv);
+ }
+- ioarg[0] = blockno * disk->d_bsize;
+- ioarg[1] = size;
+- rv = ioctl(disk->d_fd, DIOCGDELETE, ioarg);
+- return (rv);
++ return (berase_helper(disk, blockno, size));
+ }
Modified: trunk/ufsutils/debian/patches/01_libufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/01_libufs.patch 2011-12-07 20:39:07 UTC (rev 3938)
+++ trunk/ufsutils/debian/patches/01_libufs.patch 2011-12-08 12:40:45 UTC (rev 3939)
@@ -9,7 +9,7 @@
--- a/lib/libufs/type.c
+++ b/lib/libufs/type.c
-@@ -111,7 +111,7 @@ again: if ((ret = stat(name, &st)) < 0)
+@@ -111,7 +111,7 @@
if (ret >= 0 && S_ISREG(st.st_mode)) {
/* Possibly a disk image, give it a try. */
;
@@ -18,7 +18,7 @@
/* This is what we need, do nothing. */
;
} else if ((fs = getfsfile(name)) != NULL) {
-@@ -134,8 +134,10 @@ again: if ((ret = stat(name, &st)) < 0)
+@@ -134,8 +134,10 @@
ERROR(disk, "could not find special device");
return (-1);
}
@@ -41,7 +41,7 @@
/*
* Each disk drive contains some number of filesystems.
* A filesystem consists of a number of cylinder groups.
-@@ -504,7 +507,7 @@ struct cg {
+@@ -504,7 +507,7 @@
* Turn filesystem block numbers into disk block addresses.
* This maps filesystem blocks to device size blocks.
*/
@@ -114,7 +114,7 @@
+include ../../Makefile.common
--- a/lib/libufs/block.c
+++ b/lib/libufs/block.c
-@@ -30,7 +30,9 @@ __FBSDID("$FreeBSD$");
+@@ -30,7 +30,9 @@
#include <sys/param.h>
#include <sys/mount.h>
@@ -124,14 +124,3 @@
#include <sys/disklabel.h>
#include <sys/stat.h>
-@@ -151,8 +153,10 @@ berase(struct uufsd *disk, ufs2_daddr_t
- ERROR(disk, "failed to open disk for writing");
- return(rv);
- }
-+#ifdef HAVE_BSD_DISKLABEL
- ioarg[0] = blockno * disk->d_bsize;
- ioarg[1] = size;
- rv = ioctl(disk->d_fd, DIOCGDELETE, ioarg);
-+#endif
- return (rv);
- }
Modified: trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch 2011-12-07 20:39:07 UTC (rev 3938)
+++ trunk/ufsutils/debian/patches/02_bsdlabel.ufs.patch 2011-12-08 12:40:45 UTC (rev 3939)
@@ -5,7 +5,7 @@
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
-@@ -60,7 +60,9 @@ __FBSDID("$FreeBSD$");
+@@ -60,7 +60,9 @@
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/wait.h>
@@ -15,7 +15,7 @@
#define DKTYPENAMES
#define FSTYPENAMES
#define MAXPARTITIONS 26
-@@ -69,7 +71,7 @@ __FBSDID("$FreeBSD$");
+@@ -69,7 +71,7 @@
#include <unistd.h>
#include <string.h>
#include <stdio.h>
@@ -24,7 +24,7 @@
#include <stdlib.h>
#include <signal.h>
#include <stdarg.h>
-@@ -720,10 +722,12 @@ editit(void)
+@@ -720,10 +722,12 @@
omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP));
while ((pid = fork()) < 0) {
@@ -37,7 +37,7 @@
if (errno != EAGAIN) {
warn("fork");
return(0);
-@@ -1508,13 +1512,18 @@ getvirginlabel(void)
+@@ -1508,13 +1512,18 @@
* to get any good ideas from the device, construct something
* which is IBM-PC friendly.
*/
@@ -76,7 +76,7 @@
DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF}
LDADD= -lgeom -lbsdxml -lsbuf
-@@ -19,7 +13,9 @@ LDADD= -lgeom -lbsdxml -lsbuf
+@@ -19,7 +13,9 @@
.include <bsd.prog.mk>
test: ${PROG}
Modified: trunk/ufsutils/debian/patches/02_dumpfs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_dumpfs.ufs.patch 2011-12-07 20:39:07 UTC (rev 3938)
+++ trunk/ufsutils/debian/patches/02_dumpfs.ufs.patch 2011-12-08 12:40:45 UTC (rev 3939)
@@ -5,7 +5,7 @@
--- a/sbin/dumpfs/dumpfs.c
+++ b/sbin/dumpfs/dumpfs.c
-@@ -68,6 +68,7 @@ static const char rcsid[] =
+@@ -68,6 +68,7 @@
#include <fcntl.h>
#include <fstab.h>
#include <libufs.h>
Modified: trunk/ufsutils/debian/patches/02_fsck.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_fsck.ufs.patch 2011-12-07 20:39:07 UTC (rev 3938)
+++ trunk/ufsutils/debian/patches/02_fsck.ufs.patch 2011-12-08 12:40:45 UTC (rev 3939)
@@ -24,14 +24,14 @@
#include <sys/param.h>
#include <sys/disklabel.h>
#include <sys/mount.h>
-@@ -774,3 +777,4 @@ gjournal_check(const char *filesys)
+@@ -774,3 +777,4 @@
/* Write back updated statistics and super-block. */
putdisk();
}
+#endif
--- a/sbin/fsck_ffs/ea.c
+++ b/sbin/fsck_ffs/ea.c
-@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
+@@ -38,7 +38,7 @@
#include <sys/param.h>
#include <sys/time.h>
@@ -57,7 +57,7 @@
.Nd file system consistency check and interactive repair
.Sh SYNOPSIS
.Nm
-@@ -349,5 +349,4 @@ are fully enumerated and explained in Ap
+@@ -349,5 +349,4 @@
.Xr fstab 5 ,
.Xr fsck 8 ,
.Xr fsdb 8 ,
@@ -65,7 +65,7 @@
.Xr reboot 8
--- a/sbin/fsck_ffs/fsutil.c
+++ b/sbin/fsck_ffs/fsutil.c
-@@ -38,7 +38,9 @@ __FBSDID("$FreeBSD$");
+@@ -38,7 +38,9 @@
#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
@@ -75,7 +75,7 @@
#include <sys/disklabel.h>
#include <sys/stat.h>
#include <sys/disklabel.h>
-@@ -55,6 +57,7 @@ __FBSDID("$FreeBSD$");
+@@ -55,6 +57,7 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -83,7 +83,7 @@
#include <unistd.h>
#include "fsck.h"
-@@ -277,11 +280,13 @@ ckfini(int markclean)
+@@ -277,11 +280,13 @@
if (bkgrdflag) {
unlink(snapname);
if ((!(sblock.fs_flags & FS_UNCLEAN)) != markclean) {
@@ -97,7 +97,7 @@
if (!preen) {
printf("\n***** FILE SYSTEM MARKED %s *****\n",
markclean ? "CLEAN" : "DIRTY");
-@@ -639,7 +644,7 @@ getpathname(char *namebuf, ino_t curdir,
+@@ -639,7 +644,7 @@
}
void
@@ -106,7 +106,7 @@
{
ckfini(0);
-@@ -652,7 +657,7 @@ catch(int sig __unused)
+@@ -652,7 +657,7 @@
* so that reboot sequence may be interrupted.
*/
void
@@ -115,7 +115,7 @@
{
printf("returning to single-user after file system check\n");
returntosingle = 1;
-@@ -721,11 +726,13 @@ pfatal(const char *fmt, ...)
+@@ -721,11 +726,13 @@
* Force foreground fsck to clean up inconsistency.
*/
if (bkgrdflag) {
@@ -129,7 +129,7 @@
fprintf(stdout, "CANNOT RUN IN BACKGROUND\n");
ckfini(0);
exit(EEXIT);
-@@ -742,6 +749,7 @@ pfatal(const char *fmt, ...)
+@@ -742,6 +749,7 @@
/*
* Force foreground fsck to clean up inconsistency.
*/
@@ -137,7 +137,7 @@
if (bkgrdflag) {
cmd.value = FS_NEEDSFSCK;
cmd.size = 1;
-@@ -749,6 +757,7 @@ pfatal(const char *fmt, ...)
+@@ -749,6 +757,7 @@
&cmd, sizeof cmd) == -1)
pwarn("CANNOT SET FS_NEEDSFSCK FLAG\n");
}
@@ -147,7 +147,7 @@
}
--- a/sbin/fsck_ffs/inode.c
+++ b/sbin/fsck_ffs/inode.c
-@@ -36,7 +36,7 @@ static const char sccsid[] = "@(#)inode.
+@@ -36,7 +36,7 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
@@ -156,7 +156,7 @@
#include <sys/time.h>
#include <sys/sysctl.h>
-@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
+@@ -47,6 +47,7 @@
#include <err.h>
#include <pwd.h>
#include <string.h>
@@ -166,7 +166,7 @@
--- a/sbin/fsck_ffs/main.c
+++ b/sbin/fsck_ffs/main.c
-@@ -45,9 +45,17 @@ __FBSDID("$FreeBSD$");
+@@ -45,9 +45,17 @@
#include <sys/stat.h>
#include <sys/file.h>
#include <sys/time.h>
@@ -184,7 +184,7 @@
#include <sys/uio.h>
#include <sys/disklabel.h>
-@@ -62,14 +70,18 @@ __FBSDID("$FreeBSD$");
+@@ -62,14 +70,18 @@
#include <paths.h>
#include <stdint.h>
#include <string.h>
@@ -204,7 +204,7 @@
int
main(int argc, char *argv[])
-@@ -79,10 +91,12 @@ main(int argc, char *argv[])
+@@ -79,10 +91,12 @@
struct itimerval itimerval;
int ret = 0;
@@ -218,7 +218,7 @@
switch (ch) {
case 'b':
skipclean = 0;
-@@ -126,6 +140,7 @@ main(int argc, char *argv[])
+@@ -126,6 +140,7 @@
yflag = 0;
break;
@@ -226,7 +226,7 @@
case 'p':
preen++;
/*FALLTHROUGH*/
-@@ -157,7 +172,9 @@ main(int argc, char *argv[])
+@@ -157,7 +172,9 @@
(void)signal(SIGINT, catch);
if (ckclean)
(void)signal(SIGQUIT, catchquit);
@@ -236,7 +236,7 @@
if (bkgrdflag) {
signal(SIGALRM, alarmhandler);
itimerval.it_interval.tv_sec = 5;
-@@ -204,8 +221,10 @@ checkfilesys(char *filesys)
+@@ -204,8 +221,10 @@
ufs2_daddr_t n_ffree, n_bfree;
struct dups *dp;
struct statfs *mntp;
@@ -247,7 +247,7 @@
ufs2_daddr_t blks;
struct iovec *iov;
char errmsg[255];
-@@ -226,10 +245,14 @@ checkfilesys(char *filesys)
+@@ -226,10 +245,14 @@
* if it is listed among the mounted file systems. Failing that
* check to see if it is listed in /etc/fstab.
*/
@@ -262,7 +262,7 @@
filesys = blockcheck(filesys);
/*
* If -F flag specified, check to see whether a background check
-@@ -247,8 +270,10 @@ checkfilesys(char *filesys)
+@@ -247,8 +270,10 @@
if ((sblock.fs_flags & FS_DOSOFTDEP) == 0)
exit(5); /* Not running soft updates */
size = MIBSIZE;
@@ -273,7 +273,7 @@
if ((mntp == NULL && sblock.fs_clean == 1) ||
(mntp != NULL && (sblock.fs_flags & FS_UNCLEAN) == 0))
exit(7); /* Filesystem clean, report it now */
-@@ -261,6 +286,7 @@ checkfilesys(char *filesys)
+@@ -261,6 +286,7 @@
if ((fsreadfd = open(filesys, O_RDONLY)) < 0 || readsb(0) == 0)
exit(3); /* Cannot read superblock */
close(fsreadfd);
@@ -281,7 +281,7 @@
if ((sblock.fs_flags & FS_GJOURNAL) != 0) {
//printf("GJournaled file system detected on %s.\n",
// filesys);
-@@ -278,6 +304,7 @@ checkfilesys(char *filesys)
+@@ -278,6 +304,7 @@
"CANNOT RUN FAST FSCK\n");
}
}
@@ -289,7 +289,7 @@
}
/*
* If we are to do a background check:
-@@ -286,6 +313,7 @@ checkfilesys(char *filesys)
+@@ -286,6 +313,7 @@
* return created snapshot file
* if not found, clear bkgrdflag and proceed with normal fsck
*/
@@ -297,7 +297,7 @@
if (bkgrdflag) {
if (mntp == NULL) {
bkgrdflag = 0;
-@@ -368,6 +396,7 @@ checkfilesys(char *filesys)
+@@ -368,6 +396,7 @@
filesys = snapname;
}
}
@@ -305,7 +305,7 @@
switch (setup(filesys)) {
case 0:
-@@ -375,7 +404,9 @@ checkfilesys(char *filesys)
+@@ -375,7 +404,9 @@
pfatal("CAN'T CHECK FILE SYSTEM.");
return (0);
case -1:
@@ -315,7 +315,7 @@
pwarn("clean, %ld free ", (long)(sblock.fs_cstotal.cs_nffree +
sblock.fs_frag * sblock.fs_cstotal.cs_nbfree));
printf("(%lld frags, %lld blocks, %.1f%% fragmentation)\n",
-@@ -395,8 +426,10 @@ checkfilesys(char *filesys)
+@@ -395,8 +426,10 @@
*/
if (preen == 0) {
printf("** Last Mounted on %s\n", sblock.fs_fsmnt);
@@ -326,7 +326,7 @@
printf("** Phase 1 - Check Blocks and Sizes\n");
}
pass1();
-@@ -495,8 +528,13 @@ checkfilesys(char *filesys)
+@@ -495,8 +528,13 @@
/*
* Check to see if the file system is mounted read-write.
*/
@@ -340,7 +340,7 @@
ckfini(resolved);
for (cylno = 0; cylno < sblock.fs_ncg; cylno++)
-@@ -537,6 +575,8 @@ chkdoreload(struct statfs *mntp)
+@@ -537,6 +575,8 @@
* it unless it is read-write, so we can continue using it
* as safely as possible.
*/
@@ -349,7 +349,7 @@
if (mntp->f_flags & MNT_RDONLY) {
build_iovec(&iov, &iovlen, "fstype", "ffs", 4);
build_iovec(&iov, &iovlen, "from", mntp->f_mntfromname,
-@@ -560,8 +600,12 @@ chkdoreload(struct statfs *mntp)
+@@ -560,8 +600,12 @@
return (1);
}
return (0);
@@ -362,7 +362,7 @@
/*
* Get the mount point information for name.
*/
-@@ -601,6 +645,7 @@ getmntpt(const char *name)
+@@ -601,6 +645,7 @@
statfsp = NULL;
return (statfsp);
}
@@ -372,7 +372,7 @@
usage(void)
--- a/sbin/fsck_ffs/pass1.c
+++ b/sbin/fsck_ffs/pass1.c
-@@ -357,9 +357,11 @@ checkinode(ino_t inumber, struct inodesc
+@@ -357,9 +357,11 @@
inoinfo(inumber)->ino_type = IFTODT(mode);
badblk = dupblk = 0;
idesc->id_number = inumber;
@@ -386,7 +386,7 @@
if (sblock.fs_magic == FS_UFS2_MAGIC && dp->dp2.di_extsize > 0) {
--- a/sbin/fsck_ffs/setup.c
+++ b/sbin/fsck_ffs/setup.c
-@@ -36,11 +36,14 @@ static const char sccsid[] = "@(#)setup.
+@@ -36,11 +36,14 @@
__FBSDID("$FreeBSD$");
#include <sys/param.h>
@@ -401,7 +401,7 @@
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
-@@ -51,6 +54,7 @@ __FBSDID("$FreeBSD$");
+@@ -51,6 +54,7 @@
#include <limits.h>
#include <stdint.h>
#include <string.h>
@@ -409,7 +409,7 @@
#include "fsck.h"
-@@ -87,6 +91,7 @@ setup(char *dev)
+@@ -87,6 +91,7 @@
}
return (0);
}
@@ -417,7 +417,7 @@
if ((statb.st_mode & S_IFMT) != S_IFCHR &&
(statb.st_mode & S_IFMT) != S_IFBLK) {
if (bkgrdflag != 0 && (statb.st_flags & SF_SNAPSHOT) == 0) {
-@@ -121,6 +126,7 @@ setup(char *dev)
+@@ -121,6 +126,7 @@
}
}
}
@@ -425,7 +425,7 @@
if ((fsreadfd = open(dev, O_RDONLY)) < 0) {
if (bkgrdflag) {
unlink(snapname);
-@@ -131,6 +137,7 @@ setup(char *dev)
+@@ -131,6 +137,7 @@
}
if (bkgrdflag) {
unlink(snapname);
@@ -433,7 +433,7 @@
size = MIBSIZE;
if (sysctlnametomib("vfs.ffs.adjrefcnt", adjrefcnt, &size) < 0||
sysctlnametomib("vfs.ffs.adjblkcnt", adjblkcnt, &size) < 0||
-@@ -160,6 +167,7 @@ setup(char *dev)
+@@ -160,6 +167,7 @@
}
cmd.version = FFS_CMD_VERSION;
cmd.handle = fsreadfd;
@@ -441,7 +441,7 @@
fswritefd = -1;
}
if (preen == 0)
-@@ -471,6 +479,8 @@ calcsb(char *dev, int devfd, struct fs *
+@@ -471,6 +479,8 @@
return (0);
}
lp = getdisklabel(dev, devfd);
@@ -450,7 +450,7 @@
if (isdigit(*cp))
pp = &lp->d_partitions[0];
else
-@@ -521,13 +531,17 @@ calcsb(char *dev, int devfd, struct fs *
+@@ -521,13 +531,17 @@
static struct disklabel *
getdisklabel(char *s, int fd)
{
@@ -470,7 +470,7 @@
}
--- a/sbin/fsck_ffs/utilities.c
+++ b/sbin/fsck_ffs/utilities.c
-@@ -108,14 +108,16 @@ retry:
+@@ -108,14 +108,16 @@
return (origname);
}
Modified: trunk/ufsutils/debian/patches/02_fsdb.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_fsdb.ufs.patch 2011-12-07 20:39:07 UTC (rev 3938)
+++ trunk/ufsutils/debian/patches/02_fsdb.ufs.patch 2011-12-08 12:40:45 UTC (rev 3939)
@@ -7,7 +7,7 @@
--- a/sbin/fsdb/fsdb.8
+++ b/sbin/fsdb/fsdb.8
-@@ -263,7 +263,7 @@ There are a bunch of other things that y
+@@ -263,7 +263,7 @@
.Nm
does not implement.
.Sh WARNING
@@ -18,7 +18,7 @@
can repair.
--- a/sbin/fsdb/fsdb.c
+++ b/sbin/fsdb/fsdb.c
-@@ -35,13 +35,13 @@ static const char rcsid[] =
+@@ -35,13 +35,13 @@
#include <sys/param.h>
#include <sys/time.h>
@@ -33,7 +33,7 @@
#include <ufs/ufs/dinode.h>
#include <ufs/ufs/dir.h>
-@@ -60,6 +60,18 @@ static int find_blks64(uint64_t *buf, in
+@@ -60,6 +60,18 @@
static int find_indirblks32(uint32_t blk, int ind_level, uint32_t *blknum);
static int find_indirblks64(uint64_t blk, int ind_level, uint64_t *blknum);
@@ -54,7 +54,7 @@
{
--- a/sbin/fsdb/fsdbutil.c
+++ b/sbin/fsdb/fsdbutil.c
-@@ -41,7 +41,6 @@ static const char rcsid[] =
+@@ -41,7 +41,6 @@
#include <stdint.h>
#include <string.h>
#include <time.h>
@@ -62,7 +62,7 @@
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
-@@ -51,6 +50,18 @@ static const char rcsid[] =
+@@ -51,6 +50,18 @@
#include "fsdb.h"
#include "fsck.h"
Modified: trunk/ufsutils/debian/patches/02_growfs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_growfs.ufs.patch 2011-12-07 20:39:07 UTC (rev 3938)
+++ trunk/ufsutils/debian/patches/02_growfs.ufs.patch 2011-12-08 12:40:45 UTC (rev 3939)
@@ -5,7 +5,7 @@
--- a/sbin/growfs/growfs.c
+++ b/sbin/growfs/growfs.c
-@@ -51,10 +51,10 @@ __FBSDID("$FreeBSD$");
+@@ -51,10 +51,10 @@
/* ********************************************************** INCLUDES ***** */
#include <sys/param.h>
@@ -17,7 +17,7 @@
#include <stdio.h>
#include <paths.h>
-@@ -1925,10 +1925,12 @@ get_dev_size(int fd, int *size)
+@@ -1925,10 +1925,12 @@
int sectorsize;
off_t mediasize;
@@ -30,7 +30,7 @@
if (sectorsize <= 0)
errx(1, "bogus sectorsize: %d", sectorsize);
-@@ -2285,9 +2287,11 @@ return_disklabel(int fd, struct disklabe
+@@ -2285,9 +2287,11 @@
}
lp->d_checksum=sum;
@@ -42,7 +42,7 @@
}
free(lp);
-@@ -2311,8 +2315,10 @@ get_disklabel(int fd)
+@@ -2311,8 +2315,10 @@
if (!lab)
errx(1, "malloc failed");
Modified: trunk/ufsutils/debian/patches/02_mkfs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_mkfs.ufs.patch 2011-12-07 20:39:07 UTC (rev 3938)
+++ trunk/ufsutils/debian/patches/02_mkfs.ufs.patch 2011-12-08 12:40:45 UTC (rev 3939)
@@ -7,7 +7,7 @@
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
-@@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$");
+@@ -53,6 +53,7 @@
#include <stdint.h>
#include <stdio.h>
#include <unistd.h>
@@ -17,7 +17,7 @@
#include <sys/types.h>
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
-@@ -55,7 +55,9 @@ __FBSDID("$FreeBSD$");
+@@ -55,7 +55,9 @@
*/
#include <sys/param.h>
#include <sys/stat.h>
@@ -27,7 +27,7 @@
#include <sys/disklabel.h>
#include <sys/file.h>
#include <sys/mount.h>
-@@ -133,6 +135,8 @@ main(int argc, char *argv[])
+@@ -133,6 +135,8 @@
off_t mediasize;
char part_name; /* partition name, default to full disk */
@@ -36,7 +36,7 @@
part_name = 'c';
reserved = 0;
while ((ch = getopt(argc, argv,
-@@ -303,8 +307,9 @@ main(int argc, char *argv[])
+@@ -303,8 +307,9 @@
}
if (fstat(disk.d_fd, &st) < 0)
err(1, "%s", special);
@@ -48,7 +48,7 @@
is_file = 1; /* assume it is a file */
dkname = special;
if (sectorsize == 0)
-@@ -312,10 +317,15 @@ main(int argc, char *argv[])
+@@ -312,10 +317,15 @@
mediasize = st.st_size;
/* set fssize from the partition */
} else {
@@ -65,7 +65,7 @@
getfssize(&fssize, special, mediasize / sectorsize, reserved);
}
pp = NULL;
-@@ -370,7 +380,7 @@ main(int argc, char *argv[])
+@@ -370,7 +380,7 @@
pp->p_size *= secperblk;
}
mkfs(pp, special);
@@ -74,7 +74,7 @@
if (realsectorsize != DEV_BSIZE)
pp->p_size /= realsectorsize / DEV_BSIZE;
if (!Nflag && bcmp(pp, &oldpartition, sizeof(oldpartition)))
-@@ -415,8 +425,10 @@ getdisklabel(char *s)
+@@ -415,8 +425,10 @@
return &lab;
}
@@ -85,7 +85,7 @@
unlabeled++;
if (disktype) {
lp = getdiskbyname(disktype);
-@@ -441,8 +453,10 @@ rewritelabel(char *s, struct disklabel *
+@@ -441,8 +453,10 @@
errx(1, "cannot write label");
return;
}
@@ -131,7 +131,7 @@
echo All Tests Passed
--- a/sbin/newfs/newfs.8
+++ b/sbin/newfs/newfs.8
-@@ -78,10 +78,10 @@ The following options define the general
+@@ -78,10 +78,10 @@
.It Fl E
Erase the content of the disk before making the filesystem.
The reserved area in front of the superblock (for bootcode) will not be erased.
Modified: trunk/ufsutils/debian/patches/02_tunefs.ufs.patch
===================================================================
--- trunk/ufsutils/debian/patches/02_tunefs.ufs.patch 2011-12-07 20:39:07 UTC (rev 3938)
+++ trunk/ufsutils/debian/patches/02_tunefs.ufs.patch 2011-12-08 12:40:45 UTC (rev 3939)
@@ -5,7 +5,7 @@
--- a/sbin/tunefs/tunefs.c
+++ b/sbin/tunefs/tunefs.c
-@@ -48,8 +48,15 @@ __FBSDID("$FreeBSD$");
+@@ -48,8 +48,15 @@
#include <sys/mount.h>
#include <sys/disklabel.h>
#include <sys/stat.h>
@@ -21,7 +21,7 @@
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
-@@ -84,8 +91,12 @@ main(int argc, char *argv[])
+@@ -84,8 +91,12 @@
int mflag, mvalue, Nflag, nflag, oflag, ovalue, pflag, sflag, svalue;
int ch, found_arg, i;
const char *chg[2];
@@ -34,7 +34,7 @@
if (argc < 3)
usage();
-@@ -253,9 +264,11 @@ main(int argc, char *argv[])
+@@ -253,9 +264,11 @@
goto err;
if (disk.d_name != special) {
special = disk.d_name;
@@ -46,7 +46,7 @@
}
if (pflag) {
-@@ -440,6 +453,7 @@ main(int argc, char *argv[])
+@@ -440,6 +453,7 @@
if (sbwrite(&disk, Aflag) == -1)
goto err;
ufs_disk_close(&disk);
@@ -54,7 +54,7 @@
if (active) {
bzero(&args, sizeof(args));
if (mount("ufs", on,
-@@ -447,6 +461,7 @@ main(int argc, char *argv[])
+@@ -447,6 +461,7 @@
err(9, "%s: reload", special);
warnx("file system reloaded");
}
Added: trunk/ufsutils/debian/patches/04_avoid_diocgdelete.patch
===================================================================
--- trunk/ufsutils/debian/patches/04_avoid_diocgdelete.patch (rev 0)
+++ trunk/ufsutils/debian/patches/04_avoid_diocgdelete.patch 2011-12-08 12:40:45 UTC (rev 3939)
@@ -0,0 +1,15 @@
+
+DIOCGDELETE needs to be avoided for now, even on GNU/kFreeBSD (see
+PR kern/162905).
+
+--- a/lib/libufs/block.c
++++ b/lib/libufs/block.c
+@@ -141,7 +141,7 @@
+ return (cnt);
+ }
+
+-#ifdef __FreeBSD_kernel__
++#if 0
+
+ static int
+ berase_helper(struct uufsd *disk, ufs2_daddr_t blockno, ufs2_daddr_t size)
Deleted: trunk/ufsutils/debian/patches/04_portable_berase.patch
===================================================================
--- trunk/ufsutils/debian/patches/04_portable_berase.patch 2011-12-07 20:39:07 UTC (rev 3938)
+++ trunk/ufsutils/debian/patches/04_portable_berase.patch 2011-12-08 12:40:45 UTC (rev 3939)
@@ -1,47 +0,0 @@
-
-Replace DIOCGDELETE call in berase() with a portable implementation instead
-of just disabling it.
-
-Note: DIOCGDELETE needs to be avoided for now, even on GNU/kFreeBSD (see
-PR kern/162905).
-
---- a/lib/libufs/block.c
-+++ b/lib/libufs/block.c
-@@ -144,7 +144,6 @@
- int
- berase(struct uufsd *disk, ufs2_daddr_t blockno, ufs2_daddr_t size)
- {
-- off_t ioarg[2];
- int rv;
-
- ERROR(disk, NULL);
-@@ -153,10 +152,28 @@
- ERROR(disk, "failed to open disk for writing");
- return(rv);
- }
--#ifdef HAVE_BSD_DISKLABEL
-+#if 0
-+ off_t ioarg[2];
- ioarg[0] = blockno * disk->d_bsize;
- ioarg[1] = size;
- rv = ioctl(disk->d_fd, DIOCGDELETE, ioarg);
-+#else
-+ off_t offset, chunk;
-+
-+ offset = blockno * disk->d_bsize;
-+
-+ while (size > 0) {
-+ chunk = size;
-+ if (chunk > 65536 * disk->d_bsize)
-+ chunk = 65536 * disk->d_bsize;
-+ void *zero_chunk = malloc(chunk);
-+ rv = pwrite(disk->d_fd, zero_chunk, chunk, offset);
-+ free(zero_chunk);
-+ size -= chunk;
-+ offset += chunk;
-+ if (rv == -1)
-+ break;
-+ }
- #endif
- return (rv);
- }
Modified: trunk/ufsutils/debian/patches/series
===================================================================
--- trunk/ufsutils/debian/patches/series 2011-12-07 20:39:07 UTC (rev 3938)
+++ trunk/ufsutils/debian/patches/series 2011-12-08 12:40:45 UTC (rev 3939)
@@ -1,3 +1,4 @@
+00_portable_berase.patch
00_include.patch
00_libport.patch
00_mount.patch
@@ -15,6 +16,6 @@
02_mkfs.ufs.patch
02_tunefs.ufs.patch
03_ufsmount.patch
-04_portable_berase.patch
+04_avoid_diocgdelete.patch
05_wipe_otherfs.patch
99_makefiles.patch
More information about the Glibc-bsd-commits
mailing list