~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/bcachefs/quota.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _BCACHEFS_QUOTA_H
  3 #define _BCACHEFS_QUOTA_H
  4 
  5 #include "inode.h"
  6 #include "quota_types.h"
  7 
  8 enum bch_validate_flags;
  9 extern const struct bch_sb_field_ops bch_sb_field_ops_quota;
 10 
 11 int bch2_quota_validate(struct bch_fs *, struct bkey_s_c, enum bch_validate_flags);
 12 void bch2_quota_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
 13 
 14 #define bch2_bkey_ops_quota ((struct bkey_ops) {        \
 15         .key_validate   = bch2_quota_validate,          \
 16         .val_to_text    = bch2_quota_to_text,           \
 17         .min_val_size   = 32,                           \
 18 })
 19 
 20 static inline struct bch_qid bch_qid(struct bch_inode_unpacked *u)
 21 {
 22         return (struct bch_qid) {
 23                 .q[QTYP_USR] = u->bi_uid,
 24                 .q[QTYP_GRP] = u->bi_gid,
 25                 .q[QTYP_PRJ] = u->bi_project ? u->bi_project - 1 : 0,
 26         };
 27 }
 28 
 29 static inline unsigned enabled_qtypes(struct bch_fs *c)
 30 {
 31         return ((c->opts.usrquota << QTYP_USR)|
 32                 (c->opts.grpquota << QTYP_GRP)|
 33                 (c->opts.prjquota << QTYP_PRJ));
 34 }
 35 
 36 #ifdef CONFIG_BCACHEFS_QUOTA
 37 
 38 int bch2_quota_acct(struct bch_fs *, struct bch_qid, enum quota_counters,
 39                     s64, enum quota_acct_mode);
 40 
 41 int bch2_quota_transfer(struct bch_fs *, unsigned, struct bch_qid,
 42                         struct bch_qid, u64, enum quota_acct_mode);
 43 
 44 void bch2_fs_quota_exit(struct bch_fs *);
 45 void bch2_fs_quota_init(struct bch_fs *);
 46 int bch2_fs_quota_read(struct bch_fs *);
 47 
 48 extern const struct quotactl_ops bch2_quotactl_operations;
 49 
 50 #else
 51 
 52 static inline int bch2_quota_acct(struct bch_fs *c, struct bch_qid qid,
 53                                   enum quota_counters counter, s64 v,
 54                                   enum quota_acct_mode mode)
 55 {
 56         return 0;
 57 }
 58 
 59 static inline int bch2_quota_transfer(struct bch_fs *c, unsigned qtypes,
 60                                       struct bch_qid dst,
 61                                       struct bch_qid src, u64 space,
 62                                       enum quota_acct_mode mode)
 63 {
 64         return 0;
 65 }
 66 
 67 static inline void bch2_fs_quota_exit(struct bch_fs *c) {}
 68 static inline void bch2_fs_quota_init(struct bch_fs *c) {}
 69 static inline int bch2_fs_quota_read(struct bch_fs *c) { return 0; }
 70 
 71 #endif
 72 
 73 #endif /* _BCACHEFS_QUOTA_H */
 74 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php