Gentoo Archives: gentoo-commits

From: Alexey Shvetsov <alexxy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sys-cluster/lustre/, sys-cluster/lustre/files/
Date: Wed, 29 Jun 2016 10:28:39
Message-Id: 1467196102.4aaa26bb549388f3d1ef568a1f0b7bcfadf93536.alexxy@gentoo
1 commit: 4aaa26bb549388f3d1ef568a1f0b7bcfadf93536
2 Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 29 10:28:22 2016 +0000
4 Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 29 10:28:22 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=4aaa26bb
7
8 sys-cluster/lustre: Add lustre 2.8.0
9
10 Client works with 4.1.x kernels (tested).
11 Also two init scripts added to load and start lnet
12 and load lustre modules
13
14 Package-Manager: portage-2.3.0_rc1
15
16 ...8056-libcfs-Support-for-linux-4.2-kernels.patch | 80 -----
17 ...56-o2iblnd-ib_query_device-removed-in-4.5.patch | 138 --------
18 ...klnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch | 49 ---
19 ...56-llite-use-inode_lock-to-access-i_mutex.patch | 354 ---------------------
20 ...te-inode_operations-interface-changed-in-.patch | 165 ----------
21 ...te-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch | 53 ---
22 ...op-fix-bio_for_each_segment_all-for-newer.patch | 64 ----
23 .../files/0008-Fix-build-error-with-gcc-6.1.patch | 31 --
24 sys-cluster/lustre/files/lnet.initd | 46 +++
25 sys-cluster/lustre/files/lustre-client.initd | 48 +++
26 .../{lustre-2.8.54.ebuild => lustre-2.8.0.ebuild} | 28 +-
27 sys-cluster/lustre/lustre-9999.ebuild | 21 +-
28 12 files changed, 124 insertions(+), 953 deletions(-)
29
30 diff --git a/sys-cluster/lustre/files/0001-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch b/sys-cluster/lustre/files/0001-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch
31 deleted file mode 100644
32 index 4e07906..0000000
33 --- a/sys-cluster/lustre/files/0001-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch
34 +++ /dev/null
35 @@ -1,80 +0,0 @@
36 -From 9b478d607922c9683663f8e317d93b840e528884 Mon Sep 17 00:00:00 2001
37 -From: Dmitry Eremin <dmitry.eremin@×××××.com>
38 -Date: Thu, 5 May 2016 22:08:05 +0300
39 -Subject: [PATCH 1/8] LU-8056 libcfs: Support for linux 4.2 kernels
40 -
41 -In kernel version 4.2 commit df6b35f409af0a8ff1ef62f552b8402f3fef8665
42 -header file i387.h was renamed to fpu/api.h
43 -
44 -Change-Id: Id4f5f6e73f3c2aeac67b5c87b9c1d310a0a50a50
45 -Signed-off-by: Dmitry Eremin <dmitry.eremin@×××××.com>
46 ----
47 - libcfs/autoconf/lustre-libcfs.m4 | 11 +++++++++++
48 - libcfs/libcfs/linux/linux-crypto-crc32c-pclmul.c | 4 ++++
49 - libcfs/libcfs/linux/linux-crypto-crc32pclmul.c | 4 ++++
50 - 3 files changed, 19 insertions(+)
51 -
52 -diff --git a/libcfs/autoconf/lustre-libcfs.m4 b/libcfs/autoconf/lustre-libcfs.m4
53 -index 636d0ed..cc0e184 100644
54 ---- a/libcfs/autoconf/lustre-libcfs.m4
55 -+++ b/libcfs/autoconf/lustre-libcfs.m4
56 -@@ -312,6 +312,16 @@ topology_sibling_cpumask, [
57 - ]) # LIBCFS_HAVE_TOPOLOGY_SIBLING_CPUMASK
58 -
59 - #
60 -+# Kernel version 4.2 commit df6b35f409af0a8ff1ef62f552b8402f3fef8665
61 -+# header file i387.h was renamed to fpu/api.h
62 -+#
63 -+AC_DEFUN([LIBCFS_FPU_API], [
64 -+LB_CHECK_LINUX_HEADER([asm/fpu/api.h], [
65 -+ AC_DEFINE(HAVE_FPU_API_HEADER, 1,
66 -+ [fpu/api.h is present])])
67 -+]) # LIBCFS_FPU_API
68 -+
69 -+#
70 - # LIBCFS_PROG_LINUX
71 - #
72 - # LibCFS linux kernel checks
73 -@@ -350,6 +360,7 @@ LIBCFS_SHRINKER_COUNT
74 - LIBCFS_HLIST_ADD_AFTER
75 - # 4.2
76 - LIBCFS_HAVE_TOPOLOGY_SIBLING_CPUMASK
77 -+LIBCFS_FPU_API
78 - ]) # LIBCFS_PROG_LINUX
79 -
80 - #
81 -diff --git a/libcfs/libcfs/linux/linux-crypto-crc32c-pclmul.c b/libcfs/libcfs/linux/linux-crypto-crc32c-pclmul.c
82 -index 9858db4..fc55ad7 100644
83 ---- a/libcfs/libcfs/linux/linux-crypto-crc32c-pclmul.c
84 -+++ b/libcfs/libcfs/linux/linux-crypto-crc32c-pclmul.c
85 -@@ -30,7 +30,11 @@
86 - #include <crypto/internal/hash.h>
87 - #include <linux/crc32.h>
88 - #include <asm/cpufeature.h>
89 -+#ifdef HAVE_FPU_API_HEADER
90 -+#include <asm/fpu/api.h>
91 -+#else
92 - #include <asm/i387.h>
93 -+#endif
94 - #include <libcfs/libcfs.h>
95 -
96 - #define CHKSUM_BLOCK_SIZE 1
97 -diff --git a/libcfs/libcfs/linux/linux-crypto-crc32pclmul.c b/libcfs/libcfs/linux/linux-crypto-crc32pclmul.c
98 -index 1a609bf..0b3abaf 100644
99 ---- a/libcfs/libcfs/linux/linux-crypto-crc32pclmul.c
100 -+++ b/libcfs/libcfs/linux/linux-crypto-crc32pclmul.c
101 -@@ -32,7 +32,11 @@
102 - #include <crypto/internal/hash.h>
103 - #include <linux/crc32.h>
104 - #include <asm/cpufeature.h>
105 -+#ifdef HAVE_FPU_API_HEADER
106 -+#include <asm/fpu/api.h>
107 -+#else
108 - #include <asm/i387.h>
109 -+#endif
110 - #include <libcfs/libcfs.h>
111 -
112 - #define CHKSUM_BLOCK_SIZE 1
113 ---
114 -2.8.2
115 -
116
117 diff --git a/sys-cluster/lustre/files/0002-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch b/sys-cluster/lustre/files/0002-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch
118 deleted file mode 100644
119 index 5c0fcf9..0000000
120 --- a/sys-cluster/lustre/files/0002-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch
121 +++ /dev/null
122 @@ -1,138 +0,0 @@
123 -From 0242d060692573dcb6f09750a62db1fa0f6d36df Mon Sep 17 00:00:00 2001
124 -From: Li Dongyang <dongyang.li@×××××××.au>
125 -Date: Mon, 16 May 2016 17:18:39 +1000
126 -Subject: [PATCH 2/8] LU-8056 o2iblnd: ib_query_device removed in 4.5
127 -
128 -We should use the cached attributes in ib_device instead of
129 -calling ib_query_device since kernel 4.5
130 -
131 -Linux-commit:182a2da0c768a9ec64abb0d6009667057f1c06af
132 -Linux-commit:cebfe5ca038e2a0f677b41e9682501708ffa2ff3
133 -
134 -Signed-off-by: Li Dongyang <dongyang.li@×××××××.au>
135 -Change-Id: Ie2ab681a3b508f0a1f89d3ff86bf2713b7257e62
136 ----
137 - lnet/autoconf/lustre-lnet.m4 | 22 ++++++++++++++++++++++
138 - lnet/klnds/o2iblnd/o2iblnd.c | 20 ++++++++++++++++++--
139 - 2 files changed, 40 insertions(+), 2 deletions(-)
140 -
141 -diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4
142 -index 05b47db..30ad208 100644
143 ---- a/lnet/autoconf/lustre-lnet.m4
144 -+++ b/lnet/autoconf/lustre-lnet.m4
145 -@@ -460,6 +460,28 @@ AS_IF([test $ENABLEO2IB != "no"], [
146 - AC_DEFINE(HAVE_IB_MAP_MR_SG, 1,
147 - [ib_map_mr_sg exists])
148 - ])
149 -+
150 -+ # ib_query_device() removed in 4.5
151 -+ LB_CHECK_COMPILE([if 'struct ib_device' has member 'attrs'],
152 -+ ib_device.attrs, [
153 -+ #ifdef HAVE_COMPAT_RDMA
154 -+ #undef PACKAGE_NAME
155 -+ #undef PACKAGE_TARNAME
156 -+ #undef PACKAGE_VERSION
157 -+ #undef PACKAGE_STRING
158 -+ #undef PACKAGE_BUGREPORT
159 -+ #undef PACKAGE_URL
160 -+ #include <linux/compat-2.6.h>
161 -+ #endif
162 -+ #include <rdma/ib_verbs.h>
163 -+ ],[
164 -+ struct ib_device dev;
165 -+ struct ib_device_attr dev_attr = {};
166 -+ dev.attrs = dev_attr;
167 -+ ],[
168 -+ AC_DEFINE(HAVE_IB_DEVICE_ATTRS, 1,
169 -+ [struct ib_device.attrs is defined])
170 -+ ])
171 - ]) # ENABLEO2IB != "no"
172 - ]) # LN_CONFIG_O2IB
173 -
174 -diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c
175 -index 92254b8..b174799 100644
176 ---- a/lnet/klnds/o2iblnd/o2iblnd.c
177 -+++ b/lnet/klnds/o2iblnd/o2iblnd.c
178 -@@ -1579,9 +1579,11 @@ kiblnd_create_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t **pp_fpo)
179 - kib_fmr_pool_t *fpo;
180 - int rc;
181 -
182 -+#ifndef HAVE_IB_DEVICE_ATTRS
183 - dev_attr = kmalloc(sizeof(*dev_attr), GFP_KERNEL);
184 - if (!dev_attr)
185 - return -ENOMEM;
186 -+#endif
187 -
188 - LIBCFS_CPT_ALLOC(fpo, lnet_cpt_table(), fps->fps_cpt, sizeof(*fpo));
189 - if (!fpo) {
190 -@@ -1591,12 +1593,16 @@ kiblnd_create_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t **pp_fpo)
191 -
192 - fpo->fpo_hdev = kiblnd_current_hdev(dev);
193 -
194 -+#ifdef HAVE_IB_DEVICE_ATTRS
195 -+ dev_attr = &fpo->fpo_hdev->ibh_ibdev->attrs;
196 -+#else
197 - rc = ib_query_device(fpo->fpo_hdev->ibh_ibdev, dev_attr);
198 - if (rc) {
199 - CERROR("Query device failed for %s: %d\n",
200 - fpo->fpo_hdev->ibh_ibdev->name, rc);
201 - goto out_dev_attr;
202 - }
203 -+#endif
204 -
205 - /* Check for FMR or FastReg support */
206 - fpo->fpo_is_fmr = 0;
207 -@@ -1621,7 +1627,9 @@ kiblnd_create_fmr_pool(kib_fmr_poolset_t *fps, kib_fmr_pool_t **pp_fpo)
208 - if (rc)
209 - goto out_fpo;
210 -
211 -+#ifndef HAVE_IB_DEVICE_ATTRS
212 - kfree(dev_attr);
213 -+#endif
214 - fpo->fpo_deadline = cfs_time_shift(IBLND_POOL_DEADLINE);
215 - fpo->fpo_owner = fps;
216 - *pp_fpo = fpo;
217 -@@ -1633,7 +1641,9 @@ out_fpo:
218 - LIBCFS_FREE(fpo, sizeof(*fpo));
219 -
220 - out_dev_attr:
221 -+#ifndef HAVE_IB_DEVICE_ATTRS
222 - kfree(dev_attr);
223 -+#endif
224 -
225 - return rc;
226 - }
227 -@@ -2462,8 +2472,10 @@ kiblnd_net_init_pools(kib_net_t *net, lnet_ni_t *ni, __u32 *cpts, int ncpts)
228 - static int
229 - kiblnd_hdev_get_attr(kib_hca_dev_t *hdev)
230 - {
231 -- struct ib_device_attr *attr;
232 -- int rc;
233 -+#ifndef HAVE_IB_DEVICE_ATTRS
234 -+ struct ib_device_attr *attr;
235 -+ int rc;
236 -+#endif
237 -
238 - /* It's safe to assume a HCA can handle a page size
239 - * matching that of the native system */
240 -@@ -2471,6 +2483,9 @@ kiblnd_hdev_get_attr(kib_hca_dev_t *hdev)
241 - hdev->ibh_page_size = 1 << PAGE_SHIFT;
242 - hdev->ibh_page_mask = ~((__u64)hdev->ibh_page_size - 1);
243 -
244 -+#ifdef HAVE_IB_DEVICE_ATTRS
245 -+ hdev->ibh_mr_size = hdev->ibh_ibdev->attrs.max_mr_size;
246 -+#else
247 - LIBCFS_ALLOC(attr, sizeof(*attr));
248 - if (attr == NULL) {
249 - CERROR("Out of memory\n");
250 -@@ -2487,6 +2502,7 @@ kiblnd_hdev_get_attr(kib_hca_dev_t *hdev)
251 - CERROR("Failed to query IB device: %d\n", rc);
252 - return rc;
253 - }
254 -+#endif
255 -
256 - if (hdev->ibh_mr_size == ~0ULL) {
257 - hdev->ibh_mr_shift = 64;
258 ---
259 -2.8.2
260 -
261
262 diff --git a/sys-cluster/lustre/files/0003-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch b/sys-cluster/lustre/files/0003-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch
263 deleted file mode 100644
264 index 6101219..0000000
265 --- a/sys-cluster/lustre/files/0003-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch
266 +++ /dev/null
267 @@ -1,49 +0,0 @@
268 -From 6c3f19ba5b6db287980241e4d20be9ac5d0c1293 Mon Sep 17 00:00:00 2001
269 -From: Li Dongyang <dongyang.li@×××××××.au>
270 -Date: Mon, 16 May 2016 17:27:23 +1000
271 -Subject: [PATCH 3/8] LU-8056 socklnd: NETIF_F_ALL_CSUM renamed to
272 - NETIF_F_CSUM_MASK
273 -
274 -In kernel 4.5 NETIF_F_CSUM_MASK got renamed to NETIF_F_CSUM_MASK.
275 -This patch handles the name change.
276 -
277 -Linux-commit:a188222b6ed29404ac2d4232d35d1fe0e77af370
278 -
279 -Signed-off-by: Li Dongyang <dongyang.li@×××××××.au>
280 -Change-Id: Id57505eeca613303c584d3cf74284920a837bb43
281 ----
282 - lnet/klnds/socklnd/socklnd.h | 4 ++++
283 - lnet/klnds/socklnd/socklnd_lib.c | 2 +-
284 - 2 files changed, 5 insertions(+), 1 deletion(-)
285 -
286 -diff --git a/lnet/klnds/socklnd/socklnd.h b/lnet/klnds/socklnd/socklnd.h
287 -index f02003a..54794c0 100644
288 ---- a/lnet/klnds/socklnd/socklnd.h
289 -+++ b/lnet/klnds/socklnd/socklnd.h
290 -@@ -66,6 +66,10 @@
291 - tcp_sendpage(sk, page, offset, size, flags)
292 - #endif /* HAVE_TCP_SENDPAGE_USE_SOCKET */
293 -
294 -+#ifndef NETIF_F_CSUM_MASK
295 -+# define NETIF_F_CSUM_MASK NETIF_F_ALL_CSUM
296 -+#endif
297 -+
298 - /* assume one thread for each connection type */
299 - #define SOCKNAL_NSCHEDS 3
300 - #define SOCKNAL_NSCHEDS_HIGH (SOCKNAL_NSCHEDS << 1)
301 -diff --git a/lnet/klnds/socklnd/socklnd_lib.c b/lnet/klnds/socklnd/socklnd_lib.c
302 -index 9dca0e4..e26db71 100644
303 ---- a/lnet/klnds/socklnd/socklnd_lib.c
304 -+++ b/lnet/klnds/socklnd/socklnd_lib.c
305 -@@ -71,7 +71,7 @@ ksocknal_lib_zc_capable(ksock_conn_t *conn)
306 -
307 - /* ZC if the socket supports scatter/gather and doesn't need software
308 - * checksums */
309 -- return ((caps & NETIF_F_SG) != 0 && (caps & NETIF_F_ALL_CSUM) != 0);
310 -+ return ((caps & NETIF_F_SG) != 0 && (caps & NETIF_F_CSUM_MASK) != 0);
311 - }
312 -
313 - int
314 ---
315 -2.8.2
316 -
317
318 diff --git a/sys-cluster/lustre/files/0004-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch b/sys-cluster/lustre/files/0004-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch
319 deleted file mode 100644
320 index 361061f..0000000
321 --- a/sys-cluster/lustre/files/0004-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch
322 +++ /dev/null
323 @@ -1,354 +0,0 @@
324 -From ab0006e3a3bf5b0ff63f0914a9e7246dfa1729f8 Mon Sep 17 00:00:00 2001
325 -From: Li Dongyang <dongyang.li@×××××××.au>
326 -Date: Mon, 16 May 2016 17:40:55 +1000
327 -Subject: [PATCH 4/8] LU-8056 llite: use inode_lock to access i_mutex
328 -
329 -Linux kernel 4.5 introduced wrappers for i_mutex as the type
330 -of i_mutex will be changed in the future.
331 -This patch prepares us for the upcoming type change. It also
332 -includes a patch from linux kernel removing unused declaration
333 -to make the room for the wrappers mentioned above.
334 -
335 -Note that this patch only touches the llite part. osd-ldiskfs still
336 -calls mutex_{lock,unlock} on i_mutex.
337 -
338 -Linux-commit:57b8f112cfe6622ddddb8c2641206bb5fa8a112d
339 -Linux-commit:5955102c9984fa081b2d570cfac75c97eecf8f3b
340 -
341 -Signed-off-by: Li Dongyang <dongyang.li@×××××××.au>
342 -Change-Id: Ia4c30443cddfaa5232e1dc1519c33c97dba2a271
343 ----
344 - lustre/autoconf/lustre-core.m4 | 20 ++++++++++++++++++++
345 - lustre/include/lustre_compat.h | 6 ++++++
346 - lustre/include/lvfs.h | 4 ++--
347 - lustre/llite/dir.c | 4 ++--
348 - lustre/llite/file.c | 20 ++++++++++----------
349 - lustre/llite/llite_internal.h | 2 --
350 - lustre/llite/llite_lib.c | 8 ++++----
351 - lustre/llite/llite_nfs.c | 4 ++--
352 - lustre/llite/lloop.c | 4 ++--
353 - lustre/llite/rw26.c | 4 ++--
354 - lustre/llite/vvp_io.c | 4 ++--
355 - lustre/llite/vvp_page.c | 4 ++--
356 - 12 files changed, 54 insertions(+), 30 deletions(-)
357 -
358 -diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
359 -index 0d5c599..5554490 100644
360 ---- a/lustre/autoconf/lustre-core.m4
361 -+++ b/lustre/autoconf/lustre-core.m4
362 -@@ -2087,6 +2087,23 @@ key_payload_data_array, [
363 - ]) #LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
364 -
365 - #
366 -+# LC_HAVE_INODE_LOCK
367 -+#
368 -+# 4.5 introduced inode_lock
369 -+#
370 -+AC_DEFUN([LC_HAVE_INODE_LOCK], [
371 -+LB_CHECK_COMPILE([if 'inode_lock' is defined],
372 -+inode_lock, [
373 -+ #include <linux/fs.h>
374 -+],[
375 -+ inode_lock(NULL);
376 -+], [
377 -+ AC_DEFINE(HAVE_INODE_LOCK, 1,
378 -+ [inode_lock is defined])
379 -+])
380 -+]) # LC_HAVE_INODE_LOCK
381 -+
382 -+#
383 - # LC_PROG_LINUX
384 - #
385 - # Lustre linux kernel checks
386 -@@ -2259,6 +2276,9 @@ AC_DEFUN([LC_PROG_LINUX], [
387 - LC_HAVE_QC_MAKE_REQUEST_FN
388 - LC_HAVE_KEY_PAYLOAD_DATA_ARRAY
389 -
390 -+ # 4.5
391 -+ LC_HAVE_INODE_LOCK
392 -+
393 - #
394 - AS_IF([test "x$enable_server" != xno], [
395 - LC_FUNC_DEV_SET_RDONLY
396 -diff --git a/lustre/include/lustre_compat.h b/lustre/include/lustre_compat.h
397 -index d777993..0d303f2 100644
398 ---- a/lustre/include/lustre_compat.h
399 -+++ b/lustre/include/lustre_compat.h
400 -@@ -371,6 +371,12 @@ static inline struct dentry *d_make_root(struct inode *root)
401 - #define ll_vfs_unlink(a, b) vfs_unlink(a, b)
402 - #endif
403 -
404 -+#ifndef HAVE_INODE_LOCK
405 -+# define inode_lock(inode) mutex_lock(&(inode)->i_mutex)
406 -+# define inode_unlock(inode) mutex_unlock(&(inode)->i_mutex)
407 -+# define inode_trylock(inode) mutex_trylock(&(inode)->i_mutex)
408 -+#endif
409 -+
410 - #ifndef HAVE_RADIX_EXCEPTION_ENTRY
411 - static inline int radix_tree_exceptional_entry(void *arg)
412 - {
413 -diff --git a/lustre/include/lvfs.h b/lustre/include/lvfs.h
414 -index be4187f..2bdee77 100644
415 ---- a/lustre/include/lvfs.h
416 -+++ b/lustre/include/lvfs.h
417 -@@ -86,9 +86,9 @@ ll_lookup_one_len(const char *fid_name, struct dentry *dparent,
418 - {
419 - struct dentry *dchild;
420 -
421 -- mutex_lock(&dparent->d_inode->i_mutex);
422 -+ inode_lock(dparent->d_inode);
423 - dchild = lookup_one_len(fid_name, dparent, fid_namelen);
424 -- mutex_unlock(&dparent->d_inode->i_mutex);
425 -+ inode_unlock(dparent->d_inode);
426 -
427 - if (IS_ERR(dchild) || dchild->d_inode == NULL)
428 - return dchild;
429 -diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c
430 -index ec71a19..1f6e02c 100644
431 ---- a/lustre/llite/dir.c
432 -+++ b/lustre/llite/dir.c
433 -@@ -1733,7 +1733,7 @@ static loff_t ll_dir_seek(struct file *file, loff_t offset, int origin)
434 - loff_t ret = -EINVAL;
435 - ENTRY;
436 -
437 -- mutex_lock(&inode->i_mutex);
438 -+ inode_lock(inode);
439 - switch (origin) {
440 - case SEEK_SET:
441 - break;
442 -@@ -1771,7 +1771,7 @@ static loff_t ll_dir_seek(struct file *file, loff_t offset, int origin)
443 - GOTO(out, ret);
444 -
445 - out:
446 -- mutex_unlock(&inode->i_mutex);
447 -+ inode_unlock(inode);
448 - return ret;
449 - }
450 -
451 -diff --git a/lustre/llite/file.c b/lustre/llite/file.c
452 -index cfc01f4..f381d26 100644
453 ---- a/lustre/llite/file.c
454 -+++ b/lustre/llite/file.c
455 -@@ -2162,13 +2162,13 @@ static int ll_hsm_import(struct inode *inode, struct file *file,
456 - ATTR_MTIME | ATTR_MTIME_SET |
457 - ATTR_ATIME | ATTR_ATIME_SET;
458 -
459 -- mutex_lock(&inode->i_mutex);
460 -+ inode_lock(inode);
461 -
462 - rc = ll_setattr_raw(file->f_path.dentry, attr, true);
463 - if (rc == -ENODATA)
464 - rc = 0;
465 -
466 -- mutex_unlock(&inode->i_mutex);
467 -+ inode_unlock(inode);
468 -
469 - out:
470 - if (hss != NULL)
471 -@@ -2215,9 +2215,9 @@ static int ll_file_futimes_3(struct file *file, const struct ll_futimes_3 *lfu)
472 - if (!S_ISREG(inode->i_mode))
473 - RETURN(-EINVAL);
474 -
475 -- mutex_lock(&inode->i_mutex);
476 -+ inode_lock(inode);
477 - rc = ll_setattr_raw(file->f_path.dentry, &ia, false);
478 -- mutex_unlock(&inode->i_mutex);
479 -+ inode_unlock(inode);
480 -
481 - RETURN(rc);
482 - }
483 -@@ -2715,9 +2715,9 @@ generic_file_llseek_size(struct file *file, loff_t offset, int origin,
484 - * SEEK_CURs. Note that parallel writes and reads behave
485 - * like SEEK_SET.
486 - */
487 -- mutex_lock(&inode->i_mutex);
488 -+ inode_lock(inode);
489 - offset = llseek_execute(file, file->f_pos + offset, maxsize);
490 -- mutex_unlock(&inode->i_mutex);
491 -+ inode_unlock(inode);
492 - return offset;
493 - case SEEK_DATA:
494 - /*
495 -@@ -2875,7 +2875,7 @@ int ll_fsync(struct file *file, struct dentry *dentry, int datasync)
496 -
497 - #ifdef HAVE_FILE_FSYNC_4ARGS
498 - rc = filemap_write_and_wait_range(inode->i_mapping, start, end);
499 -- mutex_lock(&inode->i_mutex);
500 -+ inode_lock(inode);
501 - #else
502 - /* fsync's caller has already called _fdata{sync,write}, we want
503 - * that IO to finish before calling the osc and mdc sync methods */
504 -@@ -2913,7 +2913,7 @@ int ll_fsync(struct file *file, struct dentry *dentry, int datasync)
505 - }
506 -
507 - #ifdef HAVE_FILE_FSYNC_4ARGS
508 -- mutex_unlock(&inode->i_mutex);
509 -+ inode_unlock(inode);
510 - #endif
511 - RETURN(rc);
512 - }
513 -@@ -3146,7 +3146,7 @@ int ll_migrate(struct inode *parent, struct file *file, int mdtidx,
514 - if (child_inode == parent->i_sb->s_root->d_inode)
515 - GOTO(out_iput, rc = -EINVAL);
516 -
517 -- mutex_lock(&child_inode->i_mutex);
518 -+ inode_lock(child_inode);
519 - op_data->op_fid3 = *ll_inode2fid(child_inode);
520 - if (!fid_is_sane(&op_data->op_fid3)) {
521 - CERROR("%s: migrate %s, but FID "DFID" is insane\n",
522 -@@ -3224,7 +3224,7 @@ out_close:
523 - if (rc == 0)
524 - clear_nlink(child_inode);
525 - out_unlock:
526 -- mutex_unlock(&child_inode->i_mutex);
527 -+ inode_unlock(child_inode);
528 - out_iput:
529 - iput(child_inode);
530 - out_free:
531 -diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h
532 -index 20956f4..9c9979e 100644
533 ---- a/lustre/llite/llite_internal.h
534 -+++ b/lustre/llite/llite_internal.h
535 -@@ -693,8 +693,6 @@ struct ll_file_data {
536 - struct list_head fd_lccs; /* list of ll_cl_context */
537 - };
538 -
539 --extern spinlock_t inode_lock;
540 --
541 - extern struct proc_dir_entry *proc_lustre_fs_root;
542 -
543 - static inline struct inode *ll_info2i(struct ll_inode_info *lli)
544 -diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c
545 -index c488fc2..9a8c69b 100644
546 ---- a/lustre/llite/llite_lib.c
547 -+++ b/lustre/llite/llite_lib.c
548 -@@ -1545,10 +1545,10 @@ static int ll_md_setattr(struct dentry *dentry, struct md_op_data *op_data)
549 - * cache is not cleared yet. */
550 - op_data->op_attr.ia_valid &= ~(TIMES_SET_FLAGS | ATTR_SIZE);
551 - if (S_ISREG(inode->i_mode))
552 -- mutex_lock(&inode->i_mutex);
553 -+ inode_lock(inode);
554 - rc = simple_setattr(dentry, &op_data->op_attr);
555 - if (S_ISREG(inode->i_mode))
556 -- mutex_unlock(&inode->i_mutex);
557 -+ inode_unlock(inode);
558 - op_data->op_attr.ia_valid = ia_valid;
559 -
560 - rc = ll_update_inode(inode, &md);
561 -@@ -1637,7 +1637,7 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import)
562 - if (S_ISREG(inode->i_mode)) {
563 - if (attr->ia_valid & ATTR_SIZE)
564 - inode_dio_write_done(inode);
565 -- mutex_unlock(&inode->i_mutex);
566 -+ inode_unlock(inode);
567 - }
568 -
569 - /* We always do an MDS RPC, even if we're only changing the size;
570 -@@ -1714,7 +1714,7 @@ out:
571 - ll_finish_md_op_data(op_data);
572 -
573 - if (S_ISREG(inode->i_mode)) {
574 -- mutex_lock(&inode->i_mutex);
575 -+ inode_lock(inode);
576 - if ((attr->ia_valid & ATTR_SIZE) && !hsm_import)
577 - inode_dio_wait(inode);
578 - }
579 -diff --git a/lustre/llite/llite_nfs.c b/lustre/llite/llite_nfs.c
580 -index 9e19e78..bc238f5 100644
581 ---- a/lustre/llite/llite_nfs.c
582 -+++ b/lustre/llite/llite_nfs.c
583 -@@ -247,13 +247,13 @@ static int ll_get_name(struct dentry *dentry, char *name,
584 - GOTO(out, rc = PTR_ERR(op_data));
585 -
586 - op_data->op_max_pages = ll_i2sbi(dir)->ll_md_brw_pages;
587 -- mutex_lock(&dir->i_mutex);
588 -+ inode_lock(dir);
589 - #ifdef HAVE_DIR_CONTEXT
590 - rc = ll_dir_read(dir, &pos, op_data, &lgd.ctx);
591 - #else
592 - rc = ll_dir_read(dir, &pos, op_data, &lgd, ll_nfs_get_name_filldir);
593 - #endif
594 -- mutex_unlock(&dir->i_mutex);
595 -+ inode_unlock(dir);
596 - ll_finish_md_op_data(op_data);
597 - if (!rc && !lgd.lgd_found)
598 - rc = -ENOENT;
599 -diff --git a/lustre/llite/lloop.c b/lustre/llite/lloop.c
600 -index b8ae0b5..64318ca 100644
601 ---- a/lustre/llite/lloop.c
602 -+++ b/lustre/llite/lloop.c
603 -@@ -277,9 +277,9 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
604 - * be asked to write less pages once, this purely depends on
605 - * implementation. Anyway, we should be careful to avoid deadlocking.
606 - */
607 -- mutex_lock(&inode->i_mutex);
608 -+ inode_lock(inode);
609 - bytes = ll_direct_rw_pages(env, io, rw, inode, pvec);
610 -- mutex_unlock(&inode->i_mutex);
611 -+ inode_unlock(inode);
612 - cl_io_fini(env, io);
613 - return (bytes == pvec->ldp_size) ? 0 : (int)bytes;
614 - }
615 -diff --git a/lustre/llite/rw26.c b/lustre/llite/rw26.c
616 -index d9482b2..3f02754 100644
617 ---- a/lustre/llite/rw26.c
618 -+++ b/lustre/llite/rw26.c
619 -@@ -389,7 +389,7 @@ ll_direct_IO(
620 - * 1. Need inode mutex to operate transient pages.
621 - */
622 - if (iov_iter_rw(iter) == READ)
623 -- mutex_lock(&inode->i_mutex);
624 -+ inode_lock(inode);
625 -
626 - while (iov_iter_count(iter)) {
627 - struct page **pages;
628 -@@ -440,7 +440,7 @@ ll_direct_IO(
629 - }
630 - out:
631 - if (iov_iter_rw(iter) == READ)
632 -- mutex_unlock(&inode->i_mutex);
633 -+ inode_unlock(inode);
634 -
635 - if (tot_bytes > 0) {
636 - struct vvp_io *vio = vvp_env_io(env);
637 -diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c
638 -index 8a81b83..a48a0b0 100644
639 ---- a/lustre/llite/vvp_io.c
640 -+++ b/lustre/llite/vvp_io.c
641 -@@ -661,7 +661,7 @@ static int vvp_io_setattr_start(const struct lu_env *env,
642 - struct inode *inode = vvp_object_inode(io->ci_obj);
643 - struct ll_inode_info *lli = ll_i2info(inode);
644 -
645 -- mutex_lock(&inode->i_mutex);
646 -+ inode_lock(inode);
647 - if (cl_io_is_trunc(io)) {
648 - down_write(&lli->lli_trunc_sem);
649 - inode_dio_wait(inode);
650 -@@ -687,7 +687,7 @@ static void vvp_io_setattr_end(const struct lu_env *env,
651 - inode_dio_write_done(inode);
652 - up_write(&lli->lli_trunc_sem);
653 - }
654 -- mutex_unlock(&inode->i_mutex);
655 -+ inode_unlock(inode);
656 - }
657 -
658 - static void vvp_io_setattr_fini(const struct lu_env *env,
659 -diff --git a/lustre/llite/vvp_page.c b/lustre/llite/vvp_page.c
660 -index 39f093b..e2afea4 100644
661 ---- a/lustre/llite/vvp_page.c
662 -+++ b/lustre/llite/vvp_page.c
663 -@@ -468,9 +468,9 @@ static int vvp_transient_page_is_vmlocked(const struct lu_env *env,
664 - struct inode *inode = vvp_object_inode(slice->cpl_obj);
665 - int locked;
666 -
667 -- locked = !mutex_trylock(&inode->i_mutex);
668 -+ locked = !inode_trylock(inode);
669 - if (!locked)
670 -- mutex_unlock(&inode->i_mutex);
671 -+ inode_unlock(inode);
672 - return locked ? -EBUSY : -ENODATA;
673 - }
674 -
675 ---
676 -2.8.2
677 -
678
679 diff --git a/sys-cluster/lustre/files/0005-LU-8056-llite-inode_operations-interface-changed-in-.patch b/sys-cluster/lustre/files/0005-LU-8056-llite-inode_operations-interface-changed-in-.patch
680 deleted file mode 100644
681 index 72af637..0000000
682 --- a/sys-cluster/lustre/files/0005-LU-8056-llite-inode_operations-interface-changed-in-.patch
683 +++ /dev/null
684 @@ -1,165 +0,0 @@
685 -From 0ec0c36d7a0ec5636e19eece4d5df7615f656c23 Mon Sep 17 00:00:00 2001
686 -From: Li Dongyang <dongyang.li@×××××××.au>
687 -Date: Mon, 16 May 2016 21:57:31 +1000
688 -Subject: [PATCH 5/8] LU-8056 llite: inode_operations interface changed in 4.5
689 -
690 -Linux kernel 4.5 replaced follow_link() with get_link()
691 -while put_link() is removed.
692 -This patch handles the API change.
693 -
694 -Linux-commit:6b2553918d8b4e6de9853fd6315bec7271a2e592
695 -Linux-commit:fceef393a538134f03b778c5d2519e670269342f
696 -
697 -Signed-off-by: Li Dongyang <dongyang.li@×××××××.au>
698 -Change-Id: Ia9b8c9b855ed5ab7a428a370074b8801e34d3f99
699 ----
700 - lustre/autoconf/lustre-core.m4 | 20 +++++++++++++++
701 - lustre/llite/dcache.c | 4 +++
702 - lustre/llite/symlink.c | 56 +++++++++++++++++++++++++++++++++++-------
703 - 3 files changed, 71 insertions(+), 9 deletions(-)
704 -
705 -diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
706 -index 5554490..ec18055 100644
707 ---- a/lustre/autoconf/lustre-core.m4
708 -+++ b/lustre/autoconf/lustre-core.m4
709 -@@ -2104,6 +2104,25 @@ inode_lock, [
710 - ]) # LC_HAVE_INODE_LOCK
711 -
712 - #
713 -+# LC_HAVE_IOP_GET_LINK
714 -+#
715 -+# 4.5 vfs replaced iop->follow_link with
716 -+# iop->get_link
717 -+#
718 -+AC_DEFUN([LC_HAVE_IOP_GET_LINK], [
719 -+LB_CHECK_COMPILE([if 'iop' has 'get_link'],
720 -+inode_ops_get_link, [
721 -+ #include <linux/fs.h>
722 -+],[
723 -+ struct inode_operations iop;
724 -+ iop.get_link = NULL;
725 -+],[
726 -+ AC_DEFINE(HAVE_IOP_GET_LINK, 1,
727 -+ [have iop get_link])
728 -+])
729 -+]) # LC_HAVE_IOP_GET_LINK
730 -+
731 -+#
732 - # LC_PROG_LINUX
733 - #
734 - # Lustre linux kernel checks
735 -@@ -2278,6 +2297,7 @@ AC_DEFUN([LC_PROG_LINUX], [
736 -
737 - # 4.5
738 - LC_HAVE_INODE_LOCK
739 -+ LC_HAVE_IOP_GET_LINK
740 -
741 - #
742 - AS_IF([test "x$enable_server" != xno], [
743 -diff --git a/lustre/llite/dcache.c b/lustre/llite/dcache.c
744 -index 8c3db0a..3168ca8 100644
745 ---- a/lustre/llite/dcache.c
746 -+++ b/lustre/llite/dcache.c
747 -@@ -331,7 +331,11 @@ static int ll_revalidate_dentry(struct dentry *dentry,
748 - return 1;
749 -
750 - /* Symlink - always valid as long as the dentry was found */
751 -+#ifdef HAVE_IOP_GET_LINK
752 -+ if (dentry->d_inode && dentry->d_inode->i_op->get_link)
753 -+#else
754 - if (dentry->d_inode && dentry->d_inode->i_op->follow_link)
755 -+#endif
756 - return 1;
757 -
758 - /* Last path component lookup for open or create - we always
759 -diff --git a/lustre/llite/symlink.c b/lustre/llite/symlink.c
760 -index e635037..70577ce 100644
761 ---- a/lustre/llite/symlink.c
762 -+++ b/lustre/llite/symlink.c
763 -@@ -122,6 +122,20 @@ failed:
764 - }
765 -
766 - #ifdef HAVE_SYMLINK_OPS_USE_NAMEIDATA
767 -+static void ll_put_link(struct dentry *dentry,
768 -+ struct nameidata *nd, void *cookie)
769 -+#else
770 -+# ifdef HAVE_IOP_GET_LINK
771 -+static void ll_put_link(void *cookie)
772 -+# else
773 -+static void ll_put_link(struct inode *unused, void *cookie)
774 -+# endif
775 -+#endif
776 -+{
777 -+ ptlrpc_req_finished(cookie);
778 -+}
779 -+
780 -+#ifdef HAVE_SYMLINK_OPS_USE_NAMEIDATA
781 - static void *ll_follow_link(struct dentry *dentry, struct nameidata *nd)
782 - {
783 - struct inode *inode = dentry->d_inode;
784 -@@ -156,6 +170,34 @@ static void *ll_follow_link(struct dentry *dentry, struct nameidata *nd)
785 - RETURN(request);
786 - }
787 - #else
788 -+# ifdef HAVE_IOP_GET_LINK
789 -+static const char *ll_get_link(struct dentry *dentry,
790 -+ struct inode *inode,
791 -+ struct delayed_call *done)
792 -+{
793 -+ struct ptlrpc_request *request;
794 -+ char *symname = NULL;
795 -+ int rc;
796 -+
797 -+ ENTRY;
798 -+ CDEBUG(D_VFSTRACE, "VFS Op\n");
799 -+ if (!dentry)
800 -+ RETURN(ERR_PTR(-ECHILD));
801 -+ ll_inode_size_lock(inode);
802 -+ rc = ll_readlink_internal(inode, &request, &symname);
803 -+ ll_inode_size_unlock(inode);
804 -+ if (rc < 0) {
805 -+ ptlrpc_req_finished(request);
806 -+ return ERR_PTR(rc);
807 -+ }
808 -+
809 -+ /* symname may contain a pointer to the request message buffer,
810 -+ * we delay request releasing then.
811 -+ */
812 -+ set_delayed_call(done, ll_put_link, request);
813 -+ RETURN(symname);
814 -+}
815 -+# else
816 - static const char *ll_follow_link(struct dentry *dentry, void **cookie)
817 - {
818 - struct inode *inode = d_inode(dentry);
819 -@@ -179,22 +221,18 @@ static const char *ll_follow_link(struct dentry *dentry, void **cookie)
820 - *cookie = request;
821 - RETURN(symname);
822 - }
823 -+# endif /* HAVE_IOP_GET_LINK */
824 - #endif /* HAVE_SYMLINK_OPS_USE_NAMEIDATA */
825 -
826 --#ifdef HAVE_SYMLINK_OPS_USE_NAMEIDATA
827 --static void ll_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
828 --#else
829 --static void ll_put_link(struct inode *unused, void *cookie)
830 --#endif
831 --{
832 -- ptlrpc_req_finished(cookie);
833 --}
834 --
835 - struct inode_operations ll_fast_symlink_inode_operations = {
836 - .readlink = generic_readlink,
837 - .setattr = ll_setattr,
838 -+#ifdef HAVE_IOP_GET_LINK
839 -+ .get_link = ll_get_link,
840 -+#else
841 - .follow_link = ll_follow_link,
842 - .put_link = ll_put_link,
843 -+#endif
844 - .getattr = ll_getattr,
845 - .permission = ll_inode_permission,
846 - .setxattr = ll_setxattr,
847 ---
848 -2.8.2
849 -
850
851 diff --git a/sys-cluster/lustre/files/0006-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch b/sys-cluster/lustre/files/0006-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch
852 deleted file mode 100644
853 index 6879248..0000000
854 --- a/sys-cluster/lustre/files/0006-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch
855 +++ /dev/null
856 @@ -1,53 +0,0 @@
857 -From 103a363fa53f691d2bdbb38280e44d1c830c7322 Mon Sep 17 00:00:00 2001
858 -From: Li Dongyang <dongyang.li@×××××××.au>
859 -Date: Mon, 16 May 2016 22:07:54 +1000
860 -Subject: [PATCH 6/8] LU-8056 llite: POSIX_ACL_XATTR_{ACCESS,DEFAULT} removed
861 - in 4.5
862 -
863 -POSIX_ACL_XATTR_{ACCESS,DEFAULT} are duplicate
864 -xattr name definitions and they are replaced by
865 -XATTR_NAME_POSIX_ACL_{ACCESS,DEFAULT} since Linux kernel 4.5
866 -
867 -Linux-commit:97d79299223baab330b194437e676d301f12d5f6
868 -
869 -Signed-off-by: Li Dongyang <dongyang.li@×××××××.au>
870 -Change-Id: I9e031d3ac77a4bf1832d932c1cab7032e4572445
871 ----
872 - lustre/llite/xattr.c | 12 ++++++++++--
873 - 1 file changed, 10 insertions(+), 2 deletions(-)
874 -
875 -diff --git a/lustre/llite/xattr.c b/lustre/llite/xattr.c
876 -index 6e282af..d30cede 100644
877 ---- a/lustre/llite/xattr.c
878 -+++ b/lustre/llite/xattr.c
879 -@@ -57,6 +57,14 @@
880 - #define XATTR_NAME_EVM "security.evm"
881 - #endif
882 -
883 -+#ifndef XATTR_NAME_POSIX_ACL_ACCESS
884 -+# define XATTR_NAME_POSIX_ACL_ACCESS POSIX_ACL_XATTR_ACCESS
885 -+#endif
886 -+
887 -+#ifndef XATTR_NAME_POSIX_ACL_DEFAULT
888 -+# define XATTR_NAME_POSIX_ACL_DEFAULT POSIX_ACL_XATTR_DEFAULT
889 -+#endif
890 -+
891 - #define XATTR_USER_T (1)
892 - #define XATTR_TRUSTED_T (2)
893 - #define XATTR_SECURITY_T (3)
894 -@@ -68,10 +76,10 @@
895 - static
896 - int get_xattr_type(const char *name)
897 - {
898 -- if (!strcmp(name, POSIX_ACL_XATTR_ACCESS))
899 -+ if (!strcmp(name, XATTR_NAME_POSIX_ACL_ACCESS))
900 - return XATTR_ACL_ACCESS_T;
901 -
902 -- if (!strcmp(name, POSIX_ACL_XATTR_DEFAULT))
903 -+ if (!strcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT))
904 - return XATTR_ACL_DEFAULT_T;
905 -
906 - if (!strncmp(name, XATTR_USER_PREFIX,
907 ---
908 -2.8.2
909 -
910
911 diff --git a/sys-cluster/lustre/files/0007-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch b/sys-cluster/lustre/files/0007-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch
912 deleted file mode 100644
913 index be495b9..0000000
914 --- a/sys-cluster/lustre/files/0007-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch
915 +++ /dev/null
916 @@ -1,64 +0,0 @@
917 -From 028c4416216af21dcae53f7daa4f549d0c2bad4f Mon Sep 17 00:00:00 2001
918 -From: James Simmons <uja.ornl@×××××.com>
919 -Date: Fri, 3 Jun 2016 14:09:54 -0400
920 -Subject: [PATCH 7/8] LU-8056 lloop: fix bio_for_each_segment_all for newer
921 - kernels
922 -
923 -Lustre patch http://review.whamcloud.com/20478 back ported
924 -bio_for_each_segment_all from newer kernels but support
925 -for newer kernels was done incorrectly. Update the code to
926 -work with newer kernels.
927 -
928 -Change-Id: I6a926320f80113169a13d2319190721c83d58b1d
929 -Signed-off-by: James Simmons <uja.ornl@×××××.com>
930 ----
931 - lustre/llite/lloop.c | 15 +--------------
932 - 1 file changed, 1 insertion(+), 14 deletions(-)
933 -
934 -diff --git a/lustre/llite/lloop.c b/lustre/llite/lloop.c
935 -index 64318ca..64da8c2 100644
936 ---- a/lustre/llite/lloop.c
937 -+++ b/lustre/llite/lloop.c
938 -@@ -193,13 +193,8 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
939 - struct cl_object *obj = ll_i2info(inode)->lli_clob;
940 - pgoff_t offset;
941 - int ret;
942 --#ifdef HAVE_BVEC_ITER
943 -- struct bvec_iter iter;
944 -- struct bio_vec bvec;
945 --#else
946 - int iter;
947 - struct bio_vec *bvec;
948 --#endif
949 - int rw;
950 - size_t page_count = 0;
951 - struct bio *bio;
952 -@@ -226,16 +221,9 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
953 -
954 - #ifdef HAVE_BVEC_ITER
955 - offset = (pgoff_t)(bio->bi_iter.bi_sector << 9) + lo->lo_offset;
956 -- bio_for_each_segment_all(bvec, bio, iter) {
957 -- BUG_ON(bvec.bv_offset != 0);
958 -- BUG_ON(bvec.bv_len != PAGE_CACHE_SIZE);
959 --
960 -- pages[page_count] = bvec.bv_page;
961 -- offsets[page_count] = offset;
962 -- page_count++;
963 -- offset += bvec.bv_len;
964 - #else
965 - offset = (pgoff_t)(bio->bi_sector << 9) + lo->lo_offset;
966 -+#endif
967 - bio_for_each_segment_all(bvec, bio, iter) {
968 - BUG_ON(bvec->bv_offset != 0);
969 - BUG_ON(bvec->bv_len != PAGE_CACHE_SIZE);
970 -@@ -244,7 +232,6 @@ static int do_bio_lustrebacked(struct lloop_device *lo, struct bio *head)
971 - offsets[page_count] = offset;
972 - page_count++;
973 - offset += bvec->bv_len;
974 --#endif
975 - }
976 - LASSERT(page_count <= LLOOP_MAX_SEGMENTS);
977 - }
978 ---
979 -2.8.2
980 -
981
982 diff --git a/sys-cluster/lustre/files/0008-Fix-build-error-with-gcc-6.1.patch b/sys-cluster/lustre/files/0008-Fix-build-error-with-gcc-6.1.patch
983 deleted file mode 100644
984 index a6e167f..0000000
985 --- a/sys-cluster/lustre/files/0008-Fix-build-error-with-gcc-6.1.patch
986 +++ /dev/null
987 @@ -1,31 +0,0 @@
988 -From 476bd7023e01ab844bcdb81ca2f43e3a07f91b3d Mon Sep 17 00:00:00 2001
989 -From: Alexey Shvetsov <alexxy@g.o>
990 -Date: Mon, 13 Jun 2016 14:22:04 +0300
991 -Subject: [PATCH 8/8] Fix build error with gcc-6.1
992 -
993 -Signed-off-by: Alexey Shvetsov <alexxy@g.o>
994 ----
995 - lustre/utils/liblustreapi_hsm.c | 3 ++-
996 - 1 file changed, 2 insertions(+), 1 deletion(-)
997 -
998 -diff --git a/lustre/utils/liblustreapi_hsm.c b/lustre/utils/liblustreapi_hsm.c
999 -index 0b12f37..2f5b95d 100644
1000 ---- a/lustre/utils/liblustreapi_hsm.c
1001 -+++ b/lustre/utils/liblustreapi_hsm.c
1002 -@@ -429,11 +429,12 @@ static int llapi_hsm_log_ct_progress(struct hsm_copyaction_private **phcp,
1003 - goto err;
1004 - }
1005 -
1006 -- if (progress_type == CT_RUNNING)
1007 -+ if (progress_type == CT_RUNNING) {
1008 - rc = llapi_json_add_item(&json_items, "current_bytes",
1009 - LLAPI_JSON_BIGNUM, &current);
1010 - if (rc < 0)
1011 - goto err;
1012 -+ }
1013 -
1014 - cancel:
1015 - rc = llapi_json_add_item(&json_items, "event_type", LLAPI_JSON_STRING,
1016 ---
1017 -2.8.2
1018 -
1019
1020 diff --git a/sys-cluster/lustre/files/lnet.initd b/sys-cluster/lustre/files/lnet.initd
1021 new file mode 100755
1022 index 0000000..75bc4b1
1023 --- /dev/null
1024 +++ b/sys-cluster/lustre/files/lnet.initd
1025 @@ -0,0 +1,46 @@
1026 +#!/sbin/openrc-run
1027 +# Copyright 1999-2016 Gentoo Foundation
1028 +# Distributed under the terms of the GNU General Public License v2
1029 +# $Id$
1030 +
1031 +description="Loads lnet module and configures network."
1032 +
1033 +depend() {
1034 + need net
1035 + after bootmisc
1036 +}
1037 +
1038 +start() {
1039 + if [ "${RC_CMD}" = "restart" ];
1040 + then
1041 + einfo "Restarting..."
1042 + fi
1043 +
1044 + ebegin "Loading LNet modules:"
1045 + modprobe lnet
1046 + eend $*
1047 +
1048 + ebegin "Bringing up LNet"
1049 + lnetctl lnet configure --all
1050 + eend $*
1051 +}
1052 +
1053 +stop() {
1054 + local LNETMODULES=( "ko2iblnd" "lnet" "libcfs" )
1055 + ebegin "Bringing down LNet"
1056 + lnetctl lnet unconfigure --all
1057 + eend $*
1058 +
1059 + einfo "Unloading LNet modules:"
1060 + for mod in ${LNETMODULES[@]}; do
1061 + ebegin "... ${mod}"
1062 + modprobe -r ${mod}
1063 + eend $*
1064 + done
1065 +}
1066 +
1067 +status()
1068 +{
1069 + einfo "LNet status:"
1070 + lnetctl net show
1071 +}
1072
1073 diff --git a/sys-cluster/lustre/files/lustre-client.initd b/sys-cluster/lustre/files/lustre-client.initd
1074 new file mode 100755
1075 index 0000000..1736597
1076 --- /dev/null
1077 +++ b/sys-cluster/lustre/files/lustre-client.initd
1078 @@ -0,0 +1,48 @@
1079 +#!/sbin/openrc-run
1080 +# Copyright 1999-2016 Gentoo Foundation
1081 +# Distributed under the terms of the GNU General Public License v2
1082 +# $Id$
1083 +
1084 +description="Load lustre modules"
1085 +
1086 +extra_commands="checkmodule"
1087 +
1088 +depend() {
1089 + need lnet
1090 + before netmount
1091 +}
1092 +
1093 +checkmodule() {
1094 + local LOADED="$(lctl modules | awk -F"/" /lustre/'{print $2F}')"
1095 + for mod in ${LOADED[@]}; do
1096 + ewarn "Module is still loaded: ${mod}"
1097 + eend $*
1098 + done
1099 +}
1100 +
1101 +start() {
1102 + if [ "${RC_CMD}" = "restart" ];
1103 + then
1104 + einfo "Restarting Lustre..."
1105 + checkmodule
1106 + fi
1107 +
1108 + ebegin "Loading Lustre modules..."
1109 + modprobe lustre
1110 + eend $*
1111 +}
1112 +
1113 +stop() {
1114 + local LMODULES=( "lustre" "osc" "mgc" "lmv" "fld" "mdc" "fid" "lov" "ptlrpc" )
1115 + ebegin "Trying to unmount all Lustre fs"
1116 + umount -a -t lustre
1117 + eend $*
1118 + einfo "Unloading lustre modules:"
1119 + for mod in ${LMODULES[@]}; do
1120 + ebegin "... ${mod}"
1121 + modprobe -r ${mod}
1122 + eend $*
1123 + done
1124 +
1125 + checkmodule
1126 +}
1127
1128 diff --git a/sys-cluster/lustre/lustre-2.8.54.ebuild b/sys-cluster/lustre/lustre-2.8.0.ebuild
1129 similarity index 73%
1130 rename from sys-cluster/lustre/lustre-2.8.54.ebuild
1131 rename to sys-cluster/lustre/lustre-2.8.0.ebuild
1132 index 24b1bc2..47f4c15 100644
1133 --- a/sys-cluster/lustre/lustre-2.8.54.ebuild
1134 +++ b/sys-cluster/lustre/lustre-2.8.0.ebuild
1135 @@ -13,10 +13,13 @@ if [[ $PV = *9999* ]]; then
1136 EGIT_BRANCH="master"
1137 else
1138 KEYWORDS="~amd64"
1139 - EGIT_TAG="${PV}"
1140 + EGIT_COMMIT="${PV}"
1141 fi
1142
1143 -inherit git-r3 autotools linux-mod toolchain-funcs udev flag-o-matic
1144 +SUPPORTED_KV_MAJOR=4
1145 +SUPPORTED_KV_MINOR=1
1146 +
1147 +inherit git-r3 autotools linux-info linux-mod toolchain-funcs udev flag-o-matic
1148
1149 DESCRIPTION="Lustre is a parallel distributed file system"
1150 HOMEPAGE="http://wiki.whamcloud.com/"
1151 @@ -44,16 +47,13 @@ REQUIRED_USE="
1152 client? ( modules )
1153 server? ( modules )"
1154
1155 -PATCHES=(
1156 - "${FILESDIR}/0001-LU-8056-libcfs-Support-for-linux-4.2-kernels.patch"
1157 - "${FILESDIR}/0002-LU-8056-o2iblnd-ib_query_device-removed-in-4.5.patch"
1158 - "${FILESDIR}/0003-LU-8056-socklnd-NETIF_F_ALL_CSUM-renamed-to-NETIF_F_.patch"
1159 - "${FILESDIR}/0004-LU-8056-llite-use-inode_lock-to-access-i_mutex.patch"
1160 - "${FILESDIR}/0005-LU-8056-llite-inode_operations-interface-changed-in-.patch"
1161 - "${FILESDIR}/0006-LU-8056-llite-POSIX_ACL_XATTR_-ACCESS-DEFAULT-remove.patch"
1162 - "${FILESDIR}/0007-LU-8056-lloop-fix-bio_for_each_segment_all-for-newer.patch"
1163 - "${FILESDIR}/0008-Fix-build-error-with-gcc-6.1.patch"
1164 - )
1165 +pkg_pretend() {
1166 + KVSUPP=${SUPPORTED_KV_MAJOR}.${SUPPORTED_KV_MINOR}.x
1167 + if kernel_is gt ${SUPPORTED_KV_MAJOR} ${SUPPORTED_KV_MINOR}; then
1168 + eerror "Unsupported kernel version! Latest supported one is ${KVSUPP}"
1169 + die
1170 + fi
1171 +}
1172
1173 pkg_setup() {
1174 filter-mfpmath sse
1175 @@ -65,7 +65,7 @@ pkg_setup() {
1176 }
1177
1178 src_prepare() {
1179 - if [ ! -z ${#PATCHES[0]} ]; then
1180 + if [ ${#PATCHES[0]} -ne 0 ]; then
1181 epatch ${PATCHES[@]}
1182 fi
1183 eapply_user
1184 @@ -111,4 +111,6 @@ src_compile() {
1185
1186 src_install() {
1187 default
1188 + newinitd "${FILESDIR}/lnet.initd" lnet
1189 + newinitd "${FILESDIR}/lustre-client.initd" lustre-client
1190 }
1191
1192 diff --git a/sys-cluster/lustre/lustre-9999.ebuild b/sys-cluster/lustre/lustre-9999.ebuild
1193 index d928ee3..47f4c15 100644
1194 --- a/sys-cluster/lustre/lustre-9999.ebuild
1195 +++ b/sys-cluster/lustre/lustre-9999.ebuild
1196 @@ -13,10 +13,13 @@ if [[ $PV = *9999* ]]; then
1197 EGIT_BRANCH="master"
1198 else
1199 KEYWORDS="~amd64"
1200 - EGIT_TAG="${PV}"
1201 + EGIT_COMMIT="${PV}"
1202 fi
1203
1204 -inherit git-r3 autotools linux-mod toolchain-funcs udev flag-o-matic
1205 +SUPPORTED_KV_MAJOR=4
1206 +SUPPORTED_KV_MINOR=1
1207 +
1208 +inherit git-r3 autotools linux-info linux-mod toolchain-funcs udev flag-o-matic
1209
1210 DESCRIPTION="Lustre is a parallel distributed file system"
1211 HOMEPAGE="http://wiki.whamcloud.com/"
1212 @@ -44,9 +47,13 @@ REQUIRED_USE="
1213 client? ( modules )
1214 server? ( modules )"
1215
1216 -PATCHES=(
1217 - "${FILESDIR}/0008-Fix-build-error-with-gcc-6.1.patch"
1218 - )
1219 +pkg_pretend() {
1220 + KVSUPP=${SUPPORTED_KV_MAJOR}.${SUPPORTED_KV_MINOR}.x
1221 + if kernel_is gt ${SUPPORTED_KV_MAJOR} ${SUPPORTED_KV_MINOR}; then
1222 + eerror "Unsupported kernel version! Latest supported one is ${KVSUPP}"
1223 + die
1224 + fi
1225 +}
1226
1227 pkg_setup() {
1228 filter-mfpmath sse
1229 @@ -58,7 +65,7 @@ pkg_setup() {
1230 }
1231
1232 src_prepare() {
1233 - if [ ! -z ${#PATCHES[0]} ]; then
1234 + if [ ${#PATCHES[0]} -ne 0 ]; then
1235 epatch ${PATCHES[@]}
1236 fi
1237 eapply_user
1238 @@ -104,4 +111,6 @@ src_compile() {
1239
1240 src_install() {
1241 default
1242 + newinitd "${FILESDIR}/lnet.initd" lnet
1243 + newinitd "${FILESDIR}/lustre-client.initd" lustre-client
1244 }