From 5e3c6c8b76cb7ae35ea3c66f7103b889159451d9 Mon Sep 17 00:00:00 2001
From: Federico Vaga <federico.vaga@gmail.com>
Date: Wed, 1 Feb 2012 23:53:17 +0100
Subject: [PATCH] trigger: remove file operations from trigger

no existing trigger uses the file_operations, and the design
evolved towards a pipeline, where there always is a buffer
exchanging data with the trigger

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
---
 Documentation/zio/trigger.txt | 13 -------------
 include/linux/zio-trigger.h   |  3 ---
 triggers/zio-trig-irq.c       |  1 -
 triggers/zio-trig-timer.c     |  1 -
 zio-sys.c                     |  1 -
 5 files changed, 19 deletions(-)

diff --git a/Documentation/zio/trigger.txt b/Documentation/zio/trigger.txt
index 9fbfaaf..ccd4aca 100644
--- a/Documentation/zio/trigger.txt
+++ b/Documentation/zio/trigger.txt
@@ -79,19 +79,6 @@ trigger will push blocks to the buffer; for output it will release
 the blocks.  zio-core offers zio_generic_data_done() for triggers
 that don't need special handling.
 
-	File Operations
-	===============
-
-The trigger may include a non-NULL f_ops pointer. Most triggers will
-not need it, but for example "app-request" does, because it needs to
-look at individual read and write calls performed by applications.
-ZIO will use these file operations (instead of the buffer file operations)
-when the open method of the char device detects that the active trigger
-declares a non-NULL f_ops field.  These operations will most
-likely fall back to buffer->f_ops for most of their actual work.
-
-See zio-trig-app-request.c for details about how this is used.
-
 	When the trigger fires
 	======================
 
diff --git a/include/linux/zio-trigger.h b/include/linux/zio-trigger.h
index d1b8beb..7a7c8e1 100644
--- a/include/linux/zio-trigger.h
+++ b/include/linux/zio-trigger.h
@@ -17,7 +17,6 @@ struct zio_trigger_type {
 	/* file_operations because the trigger may override the buffer */
 	const struct zio_sysfs_operations	*s_op;
 	const struct zio_trigger_operations	*t_op;
-	const struct file_operations		*f_op;
 
 	/* default attributes for instance */
 	struct zio_attribute_set		zattr_set;
@@ -45,8 +44,6 @@ struct zio_ti {
 	struct zio_ctrl_attr			zattr_val;
 
 	const struct zio_trigger_operations	*t_op;
-	const struct file_operations		*f_op;
-
 };
 
 /* first 4bit are reserved for zio object universal flags */
diff --git a/triggers/zio-trig-irq.c b/triggers/zio-trig-irq.c
index 356c46f..cb5dc1b 100644
--- a/triggers/zio-trig-irq.c
+++ b/triggers/zio-trig-irq.c
@@ -145,7 +145,6 @@ static struct zio_trigger_type zti_trigger = {
 	},
 	.s_op = &zti_s_ops,
 	.t_op = &zti_trigger_ops,
-	.f_op = NULL, /* we use buffer fops */
 };
 
 /*
diff --git a/triggers/zio-trig-timer.c b/triggers/zio-trig-timer.c
index b5fefdb..df9a741 100644
--- a/triggers/zio-trig-timer.c
+++ b/triggers/zio-trig-timer.c
@@ -186,7 +186,6 @@ static struct zio_trigger_type ztt_trigger = {
 	},
 	.s_op = &ztt_s_ops,
 	.t_op = &ztt_trigger_ops,
-	.f_op = NULL, /* we use buffer fops */
 };
 
 /*
diff --git a/zio-sys.c b/zio-sys.c
index e0deaec..8be8ba2 100644
--- a/zio-sys.c
+++ b/zio-sys.c
@@ -1113,7 +1113,6 @@ static struct zio_ti *__ti_create_and_init(struct zio_trigger_type *trig,
 	}
 	/* Initialize trigger */
 	ti->t_op = trig->t_op;
-	ti->f_op = trig->f_op;
 	ti->flags |= cset->flags & ZIO_DIR;
 	ti->head.zobj_type = ZTI;
 	snprintf(ti->head.name, ZIO_NAME_LEN, "%s-%s-%d",
-- 
GitLab