#include "bcachefs.h"
#include "btree_update.h"
#include "errcode.h"
#include "error.h"
#include "inode.h"
#include "quota.h"
#include "snapshot.h"
#include "super-io.h"
static const char * const bch2_quota_types[] = …;
static const char * const bch2_quota_counters[] = …;
static int bch2_sb_quota_validate(struct bch_sb *sb, struct bch_sb_field *f,
enum bch_validate_flags flags, struct printbuf *err)
{ … }
static void bch2_sb_quota_to_text(struct printbuf *out, struct bch_sb *sb,
struct bch_sb_field *f)
{ … }
const struct bch_sb_field_ops bch_sb_field_ops_quota = …;
int bch2_quota_invalid(struct bch_fs *c, struct bkey_s_c k,
enum bch_validate_flags flags, struct printbuf *err)
{ … }
void bch2_quota_to_text(struct printbuf *out, struct bch_fs *c,
struct bkey_s_c k)
{ … }
#ifdef CONFIG_BCACHEFS_QUOTA
#include <linux/cred.h>
#include <linux/fs.h>
#include <linux/quota.h>
static void qc_info_to_text(struct printbuf *out, struct qc_info *i)
{ … }
static void qc_dqblk_to_text(struct printbuf *out, struct qc_dqblk *q)
{ … }
static inline unsigned __next_qtype(unsigned i, unsigned qtypes)
{ … }
#define for_each_set_qtype(_c, _i, _q, _qtypes) …
static bool ignore_hardlimit(struct bch_memquota_type *q)
{ … }
enum quota_msg { … };
static int quota_nl[][Q_COUNTERS] = …;
struct quota_msgs { … };
static void prepare_msg(unsigned qtype,
enum quota_counters counter,
struct quota_msgs *msgs,
enum quota_msg msg_type)
{ … }
static void prepare_warning(struct memquota_counter *qc,
unsigned qtype,
enum quota_counters counter,
struct quota_msgs *msgs,
enum quota_msg msg_type)
{ … }
static void flush_warnings(struct bch_qid qid,
struct super_block *sb,
struct quota_msgs *msgs)
{ … }
static int bch2_quota_check_limit(struct bch_fs *c,
unsigned qtype,
struct bch_memquota *mq,
struct quota_msgs *msgs,
enum quota_counters counter,
s64 v,
enum quota_acct_mode mode)
{ … }
int bch2_quota_acct(struct bch_fs *c, struct bch_qid qid,
enum quota_counters counter, s64 v,
enum quota_acct_mode mode)
{ … }
static void __bch2_quota_transfer(struct bch_memquota *src_q,
struct bch_memquota *dst_q,
enum quota_counters counter, s64 v)
{ … }
int bch2_quota_transfer(struct bch_fs *c, unsigned qtypes,
struct bch_qid dst,
struct bch_qid src, u64 space,
enum quota_acct_mode mode)
{ … }
static int __bch2_quota_set(struct bch_fs *c, struct bkey_s_c k,
struct qc_dqblk *qdq)
{ … }
void bch2_fs_quota_exit(struct bch_fs *c)
{ … }
void bch2_fs_quota_init(struct bch_fs *c)
{ … }
static struct bch_sb_field_quota *bch2_sb_get_or_create_quota(struct bch_sb_handle *sb)
{ … }
static void bch2_sb_quota_read(struct bch_fs *c)
{ … }
static int bch2_fs_quota_read_inode(struct btree_trans *trans,
struct btree_iter *iter,
struct bkey_s_c k)
{ … }
int bch2_fs_quota_read(struct bch_fs *c)
{ … }
static int bch2_quota_enable(struct super_block *sb, unsigned uflags)
{ … }
static int bch2_quota_disable(struct super_block *sb, unsigned uflags)
{ … }
static int bch2_quota_remove(struct super_block *sb, unsigned uflags)
{ … }
static int bch2_quota_get_state(struct super_block *sb, struct qc_state *state)
{ … }
static int bch2_quota_set_info(struct super_block *sb, int type,
struct qc_info *info)
{ … }
static void __bch2_quota_get(struct qc_dqblk *dst, struct bch_memquota *src)
{ … }
static int bch2_get_quota(struct super_block *sb, struct kqid kqid,
struct qc_dqblk *qdq)
{ … }
static int bch2_get_next_quota(struct super_block *sb, struct kqid *kqid,
struct qc_dqblk *qdq)
{ … }
static int bch2_set_quota_trans(struct btree_trans *trans,
struct bkey_i_quota *new_quota,
struct qc_dqblk *qdq)
{ … }
static int bch2_set_quota(struct super_block *sb, struct kqid qid,
struct qc_dqblk *qdq)
{ … }
const struct quotactl_ops bch2_quotactl_operations = …;
#endif