scoutfs: add scoutfs_net_client_node_id()

Some upcoming network request processing paths need access to the
connected client's node_id.  We could add it to the arguments but that'd
be a lot of churn so we'll add an accessor function for now.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2018-11-08 15:40:22 -08:00
parent e9f6e79d67
commit 6caa87458b
2 changed files with 12 additions and 0 deletions

View File

@@ -1154,6 +1154,17 @@ scoutfs_net_alloc_conn(struct super_block *sb,
return conn;
}
/*
* Give the caller the client node_id of the connection. This used by
* rare server processing callers who want to send async responses after
* request processing has returned. We didn't want to plumb the
* requesting node_id into all the request handlers but that'd work too.
*/
u64 scoutfs_net_client_node_id(struct scoutfs_net_connection *conn)
{
return conn->node_id;
}
/*
* Shutdown the connection. Once this returns no network traffic
* or work will be executing. The caller can then connect or bind and

View File

@@ -28,6 +28,7 @@ scoutfs_net_alloc_conn(struct super_block *sb,
scoutfs_net_notify_t notify_up,
scoutfs_net_notify_t notify_down, size_t info_size,
scoutfs_net_request_t *req_funcs, char *name_suffix);
u64 scoutfs_net_client_node_id(struct scoutfs_net_connection *conn);
int scoutfs_net_connect(struct super_block *sb,
struct scoutfs_net_connection *conn,
struct sockaddr_in *sin, unsigned long timeout_ms);