relay.c (681e4a5e13c1c8315694eb4f44e0cdd84c9082d2) | relay.c (047fe3605235888f3ebcda0c728cb31937eadfe6) |
---|---|
1/* 2 * Public API and common code for kernel->userspace relay file support. 3 * 4 * See Documentation/filesystems/relay.txt for an overview. 5 * 6 * Copyright (C) 2002-2005 - Tom Zanussi (zanussi@us.ibm.com), IBM Corp 7 * Copyright (C) 1999-2005 - Karim Yaghmour (karim@opersys.com) 8 * --- 1221 unchanged lines hidden (view full) --- 1230 size_t read_subbuf = read_start / subbuf_size; 1231 size_t padding = rbuf->padding[read_subbuf]; 1232 size_t nonpad_end = read_subbuf * subbuf_size + subbuf_size - padding; 1233 struct page *pages[PIPE_DEF_BUFFERS]; 1234 struct partial_page partial[PIPE_DEF_BUFFERS]; 1235 struct splice_pipe_desc spd = { 1236 .pages = pages, 1237 .nr_pages = 0, | 1/* 2 * Public API and common code for kernel->userspace relay file support. 3 * 4 * See Documentation/filesystems/relay.txt for an overview. 5 * 6 * Copyright (C) 2002-2005 - Tom Zanussi (zanussi@us.ibm.com), IBM Corp 7 * Copyright (C) 1999-2005 - Karim Yaghmour (karim@opersys.com) 8 * --- 1221 unchanged lines hidden (view full) --- 1230 size_t read_subbuf = read_start / subbuf_size; 1231 size_t padding = rbuf->padding[read_subbuf]; 1232 size_t nonpad_end = read_subbuf * subbuf_size + subbuf_size - padding; 1233 struct page *pages[PIPE_DEF_BUFFERS]; 1234 struct partial_page partial[PIPE_DEF_BUFFERS]; 1235 struct splice_pipe_desc spd = { 1236 .pages = pages, 1237 .nr_pages = 0, |
1238 .nr_pages_max = PIPE_DEF_BUFFERS, |
|
1238 .partial = partial, 1239 .flags = flags, 1240 .ops = &relay_pipe_buf_ops, 1241 .spd_release = relay_page_release, 1242 }; 1243 ssize_t ret; 1244 1245 if (rbuf->subbufs_produced == rbuf->subbufs_consumed) --- 51 unchanged lines hidden (view full) --- 1297 ret = *nonpad_ret = splice_to_pipe(pipe, &spd); 1298 if (ret < 0 || ret < total_len) 1299 goto out; 1300 1301 if (read_start + ret == nonpad_end) 1302 ret += padding; 1303 1304out: | 1239 .partial = partial, 1240 .flags = flags, 1241 .ops = &relay_pipe_buf_ops, 1242 .spd_release = relay_page_release, 1243 }; 1244 ssize_t ret; 1245 1246 if (rbuf->subbufs_produced == rbuf->subbufs_consumed) --- 51 unchanged lines hidden (view full) --- 1298 ret = *nonpad_ret = splice_to_pipe(pipe, &spd); 1299 if (ret < 0 || ret < total_len) 1300 goto out; 1301 1302 if (read_start + ret == nonpad_end) 1303 ret += padding; 1304 1305out: |
1305 splice_shrink_spd(pipe, &spd); 1306 return ret; | 1306 splice_shrink_spd(&spd); 1307 return ret; |
1307} 1308 1309static ssize_t relay_file_splice_read(struct file *in, 1310 loff_t *ppos, 1311 struct pipe_inode_info *pipe, 1312 size_t len, 1313 unsigned int flags) 1314{ --- 51 unchanged lines hidden --- | 1308} 1309 1310static ssize_t relay_file_splice_read(struct file *in, 1311 loff_t *ppos, 1312 struct pipe_inode_info *pipe, 1313 size_t len, 1314 unsigned int flags) 1315{ --- 51 unchanged lines hidden --- |