]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/page_io.c: work around gcc bug
authorAndrew Morton <akpm@linux-foundation.org>
Thu, 22 May 2014 00:54:24 +0000 (10:54 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 30 May 2014 06:58:33 +0000 (16:58 +1000)
gcc-4.4.4 (at least) screws up this initialization.

mm/page_io.c: In function '__swap_writepage':
mm/page_io.c:277: error: unknown field 'bvec' specified in initializer
mm/page_io.c:278: warning: excess elements in struct initializer
mm/page_io.c:278: warning: (near initialization for 'from')

Fixes f990bbc9bfa3cbd2d ("bio_vec-backed iov_iter").

Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_io.c

index 243a9b76e5cee9257d499311c21153084980c39a..1ee120adbb45823c478a98ba0fff3359d71d9d9f 100644 (file)
@@ -274,9 +274,11 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc,
                        .count = PAGE_SIZE,
                        .iov_offset = 0,
                        .nr_segs = 1,
-                       .bvec = &bv
                };
 
+               /* Do this by hand because old gcc messes up the initializer */
+               from.bvec = &bv;
+
                init_sync_kiocb(&kiocb, swap_file);
                kiocb.ki_pos = page_file_offset(page);
                kiocb.ki_nbytes = PAGE_SIZE;