aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pipe.c
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2006-12-13 03:34:04 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-13 12:05:47 -0500
commitd4c3cca941b64a938eaa9734585a93547c6be323 (patch)
tree48b78bda9d4da9c3bdfb30548cb65f0bc4015733 /fs/pipe.c
parent426d62e2158c2fd3aa1ed1fd62122afd2ccb89ae (diff)
[PATCH] constify pipe_buf_operations
- pipe/splice should use const pipe_buf_operations and file_operations - struct pipe_inode_info has an unused field "start" : get rid of it. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/pipe.c')
-rw-r--r--fs/pipe.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/pipe.c b/fs/pipe.c
index f8b6bdcb879a..9a06e8e48e8d 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -207,7 +207,7 @@ int generic_pipe_buf_pin(struct pipe_inode_info *info, struct pipe_buffer *buf)
207 return 0; 207 return 0;
208} 208}
209 209
210static struct pipe_buf_operations anon_pipe_buf_ops = { 210static const struct pipe_buf_operations anon_pipe_buf_ops = {
211 .can_merge = 1, 211 .can_merge = 1,
212 .map = generic_pipe_buf_map, 212 .map = generic_pipe_buf_map,
213 .unmap = generic_pipe_buf_unmap, 213 .unmap = generic_pipe_buf_unmap,
@@ -243,7 +243,7 @@ pipe_read(struct kiocb *iocb, const struct iovec *_iov,
243 if (bufs) { 243 if (bufs) {
244 int curbuf = pipe->curbuf; 244 int curbuf = pipe->curbuf;
245 struct pipe_buffer *buf = pipe->bufs + curbuf; 245 struct pipe_buffer *buf = pipe->bufs + curbuf;
246 struct pipe_buf_operations *ops = buf->ops; 246 const struct pipe_buf_operations *ops = buf->ops;
247 void *addr; 247 void *addr;
248 size_t chars = buf->len; 248 size_t chars = buf->len;
249 int error, atomic; 249 int error, atomic;
@@ -365,7 +365,7 @@ pipe_write(struct kiocb *iocb, const struct iovec *_iov,
365 int lastbuf = (pipe->curbuf + pipe->nrbufs - 1) & 365 int lastbuf = (pipe->curbuf + pipe->nrbufs - 1) &
366 (PIPE_BUFFERS-1); 366 (PIPE_BUFFERS-1);
367 struct pipe_buffer *buf = pipe->bufs + lastbuf; 367 struct pipe_buffer *buf = pipe->bufs + lastbuf;
368 struct pipe_buf_operations *ops = buf->ops; 368 const struct pipe_buf_operations *ops = buf->ops;
369 int offset = buf->offset + buf->len; 369 int offset = buf->offset + buf->len;
370 370
371 if (ops->can_merge && offset + chars <= PAGE_SIZE) { 371 if (ops->can_merge && offset + chars <= PAGE_SIZE) {
@@ -756,7 +756,7 @@ const struct file_operations rdwr_fifo_fops = {
756 .fasync = pipe_rdwr_fasync, 756 .fasync = pipe_rdwr_fasync,
757}; 757};
758 758
759static struct file_operations read_pipe_fops = { 759static const struct file_operations read_pipe_fops = {
760 .llseek = no_llseek, 760 .llseek = no_llseek,
761 .read = do_sync_read, 761 .read = do_sync_read,
762 .aio_read = pipe_read, 762 .aio_read = pipe_read,
@@ -768,7 +768,7 @@ static struct file_operations read_pipe_fops = {
768 .fasync = pipe_read_fasync, 768 .fasync = pipe_read_fasync,
769}; 769};
770 770
771static struct file_operations write_pipe_fops = { 771static const struct file_operations write_pipe_fops = {
772 .llseek = no_llseek, 772 .llseek = no_llseek,
773 .read = bad_pipe_r, 773 .read = bad_pipe_r,
774 .write = do_sync_write, 774 .write = do_sync_write,
@@ -780,7 +780,7 @@ static struct file_operations write_pipe_fops = {
780 .fasync = pipe_write_fasync, 780 .fasync = pipe_write_fasync,
781}; 781};
782 782
783static struct file_operations rdwr_pipe_fops = { 783static const struct file_operations rdwr_pipe_fops = {
784 .llseek = no_llseek, 784 .llseek = no_llseek,
785 .read = do_sync_read, 785 .read = do_sync_read,
786 .aio_read = pipe_read, 786 .aio_read = pipe_read,