linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] reuse xxx_fifo_fops for xxx_pipe_fops
@ 2008-03-28 15:09 Denys Vlasenko
  0 siblings, 0 replies; only message in thread
From: Denys Vlasenko @ 2008-03-28 15:09 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 443 bytes --]

Hi Al,

I noticed that read/write/rdwr_pipe_fops are (1) const and
(2) exactly identical to xxx_fifo_fops, which are also const.

Attached patch #defines xxx_pipe_fops as aliases to xxx_fifo_fops.
Size difference:

# size linux-2.6.25-rc6*/*/pipe.o
   text    data     bss     dec     hex filename
   6534     144       0    6678    1a16 linux-2.6.25-rc6/fs/pipe.o
   5862     144       0    6006    1776 linux-2.6.25-rc6-pt/fs/pipe.o

--
vda

[-- Attachment #2: reuse_fifo_ops_for_pipe_ops.diff --]
[-- Type: text/x-diff, Size: 1315 bytes --]

--- linux-2.6.25-rc6.src/fs/pipe.c	Sat Mar 22 23:00:34 2008
+++ linux-2.6.25-rc6.pipe/fs/pipe.c	Fri Mar 28 15:52:00 2008
@@ -814,42 +814,9 @@
 	.fasync		= pipe_rdwr_fasync,
 };
 
-static const struct file_operations read_pipe_fops = {
-	.llseek		= no_llseek,
-	.read		= do_sync_read,
-	.aio_read	= pipe_read,
-	.write		= bad_pipe_w,
-	.poll		= pipe_poll,
-	.unlocked_ioctl	= pipe_ioctl,
-	.open		= pipe_read_open,
-	.release	= pipe_read_release,
-	.fasync		= pipe_read_fasync,
-};
-
-static const struct file_operations write_pipe_fops = {
-	.llseek		= no_llseek,
-	.read		= bad_pipe_r,
-	.write		= do_sync_write,
-	.aio_write	= pipe_write,
-	.poll		= pipe_poll,
-	.unlocked_ioctl	= pipe_ioctl,
-	.open		= pipe_write_open,
-	.release	= pipe_write_release,
-	.fasync		= pipe_write_fasync,
-};
-
-static const struct file_operations rdwr_pipe_fops = {
-	.llseek		= no_llseek,
-	.read		= do_sync_read,
-	.aio_read	= pipe_read,
-	.write		= do_sync_write,
-	.aio_write	= pipe_write,
-	.poll		= pipe_poll,
-	.unlocked_ioctl	= pipe_ioctl,
-	.open		= pipe_rdwr_open,
-	.release	= pipe_rdwr_release,
-	.fasync		= pipe_rdwr_fasync,
-};
+#define read_pipe_fops  read_fifo_fops
+#define write_pipe_fops write_fifo_fops
+#define rdwr_pipe_fops  rdwr_fifo_fops
 
 struct pipe_inode_info * alloc_pipe_info(struct inode *inode)
 {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-28 15:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-28 15:09 [PATCH] reuse xxx_fifo_fops for xxx_pipe_fops Denys Vlasenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).