connection: pass struct file from ioctl handler to kdbus_conn_kmsg_send()
authorDaniel Mack <daniel@zonque.org>
Fri, 19 Dec 2014 18:16:01 +0000 (19:16 +0100)
committerDaniel Mack <daniel@zonque.org>
Fri, 19 Dec 2014 18:32:17 +0000 (19:32 +0100)
We need to have access to the struct file that was used to issue the
ioctl later, so let's pass it down to kdbus_conn_kmsg_send().

Signed-off-by: Daniel Mack <daniel@zonque.org>
connection.c
connection.h
handle.c

index 141b10fa5b73c0077e5f80ef76cc61ff02d64019..f4177b5936c804b1ea9558072d62dfdf964b486b 100644 (file)
@@ -710,12 +710,14 @@ static int kdbus_conn_wait_reply(struct kdbus_conn *conn_src,
  * kdbus_cmd_msg_send() - send a message
  * @conn_src:          Connection
  * @cmd:               Payload of SEND command
+ * @ioctl_file:                struct file used to issue this ioctl
  * @kmsg:              Message to send
  *
  * Return: 0 on success, negative errno on failure
  */
 int kdbus_cmd_msg_send(struct kdbus_conn *conn_src,
                       struct kdbus_cmd_send *cmd,
+                      struct file *ioctl_file,
                       struct kdbus_kmsg *kmsg)
 {
        bool sync = cmd->flags & KDBUS_SEND_SYNC_REPLY;
index e3eaf9c2e3fc139af266d9466b15f5017327f596..0371aff4d7f3d03a377c6bd3d4eea85d7e04585d 100644 (file)
@@ -143,6 +143,7 @@ bool kdbus_conn_policy_see_notification(struct kdbus_conn *conn,
 /* command dispatcher */
 int kdbus_cmd_msg_send(struct kdbus_conn *conn_src,
                       struct kdbus_cmd_send *cmd_send,
+                      struct file *ioctl_file,
                       struct kdbus_kmsg *kmsg);
 int kdbus_cmd_msg_recv(struct kdbus_conn *conn,
                       struct kdbus_cmd_recv *recv);
index c0de97aca13dc719347e9175a6e90198162eeb6c..8729cdd0648ceb9faed7e39345162387f057a8c3 100644 (file)
--- a/handle.c
+++ b/handle.c
@@ -699,7 +699,7 @@ static long handle_ep_ioctl_connected(struct file *file, unsigned int cmd,
                        break;
                }
 
-               ret = kdbus_cmd_msg_send(conn, cmd_send, kmsg);
+               ret = kdbus_cmd_msg_send(conn, cmd_send, file, kmsg);
                if (ret < 0) {
                        kdbus_kmsg_free(kmsg);
                        break;