scoutfs: remove unused statfs RPC

Remove the statfs RPC from the client and server now that we're using
allocator iteration to calculate free blocks.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2020-10-12 10:51:56 -07:00
committed by Zach Brown
parent 33374d8fe6
commit 2073a672a0
4 changed files with 0 additions and 66 deletions

View File

@@ -150,17 +150,6 @@ int scoutfs_client_get_last_seq(struct super_block *sb, u64 *seq)
return ret;
}
int scoutfs_client_statfs(struct super_block *sb,
struct scoutfs_net_statfs *nstatfs)
{
struct client_info *client = SCOUTFS_SB(sb)->client_info;
return scoutfs_net_sync_request(sb, client->conn,
SCOUTFS_NET_CMD_STATFS, NULL, 0,
nstatfs,
sizeof(struct scoutfs_net_statfs));
}
/* process an incoming grant response from the server */
static int client_lock_response(struct super_block *sb,
struct scoutfs_net_connection *conn,

View File

@@ -12,8 +12,6 @@ int scoutfs_client_get_roots(struct super_block *sb,
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_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,

View File

@@ -822,7 +822,6 @@ enum {
SCOUTFS_NET_CMD_GET_ROOTS,
SCOUTFS_NET_CMD_ADVANCE_SEQ,
SCOUTFS_NET_CMD_GET_LAST_SEQ,
SCOUTFS_NET_CMD_STATFS,
SCOUTFS_NET_CMD_LOCK,
SCOUTFS_NET_CMD_LOCK_RECOVER,
SCOUTFS_NET_CMD_SRCH_GET_COMPACT,
@@ -863,13 +862,6 @@ struct scoutfs_net_inode_alloc {
__le64 nr;
} __packed;
struct scoutfs_net_statfs {
__le64 total_blocks; /* total blocks in device */
__le64 next_ino; /* next unused inode number */
__le64 bfree; /* free blocks */
__u8 uuid[SCOUTFS_UUID_BYTES]; /* logical volume uuid */
} __packed;
struct scoutfs_net_roots {
struct scoutfs_btree_root fs_root;
struct scoutfs_btree_root logs_root;

View File

@@ -838,50 +838,6 @@ out:
&last_seq, sizeof(last_seq));
}
static inline __le64 le64_lg_to_sm(__le64 lg)
{
return cpu_to_le64(le64_to_cpu(lg) << SCOUTFS_BLOCK_SM_LG_SHIFT);
}
/*
* Sample the super stats that the client wants for statfs by serializing
* with each component.
*/
static int server_statfs(struct super_block *sb,
struct scoutfs_net_connection *conn,
u8 cmd, u64 id, void *arg, u16 arg_len)
{
DECLARE_SERVER_INFO(sb, server);
struct scoutfs_sb_info *sbi = SCOUTFS_SB(sb);
struct scoutfs_super_block *super = &sbi->super;
struct scoutfs_net_statfs nstatfs;
int ret;
if (arg_len == 0) {
/* uuid and total_segs are constant, so far */
memcpy(nstatfs.uuid, super->uuid, sizeof(nstatfs.uuid));
spin_lock(&sbi->next_ino_lock);
nstatfs.next_ino = super->next_ino;
spin_unlock(&sbi->next_ino_lock);
mutex_lock(&server->alloc_mutex);
nstatfs.total_blocks = le64_lg_to_sm(super->total_meta_blocks);
le64_add_cpu(&nstatfs.total_blocks,
le64_to_cpu(super->total_data_blocks));
nstatfs.bfree = le64_lg_to_sm(super->free_meta_blocks);
le64_add_cpu(&nstatfs.bfree,
le64_to_cpu(super->free_data_blocks));
mutex_unlock(&server->alloc_mutex);
ret = 0;
} else {
ret = -EINVAL;
}
return scoutfs_net_response(sb, conn, cmd, id, ret,
&nstatfs, sizeof(nstatfs));
}
static int server_lock(struct super_block *sb,
struct scoutfs_net_connection *conn,
u8 cmd, u64 id, void *arg, u16 arg_len)
@@ -1537,7 +1493,6 @@ static scoutfs_net_request_t server_req_funcs[] = {
[SCOUTFS_NET_CMD_GET_ROOTS] = server_get_roots,
[SCOUTFS_NET_CMD_ADVANCE_SEQ] = server_advance_seq,
[SCOUTFS_NET_CMD_GET_LAST_SEQ] = server_get_last_seq,
[SCOUTFS_NET_CMD_STATFS] = server_statfs,
[SCOUTFS_NET_CMD_LOCK] = server_lock,
[SCOUTFS_NET_CMD_SRCH_GET_COMPACT] = server_srch_get_compact,
[SCOUTFS_NET_CMD_SRCH_COMMIT_COMPACT] = server_srch_commit_compact,