mirror of
https://github.com/versity/scoutfs.git
synced 2026-09-24 08:54:45 +00:00
scoutfs: avoid reading forest roots with block IO
The forest item operations were reading the super block to find the roots that it should read items from. This was easiest to implement to start, but it is too expensive. We have to find the roots for every newly acquired lock and every call to walk the inode seq indexes. To avoid all these reads we first send the current stable versions of the fs and logs btrees roots along with root grants. Then we add a net command to get the current stable roots from the server. This is used to refresh the roots if stale blocks are encountered and on the seq index queries. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -489,6 +489,7 @@ static int process_waiting_requests(struct super_block *sb,
|
||||
struct server_lock_node *snode)
|
||||
{
|
||||
DECLARE_LOCK_SERVER_INFO(sb, inf);
|
||||
struct scoutfs_net_lock_grant_response gres;
|
||||
struct scoutfs_net_lock nl;
|
||||
struct client_lock_entry *req;
|
||||
struct client_lock_entry *req_tmp;
|
||||
@@ -552,8 +553,12 @@ static int process_waiting_requests(struct super_block *sb,
|
||||
nl.write_version = cpu_to_le64(wv);
|
||||
}
|
||||
|
||||
gres.nl = nl;
|
||||
scoutfs_server_get_fs_roots(sb, &gres.nfr.fs_root,
|
||||
&gres.nfr.logs_root);
|
||||
|
||||
ret = scoutfs_server_lock_response(sb, req->rid,
|
||||
req->net_id, &nl);
|
||||
req->net_id, &gres);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user