diff options
Diffstat (limited to 'meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch')
-rw-r--r-- | meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch | 351 |
1 files changed, 351 insertions, 0 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch b/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch new file mode 100644 index 0000000000..e1532c1fc9 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0012-fsstress.c-Replace-__int64_t-with-int64_t.patch | |||
@@ -0,0 +1,351 @@ | |||
1 | From 54e098a366a1d773c4d7d4124f2f5aab976681c3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 7 Jan 2016 19:58:08 +0000 | ||
4 | Subject: [PATCH 12/32] fsstress.c: Replace __int64_t with int64_t | ||
5 | |||
6 | int64_t is defined in ISO C99 | ||
7 | include limits.h to get defintions of PATH_MAX | ||
8 | |||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | testcases/kernel/fs/fsstress/fsstress.c | 31 +++++++++--------- | ||
12 | testcases/network/nfs/nfs_fsstress/fsstress.c | 47 ++++++++++++++------------- | ||
13 | 2 files changed, 40 insertions(+), 38 deletions(-) | ||
14 | |||
15 | diff --git a/testcases/kernel/fs/fsstress/fsstress.c b/testcases/kernel/fs/fsstress/fsstress.c | ||
16 | index 2f89903..89f0b19 100644 | ||
17 | --- a/testcases/kernel/fs/fsstress/fsstress.c | ||
18 | +++ b/testcases/kernel/fs/fsstress/fsstress.c | ||
19 | @@ -36,6 +36,7 @@ | ||
20 | #ifdef HAVE_SYS_PRCTL_H | ||
21 | # include <sys/prctl.h> | ||
22 | #endif | ||
23 | +#include <limits.h> | ||
24 | |||
25 | #define XFS_ERRTAG_MAX 17 | ||
26 | |||
27 | @@ -1572,7 +1573,7 @@ void bulkstat_f(int opno, long r) | ||
28 | __u64 last; | ||
29 | __s32 nent; | ||
30 | xfs_bstat_t *t; | ||
31 | - __int64_t total; | ||
32 | + int64_t total; | ||
33 | xfs_fsop_bulkreq_t bsr; | ||
34 | |||
35 | last = 0; | ||
36 | @@ -1764,14 +1765,14 @@ int setdirect(int fd) | ||
37 | |||
38 | void dread_f(int opno, long r) | ||
39 | { | ||
40 | - __int64_t align; | ||
41 | + int64_t align; | ||
42 | char *buf = NULL; | ||
43 | struct dioattr diob; | ||
44 | int e; | ||
45 | pathname_t f; | ||
46 | int fd; | ||
47 | size_t len; | ||
48 | - __int64_t lr; | ||
49 | + int64_t lr; | ||
50 | off64_t off; | ||
51 | struct stat64 stb; | ||
52 | int v; | ||
53 | @@ -1835,8 +1836,8 @@ void dread_f(int opno, long r) | ||
54 | return; | ||
55 | } | ||
56 | #endif | ||
57 | - align = (__int64_t) diob.d_miniosz; | ||
58 | - lr = ((__int64_t) random() << 32) + random(); | ||
59 | + align = (int64_t) diob.d_miniosz; | ||
60 | + lr = ((int64_t) random() << 32) + random(); | ||
61 | off = (off64_t) (lr % stb.st_size); | ||
62 | off -= (off % align); | ||
63 | lseek64(fd, off, SEEK_SET); | ||
64 | @@ -1865,14 +1866,14 @@ void dread_f(int opno, long r) | ||
65 | |||
66 | void dwrite_f(int opno, long r) | ||
67 | { | ||
68 | - __int64_t align; | ||
69 | + int64_t align; | ||
70 | char *buf = NULL; | ||
71 | struct dioattr diob; | ||
72 | int e; | ||
73 | pathname_t f; | ||
74 | int fd; | ||
75 | size_t len; | ||
76 | - __int64_t lr; | ||
77 | + int64_t lr; | ||
78 | off64_t off; | ||
79 | struct stat64 stb; | ||
80 | int v; | ||
81 | @@ -1925,8 +1926,8 @@ void dwrite_f(int opno, long r) | ||
82 | return; | ||
83 | } | ||
84 | #endif | ||
85 | - align = (__int64_t) diob.d_miniosz; | ||
86 | - lr = ((__int64_t) random() << 32) + random(); | ||
87 | + align = (int64_t) diob.d_miniosz; | ||
88 | + lr = ((int64_t) random() << 32) + random(); | ||
89 | off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); | ||
90 | off -= (off % align); | ||
91 | lseek64(fd, off, SEEK_SET); | ||
92 | @@ -2224,7 +2225,7 @@ void read_f(int opno, long r) | ||
93 | pathname_t f; | ||
94 | int fd; | ||
95 | size_t len; | ||
96 | - __int64_t lr; | ||
97 | + int64_t lr; | ||
98 | off64_t off; | ||
99 | struct stat64 stb; | ||
100 | int v; | ||
101 | @@ -2262,7 +2263,7 @@ void read_f(int opno, long r) | ||
102 | close(fd); | ||
103 | return; | ||
104 | } | ||
105 | - lr = ((__int64_t) random() << 32) + random(); | ||
106 | + lr = ((int64_t) random() << 32) + random(); | ||
107 | off = (off64_t) (lr % stb.st_size); | ||
108 | lseek64(fd, off, SEEK_SET); | ||
109 | len = (random() % (getpagesize() * 32)) + 1; | ||
110 | @@ -2509,7 +2510,7 @@ void truncate_f(int opno, long r) | ||
111 | { | ||
112 | int e; | ||
113 | pathname_t f; | ||
114 | - __int64_t lr; | ||
115 | + int64_t lr; | ||
116 | off64_t off; | ||
117 | struct stat64 stb; | ||
118 | int v; | ||
119 | @@ -2530,7 +2531,7 @@ void truncate_f(int opno, long r) | ||
120 | free_pathname(&f); | ||
121 | return; | ||
122 | } | ||
123 | - lr = ((__int64_t) random() << 32) + random(); | ||
124 | + lr = ((int64_t) random() << 32) + random(); | ||
125 | off = lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE); | ||
126 | off %= maxfsize; | ||
127 | e = truncate64_path(&f, off) < 0 ? errno : 0; | ||
128 | @@ -2626,7 +2627,7 @@ void write_f(int opno, long r) | ||
129 | pathname_t f; | ||
130 | int fd; | ||
131 | size_t len; | ||
132 | - __int64_t lr; | ||
133 | + int64_t lr; | ||
134 | off64_t off; | ||
135 | struct stat64 stb; | ||
136 | int v; | ||
137 | @@ -2656,7 +2657,7 @@ void write_f(int opno, long r) | ||
138 | close(fd); | ||
139 | return; | ||
140 | } | ||
141 | - lr = ((__int64_t) random() << 32) + random(); | ||
142 | + lr = ((int64_t) random() << 32) + random(); | ||
143 | off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); | ||
144 | off %= maxfsize; | ||
145 | lseek64(fd, off, SEEK_SET); | ||
146 | diff --git a/testcases/network/nfs/nfs_fsstress/fsstress.c b/testcases/network/nfs/nfs_fsstress/fsstress.c | ||
147 | index ac91262..a34c416 100644 | ||
148 | --- a/testcases/network/nfs/nfs_fsstress/fsstress.c | ||
149 | +++ b/testcases/network/nfs/nfs_fsstress/fsstress.c | ||
150 | @@ -31,6 +31,7 @@ | ||
151 | */ | ||
152 | |||
153 | #include "global.h" | ||
154 | +#include <limits.h> | ||
155 | |||
156 | #define XFS_ERRTAG_MAX 17 | ||
157 | |||
158 | @@ -1368,7 +1369,7 @@ void allocsp_f(int opno, long r) | ||
159 | pathname_t f; | ||
160 | int fd; | ||
161 | struct flock64 fl; | ||
162 | - __int64_t lr; | ||
163 | + int64_t lr; | ||
164 | off64_t off; | ||
165 | struct stat64 stb; | ||
166 | int v; | ||
167 | @@ -1398,7 +1399,7 @@ void allocsp_f(int opno, long r) | ||
168 | close(fd); | ||
169 | return; | ||
170 | } | ||
171 | - lr = ((__int64_t) random() << 32) + random(); | ||
172 | + lr = ((int64_t) random() << 32) + random(); | ||
173 | off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); | ||
174 | off %= maxfsize; | ||
175 | fl.l_whence = SEEK_SET; | ||
176 | @@ -1519,7 +1520,7 @@ void bulkstat_f(int opno, long r) | ||
177 | __uint64_t last; | ||
178 | int nent; | ||
179 | xfs_bstat_t *t; | ||
180 | - __int64_t total; | ||
181 | + int64_t total; | ||
182 | xfs_fsop_bulkreq_t bsr; | ||
183 | |||
184 | last = 0; | ||
185 | @@ -1708,14 +1709,14 @@ int setdirect(int fd) | ||
186 | |||
187 | void dread_f(int opno, long r) | ||
188 | { | ||
189 | - __int64_t align; | ||
190 | + int64_t align; | ||
191 | char *buf; | ||
192 | struct dioattr diob; | ||
193 | int e; | ||
194 | pathname_t f; | ||
195 | int fd; | ||
196 | size_t len; | ||
197 | - __int64_t lr; | ||
198 | + int64_t lr; | ||
199 | off64_t off; | ||
200 | struct stat64 stb; | ||
201 | int v; | ||
202 | @@ -1775,8 +1776,8 @@ void dread_f(int opno, long r) | ||
203 | return; | ||
204 | } | ||
205 | #endif | ||
206 | - align = (__int64_t) diob.d_miniosz; | ||
207 | - lr = ((__int64_t) random() << 32) + random(); | ||
208 | + align = (int64_t) diob.d_miniosz; | ||
209 | + lr = ((int64_t) random() << 32) + random(); | ||
210 | off = (off64_t) (lr % stb.st_size); | ||
211 | off -= (off % align); | ||
212 | lseek64(fd, off, SEEK_SET); | ||
213 | @@ -1798,14 +1799,14 @@ void dread_f(int opno, long r) | ||
214 | |||
215 | void dwrite_f(int opno, long r) | ||
216 | { | ||
217 | - __int64_t align; | ||
218 | + int64_t align; | ||
219 | char *buf; | ||
220 | struct dioattr diob; | ||
221 | int e; | ||
222 | pathname_t f; | ||
223 | int fd; | ||
224 | size_t len; | ||
225 | - __int64_t lr; | ||
226 | + int64_t lr; | ||
227 | off64_t off; | ||
228 | struct stat64 stb; | ||
229 | int v; | ||
230 | @@ -1854,8 +1855,8 @@ void dwrite_f(int opno, long r) | ||
231 | return; | ||
232 | } | ||
233 | #endif | ||
234 | - align = (__int64_t) diob.d_miniosz; | ||
235 | - lr = ((__int64_t) random() << 32) + random(); | ||
236 | + align = (int64_t) diob.d_miniosz; | ||
237 | + lr = ((int64_t) random() << 32) + random(); | ||
238 | off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); | ||
239 | off -= (off % align); | ||
240 | lseek64(fd, off, SEEK_SET); | ||
241 | @@ -1917,7 +1918,7 @@ void freesp_f(int opno, long r) | ||
242 | pathname_t f; | ||
243 | int fd; | ||
244 | struct flock64 fl; | ||
245 | - __int64_t lr; | ||
246 | + int64_t lr; | ||
247 | off64_t off; | ||
248 | struct stat64 stb; | ||
249 | int v; | ||
250 | @@ -1947,7 +1948,7 @@ void freesp_f(int opno, long r) | ||
251 | close(fd); | ||
252 | return; | ||
253 | } | ||
254 | - lr = ((__int64_t) random() << 32) + random(); | ||
255 | + lr = ((int64_t) random() << 32) + random(); | ||
256 | off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); | ||
257 | off %= maxfsize; | ||
258 | fl.l_whence = SEEK_SET; | ||
259 | @@ -2145,7 +2146,7 @@ void read_f(int opno, long r) | ||
260 | pathname_t f; | ||
261 | int fd; | ||
262 | size_t len; | ||
263 | - __int64_t lr; | ||
264 | + int64_t lr; | ||
265 | off64_t off; | ||
266 | struct stat64 stb; | ||
267 | int v; | ||
268 | @@ -2183,7 +2184,7 @@ void read_f(int opno, long r) | ||
269 | close(fd); | ||
270 | return; | ||
271 | } | ||
272 | - lr = ((__int64_t) random() << 32) + random(); | ||
273 | + lr = ((int64_t) random() << 32) + random(); | ||
274 | off = (off64_t) (lr % stb.st_size); | ||
275 | lseek64(fd, off, SEEK_SET); | ||
276 | len = (random() % (getpagesize() * 32)) + 1; | ||
277 | @@ -2281,7 +2282,7 @@ void resvsp_f(int opno, long r) | ||
278 | pathname_t f; | ||
279 | int fd; | ||
280 | struct flock64 fl; | ||
281 | - __int64_t lr; | ||
282 | + int64_t lr; | ||
283 | off64_t off; | ||
284 | struct stat64 stb; | ||
285 | int v; | ||
286 | @@ -2311,7 +2312,7 @@ void resvsp_f(int opno, long r) | ||
287 | close(fd); | ||
288 | return; | ||
289 | } | ||
290 | - lr = ((__int64_t) random() << 32) + random(); | ||
291 | + lr = ((int64_t) random() << 32) + random(); | ||
292 | off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); | ||
293 | off %= maxfsize; | ||
294 | fl.l_whence = SEEK_SET; | ||
295 | @@ -2428,7 +2429,7 @@ void truncate_f(int opno, long r) | ||
296 | { | ||
297 | int e; | ||
298 | pathname_t f; | ||
299 | - __int64_t lr; | ||
300 | + int64_t lr; | ||
301 | off64_t off; | ||
302 | struct stat64 stb; | ||
303 | int v; | ||
304 | @@ -2449,7 +2450,7 @@ void truncate_f(int opno, long r) | ||
305 | free_pathname(&f); | ||
306 | return; | ||
307 | } | ||
308 | - lr = ((__int64_t) random() << 32) + random(); | ||
309 | + lr = ((int64_t) random() << 32) + random(); | ||
310 | off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); | ||
311 | off %= maxfsize; | ||
312 | e = truncate64_path(&f, off) < 0 ? errno : 0; | ||
313 | @@ -2491,7 +2492,7 @@ void unresvsp_f(int opno, long r) | ||
314 | pathname_t f; | ||
315 | int fd; | ||
316 | struct flock64 fl; | ||
317 | - __int64_t lr; | ||
318 | + int64_t lr; | ||
319 | off64_t off; | ||
320 | struct stat64 stb; | ||
321 | int v; | ||
322 | @@ -2521,7 +2522,7 @@ void unresvsp_f(int opno, long r) | ||
323 | close(fd); | ||
324 | return; | ||
325 | } | ||
326 | - lr = ((__int64_t) random() << 32) + random(); | ||
327 | + lr = ((int64_t) random() << 32) + random(); | ||
328 | off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); | ||
329 | off %= maxfsize; | ||
330 | fl.l_whence = SEEK_SET; | ||
331 | @@ -2543,7 +2544,7 @@ void write_f(int opno, long r) | ||
332 | pathname_t f; | ||
333 | int fd; | ||
334 | size_t len; | ||
335 | - __int64_t lr; | ||
336 | + int64_t lr; | ||
337 | off64_t off; | ||
338 | struct stat64 stb; | ||
339 | int v; | ||
340 | @@ -2573,7 +2574,7 @@ void write_f(int opno, long r) | ||
341 | close(fd); | ||
342 | return; | ||
343 | } | ||
344 | - lr = ((__int64_t) random() << 32) + random(); | ||
345 | + lr = ((int64_t) random() << 32) + random(); | ||
346 | off = (off64_t) (lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); | ||
347 | off %= maxfsize; | ||
348 | lseek64(fd, off, SEEK_SET); | ||
349 | -- | ||
350 | 2.7.0 | ||
351 | |||