diff options
Diffstat (limited to 'sbin/fsck_ffs/fsutil.c')
-rw-r--r-- | sbin/fsck_ffs/fsutil.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sbin/fsck_ffs/fsutil.c b/sbin/fsck_ffs/fsutil.c index 68d113a..85ea033 100644 --- a/sbin/fsck_ffs/fsutil.c +++ b/sbin/fsck_ffs/fsutil.c @@ -39,9 +39,10 @@ __FBSDID("$FreeBSD$"); #include <sys/time.h> #include <sys/types.h> #include <sys/sysctl.h> +#include <sys/disk.h> #include <sys/disklabel.h> +#include <sys/ioctl.h> #include <sys/stat.h> -#include <sys/disklabel.h> #include <ufs/ufs/dinode.h> #include <ufs/ufs/dir.h> @@ -421,6 +422,20 @@ blwrite(int fd, char *buf, ufs2_daddr_t blk, long size) return; } +void +blerase(int fd, ufs2_daddr_t blk, long size) +{ + off_t ioarg[2]; + + if (fd < 0) + return; + ioarg[0] = blk * dev_bsize; + ioarg[1] = size; + ioctl(fd, DIOCGDELETE, ioarg); + /* we don't really care if we succeed or not */ + return; +} + /* * Verify cylinder group's magic number and other parameters. If the * test fails, offer an option to rebuild the whole cylinder group. |