Removed
Link Here
|
1 |
--- fuse_module/fuse_io.c.orig 2008-02-05 00:25:57.000000000 -0500 |
2 |
+++ fuse_module/fuse_io.c 2009-07-13 09:31:24.000000000 -0400 |
3 |
@@ -35,6 +35,10 @@ |
4 |
#include <vm/vnode_pager.h> |
5 |
#include <vm/vm_object.h> |
6 |
|
7 |
+#if (__FreeBSD_version >= 800000) |
8 |
+#define vfs_bio_set_validclean vfs_bio_set_valid |
9 |
+#endif |
10 |
+ |
11 |
#include "fuse.h" |
12 |
#include "fuse_session.h" |
13 |
#include "fuse_vnode.h" |
14 |
@@ -157,7 +161,11 @@ |
15 |
goto out; |
16 |
|
17 |
if (uio->uio_rw == UIO_WRITE && fp->f_flag & O_APPEND) { |
18 |
- if ((err = VOP_GETATTR(vp, &va, cred, td))) |
19 |
+ if ((err = VOP_GETATTR(vp, &va, cred |
20 |
+#if VOP_GETATTR_TAKES_THREAD |
21 |
+ , td |
22 |
+#endif |
23 |
+ ))) |
24 |
goto out; |
25 |
uio->uio_offset = va.va_size; |
26 |
} else if ((flags & FOF_OFFSET) == 0) |
27 |
@@ -227,7 +235,7 @@ |
28 |
return (0); |
29 |
|
30 |
biosize = vp->v_mount->mnt_stat.f_iosize; |
31 |
- bcount = min(MAXBSIZE, biosize); |
32 |
+ bcount = MIN(MAXBSIZE, biosize); |
33 |
|
34 |
DEBUG2G("entering loop\n"); |
35 |
do { |
36 |
@@ -352,7 +360,7 @@ |
37 |
fri = fdi.indata; |
38 |
fri->fh = fufh->fh_id; |
39 |
fri->offset = uio->uio_offset; |
40 |
- fri->size = min(uio->uio_resid, |
41 |
+ fri->size = MIN(uio->uio_resid, |
42 |
fusefs_get_data(vp->v_mount)->max_read); |
43 |
|
44 |
DEBUG2G("fri->fh %llu, fri->offset %d, fri->size %d\n", |
45 |
@@ -399,7 +407,7 @@ |
46 |
while (uio->uio_resid > 0) { |
47 |
int transfersize; |
48 |
|
49 |
- chunksize = min(iov->iov_len, nmax); |
50 |
+ chunksize = MIN(iov->iov_len, nmax); |
51 |
|
52 |
if (uio->uio_rw == UIO_READ) { |
53 |
struct fuse_read_in *fri; |
54 |
@@ -464,7 +472,7 @@ |
55 |
{ |
56 |
int err; |
57 |
|
58 |
- if ((err = uiomove(buf, min(reqsize, bufsize), uio))) |
59 |
+ if ((err = uiomove(buf, MIN(reqsize, bufsize), uio))) |
60 |
return (err); |
61 |
|
62 |
if (bufsize < reqsize) |
63 |
@@ -502,7 +510,7 @@ |
64 |
} |
65 |
|
66 |
while (uio->uio_resid > 0) { |
67 |
- chunksize = min(uio->uio_resid, |
68 |
+ chunksize = MIN(uio->uio_resid, |
69 |
fusefs_get_data(vp->v_mount)->max_write); |
70 |
|
71 |
fdi.iosize = sizeof(*fwi) + chunksize; |
72 |
@@ -569,7 +577,7 @@ |
73 |
do { |
74 |
lbn = uio->uio_offset / biosize; |
75 |
on = uio->uio_offset & (biosize-1); |
76 |
- n = min((unsigned)(biosize - on), uio->uio_resid); |
77 |
+ n = MIN((unsigned)(biosize - on), uio->uio_resid); |
78 |
|
79 |
DEBUG2G("lbn %d, on %d, n %d, uio offset %d, uio resid %d\n", |
80 |
(int)lbn, on, n, (int)uio->uio_offset, uio->uio_resid); |
81 |
@@ -739,8 +747,8 @@ |
82 |
*/ |
83 |
if (n) { |
84 |
if (bp->b_dirtyend > 0) { |
85 |
- bp->b_dirtyoff = min(on, bp->b_dirtyoff); |
86 |
- bp->b_dirtyend = max((on + n), bp->b_dirtyend); |
87 |
+ bp->b_dirtyoff = MIN(on, bp->b_dirtyoff); |
88 |
+ bp->b_dirtyend = MAX((on + n), bp->b_dirtyend); |
89 |
} else { |
90 |
bp->b_dirtyoff = on; |
91 |
bp->b_dirtyend = on + n; |
92 |
@@ -823,7 +831,11 @@ |
93 |
#if FUSELIB_CONFORM_BIOREAD |
94 |
struct vattr va; |
95 |
|
96 |
- if ((err = VOP_GETATTR(vp, &va, cred, curthread))) |
97 |
+ if ((err = VOP_GETATTR(vp, &va, cred |
98 |
+#if VOP_GETATTR_TAKES_THREAD |
99 |
+ , curthread |
100 |
+#endif |
101 |
+ ))) |
102 |
goto out; |
103 |
#endif |
104 |
|
105 |
@@ -831,7 +843,7 @@ |
106 |
bp->b_resid = bp->b_bcount; |
107 |
while (bp->b_resid > 0) { |
108 |
DEBUG2G("starting bio with resid %ld\n", bp->b_resid); |
109 |
- chunksize = min(bp->b_resid, |
110 |
+ chunksize = MIN(bp->b_resid, |
111 |
fusefs_get_data(vp->v_mount)->max_read); |
112 |
fdi.iosize = sizeof(*fri); |
113 |
if (! op) |
114 |
@@ -842,8 +854,8 @@ |
115 |
fri->fh = fufh->fh_id; |
116 |
fri->offset = ((off_t)bp->b_blkno) * biosize + ioff; |
117 |
#if FUSELIB_CONFORM_BIOREAD |
118 |
- chunksize = min(chunksize, |
119 |
- min(fri->offset + bp->b_resid, |
120 |
+ chunksize = MIN(chunksize, |
121 |
+ MIN(fri->offset + bp->b_resid, |
122 |
va.va_size) - fri->offset); |
123 |
if (chunksize == 0) { |
124 |
respsize = -1; |
125 |
@@ -901,7 +913,7 @@ |
126 |
|
127 |
bufdat = bp->b_data + bp->b_dirtyoff; |
128 |
while (bp->b_dirtyend > bp->b_dirtyoff) { |
129 |
- chunksize = min(bp->b_dirtyend - bp->b_dirtyoff, |
130 |
+ chunksize = MIN(bp->b_dirtyend - bp->b_dirtyoff, |
131 |
fusefs_get_data(vp->v_mount)->max_write); |
132 |
|
133 |
fdi.iosize = sizeof(*fwi); |