2
lib/libufs/block.c | 2 ++
3
lib/libufs/type.c | 4 +++-
4
sys/ufs/ffs/fs.h | 5 ++++-
5
sys/ufs/ufs/dinode.h | 2 ++
6
sys/ufs/ufs/dir.h | 2 ++
7
5 files changed, 13 insertions(+), 2 deletions(-)
9
--- a/lib/libufs/type.c
10
+++ b/lib/libufs/type.c
11
@@ -111,7 +111,7 @@ again: if ((ret = stat(name, &st)) < 0)
12
if (ret >= 0 && S_ISREG(st.st_mode)) {
13
/* Possibly a disk image, give it a try. */
15
- } else if (ret >= 0 && S_ISCHR(st.st_mode)) {
16
+ } else if (ret >= 0 && (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode))) {
17
/* This is what we need, do nothing. */
19
} else if ((fs = getfsfile(name)) != NULL) {
20
@@ -134,8 +134,10 @@ again: if ((ret = stat(name, &st)) < 0)
21
ERROR(disk, "could not find special device");
25
strlcpy(dev, sfs.f_mntfromname, sizeof(dev));
29
ERROR(disk, "could not find special device");
31
--- a/sys/ufs/ffs/fs.h
32
+++ b/sys/ufs/ffs/fs.h
34
#ifndef _UFS_FFS_FS_H_
35
#define _UFS_FFS_FS_H_
37
+#include <sys/types.h>
41
* Each disk drive contains some number of filesystems.
42
* A filesystem consists of a number of cylinder groups.
43
@@ -504,7 +507,7 @@ struct cg {
44
* Turn filesystem block numbers into disk block addresses.
45
* This maps filesystem blocks to device size blocks.
47
-#define fsbtodb(fs, b) ((daddr_t)(b) << (fs)->fs_fsbtodb)
48
+#define fsbtodb(fs, b) (((intmax_t)(b)) << (fs)->fs_fsbtodb)
49
#define dbtofsb(fs, b) ((b) >> (fs)->fs_fsbtodb)
52
--- a/sys/ufs/ufs/dinode.h
53
+++ b/sys/ufs/ufs/dinode.h
55
#ifndef _UFS_UFS_DINODE_H_
56
#define _UFS_UFS_DINODE_H_
58
+#include <sys/types.h>
61
* The root inode is the root of the filesystem. Inode 0 can't be used for
62
* normal purposes and historically bad blocks were linked to inode 1, thus
63
--- a/sys/ufs/ufs/dir.h
64
+++ b/sys/ufs/ufs/dir.h
66
#ifndef _UFS_UFS_DIR_H_
67
#define _UFS_UFS_DIR_H_
69
+#include <sys/types.h>
72
* Theoretically, directories can be more than 2Gb in length, however, in
73
* practice this seems unlikely. So, we define the type doff_t as a 32-bit
74
--- a/lib/libufs/block.c
75
+++ b/lib/libufs/block.c
76
@@ -30,7 +30,9 @@ __FBSDID("$FreeBSD$");
78
#include <sys/param.h>
79
#include <sys/mount.h>
80
+#ifdef HAVE_BSD_DISKLABEL
83
#include <sys/disklabel.h>