mirror of
https://github.com/versity/scoutfs.git
synced 2026-09-02 14:17:15 +00:00
The networking code was really suffering by trying to combine the client and server processing paths into one file. The code can be a lot simpler by giving the client and server their own processing paths that take their different socket lifecysles into account. The client maintains a single connection. Blocked senders work on the socket under a sending mutex. The recv path runs in work that can be canceled after first shutting down the socket. A long running server work function acquires the listener lock, manages the listening socket, and accepts new sockets. Each accepted socket has a single recv work blocked waiting for requests. That then spawns concurrent processing work which sends replies under a sending mutex. All of this is torn down by shutting down sockets and canceling work which frees its context. All this restructuring makes it a lot easier to track what is happening in mount and unmount between the client and server. This fixes bugs where unmount was failing because the monolithic socket shutdown function was queueing other work while running while draining. Signed-off-by: Zach Brown <zab@versity.com>
21 lines
775 B
C
21 lines
775 B
C
#ifndef _SCOUTFS_SERVER_H_
|
|
#define _SCOUTFS_SERVER_H_
|
|
|
|
void scoutfs_init_net_ment_keys(struct scoutfs_net_manifest_entry *net_ment,
|
|
struct scoutfs_key_buf *first,
|
|
struct scoutfs_key_buf *last);
|
|
struct scoutfs_net_manifest_entry *
|
|
scoutfs_alloc_net_ment(struct scoutfs_manifest_entry *ment);
|
|
void scoutfs_init_ment_net_ment(struct scoutfs_manifest_entry *ment,
|
|
struct scoutfs_net_manifest_entry *net_ment);
|
|
unsigned scoutfs_net_ment_bytes(struct scoutfs_net_manifest_entry *net_ment);
|
|
|
|
int scoutfs_client_get_compaction(struct super_block *sb, void *curs);
|
|
int scoutfs_client_finish_compaction(struct super_block *sb, void *curs,
|
|
void *list);
|
|
|
|
int scoutfs_server_setup(struct super_block *sb);
|
|
void scoutfs_server_destroy(struct super_block *sb);
|
|
|
|
#endif
|