mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 03:00:44 +00:00
scoutfs: add scoutfs_net_response_node()
Today all responses can only be sent down the connection that sent the response while the request is being processed. We'll be adding subsystems that need to send responses asynchronously after initial request processing. Give them a call to send a response to a node id instead of to a node's connection. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -1353,6 +1353,21 @@ int scoutfs_net_response(struct super_block *sb,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
int scoutfs_net_response_node(struct super_block *sb,
|
||||
struct scoutfs_net_connection *conn,
|
||||
u64 node_id, u8 cmd, u64 id, int error,
|
||||
void *resp, u16 resp_len)
|
||||
{
|
||||
if (error) {
|
||||
resp = NULL;
|
||||
resp_len = 0;
|
||||
}
|
||||
|
||||
return submit_send(sb, conn, node_id, cmd, SCOUTFS_NET_FLAG_RESPONSE,
|
||||
id, net_err_from_host(sb, error), resp, resp_len,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* The response function that was submitted with the request is not
|
||||
* called if the request is canceled here.
|
||||
|
||||
@@ -58,6 +58,10 @@ int scoutfs_net_sync_request(struct super_block *sb,
|
||||
int scoutfs_net_response(struct super_block *sb,
|
||||
struct scoutfs_net_connection *conn,
|
||||
u8 cmd, u64 id, int error, void *resp, u16 resp_len);
|
||||
int scoutfs_net_response_node(struct super_block *sb,
|
||||
struct scoutfs_net_connection *conn,
|
||||
u64 node_id, u8 cmd, u64 id, int error,
|
||||
void *resp, u16 resp_len);
|
||||
void scoutfs_net_shutdown(struct super_block *sb,
|
||||
struct scoutfs_net_connection *conn);
|
||||
void scoutfs_net_free_conn(struct super_block *sb,
|
||||
|
||||
Reference in New Issue
Block a user