[PATCH] splice: add a SPLICE_F_MORE flag

This lets userspace indicate whether more data will be coming in a
subsequent splice call.

Signed-off-by: Jens Axboe <axboe@suse.de>

+4 -2
+3 -2
fs/splice.c
··· 354 unsigned int offset; 355 ssize_t ret; 356 void *ptr; 357 358 /* 359 * sub-optimal, but we are limited by the pipe ->map. we don't ··· 367 return PTR_ERR(ptr); 368 369 offset = pos & ~PAGE_CACHE_MASK; 370 371 - ret = file->f_op->sendpage(file, buf->page, offset, sd->len, &pos, 372 - sd->len < sd->total_len); 373 374 buf->ops->unmap(info, buf); 375 if (ret == sd->len)
··· 354 unsigned int offset; 355 ssize_t ret; 356 void *ptr; 357 + int more; 358 359 /* 360 * sub-optimal, but we are limited by the pipe ->map. we don't ··· 366 return PTR_ERR(ptr); 367 368 offset = pos & ~PAGE_CACHE_MASK; 369 + more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len; 370 371 + ret = file->f_op->sendpage(file, buf->page, offset, sd->len, &pos,more); 372 373 buf->ops->unmap(info, buf); 374 if (ret == sd->len)
+1
include/linux/pipe_fs_i.h
··· 62 #define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */ 63 /* we may still block on the fd we splice */ 64 /* from/to, of course */ 65 66 #endif
··· 62 #define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */ 63 /* we may still block on the fd we splice */ 64 /* from/to, of course */ 65 + #define SPLICE_F_MORE (0x04) /* expect more data */ 66 67 #endif