mirror of
https://github.com/versity/scoutfs.git
synced 2026-07-23 08:23:15 +00:00
08a140c8b0
Convert client locking to call the server's lock service instead of using a fs/dlm lockspace. The client code gets some shims to send and receive lock messages to and from the server. Callers use our lock mode constants instead of the DLM's. Locks are now identified by their starting key instead of an additional scoped lock name so that we don't have more mapping structures to track. The global rename lock uses keys that are defined by the format as only used for locking. The biggest change is in the client lock state machine. Instead of calling the dlm and getting callbacks we send messages to our server and get called from incoming message processing. We don't have everything come through a per-lock work queue. Instead we send requests either from the blocking lock caller or from a shrink work queue. Incoming messages are called in the net layer's blocking work contexts so we don't need to do any more work to defer to other contexts. The different processing contexts leads to a slightly different lock life cycle. We refactor and seperate allocation and freeing from tracking and removing locks in data structures. We add a _get and _put to track active use of locks and then async references to locks by holders and requests are tracked seperately. Our lock service's rules are a bit simpler in that we'll only ever send one request at a time and the server will only ever send one request at a time. We do have to do a bit of work to make sure we process back to back grant reponses and invalidation requests from the server. As of this change the lock setup and destruction paths are a little wobbly. They'll be shored up as we add lock recovery between the client and server. Signed-off-by: Zach Brown <zab@versity.com>
30 lines
1.2 KiB
C
30 lines
1.2 KiB
C
#ifndef _SCOUTFS_CLIENT_H_
|
|
#define _SCOUTFS_CLIENT_H_
|
|
|
|
int scoutfs_client_alloc_inodes(struct super_block *sb, u64 count,
|
|
u64 *ino, u64 *nr);
|
|
int scoutfs_client_alloc_extent(struct super_block *sb, u64 blocks, u64 *start,
|
|
u64 *len);
|
|
int scoutfs_client_free_extents(struct super_block *sb,
|
|
struct scoutfs_net_extent_list *nexl);
|
|
int scoutfs_client_alloc_segno(struct super_block *sb, u64 *segno);
|
|
int scoutfs_client_record_segment(struct super_block *sb,
|
|
struct scoutfs_segment *seg, u8 level);
|
|
u64 *scoutfs_client_bulk_alloc(struct super_block *sb);
|
|
int scoutfs_client_advance_seq(struct super_block *sb, u64 *seq);
|
|
int scoutfs_client_get_last_seq(struct super_block *sb, u64 *seq);
|
|
int scoutfs_client_get_manifest_root(struct super_block *sb,
|
|
struct scoutfs_btree_root *root);
|
|
int scoutfs_client_statfs(struct super_block *sb,
|
|
struct scoutfs_net_statfs *nstatfs);
|
|
int scoutfs_client_lock_request(struct super_block *sb,
|
|
struct scoutfs_net_lock *nl);
|
|
int scoutfs_client_lock_response(struct super_block *sb, u64 net_id,
|
|
struct scoutfs_net_lock *nl);
|
|
|
|
int scoutfs_client_wait_node_id(struct super_block *sb);
|
|
int scoutfs_client_setup(struct super_block *sb);
|
|
void scoutfs_client_destroy(struct super_block *sb);
|
|
|
|
#endif
|