2 * quotaio_rpc.c - quota IO operations for RPC (just wrappers for RPC calls)
10 #include <sys/types.h>
14 #include "dqblk_rpc.h"
15 #include "rquota_client.h"
18 static int rpc_init_io(struct quota_handle *h);
19 static struct dquot *rpc_read_dquot(struct quota_handle *h, qid_t id);
20 static int rpc_commit_dquot(struct dquot *dquot, int flags);
22 struct quotafile_ops quotafile_ops_rpc = {
24 read_dquot: rpc_read_dquot,
25 commit_dquot: rpc_commit_dquot
29 * Define maximal values RPC client can transmit to server.
31 static int rpc_init_io(struct quota_handle *h)
34 h->qh_info.dqi_max_b_limit = ~(uint32_t)0;
35 h->qh_info.dqi_max_i_limit = ~(uint32_t)0;
36 h->qh_info.dqi_max_b_usage = (~(uint32_t)0) << QUOTABLOCK_BITS;
37 h->qh_info.dqi_max_i_usage = ~(uint32_t)0;
45 * Read a dqblk struct from RPC server - just wrapper function.
47 static struct dquot *rpc_read_dquot(struct quota_handle *h, qid_t id)
50 struct dquot *dquot = get_empty_dquot();
55 if ((ret = rpc_rquota_get(dquot)) < 0) {
68 * Write a dqblk struct to RPC server - just wrapper function.
70 static int rpc_commit_dquot(struct dquot *dquot, int flags)
75 if (QIO_RO(dquot->dq_h)) {
76 errstr(_("Trying to write quota to readonly quotafile on %s\n"), dquot->dq_h->qh_quotadev);
80 if ((ret = rpc_rquota_set(QCMD(Q_RPC_SETQUOTA, dquot->dq_h->qh_type), dquot)) < 0) {