diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-12-19 08:43:01 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:14 -0400 |
commit | 2fab25cdd70be6868936639dfb03eaa9fa0245c0 (patch) | |
tree | be7d06507d673e81f7400edb3a9c5565f00b0de9 /fs/bcachefs/fs.h | |
parent | 69d46f903120d4aab0e0ad239191245d839224cc (diff) |
bcachefs: more project quota fixes
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs.h')
-rw-r--r-- | fs/bcachefs/fs.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/bcachefs/fs.h b/fs/bcachefs/fs.h index 4c584d3a27c3..f949cd0d2a68 100644 --- a/fs/bcachefs/fs.h +++ b/fs/bcachefs/fs.h @@ -121,6 +121,19 @@ int bch2_fs_quota_transfer(struct bch_fs *, unsigned, enum quota_acct_mode); +static inline int bch2_set_projid(struct bch_fs *c, + struct bch_inode_info *inode, + u32 projid) +{ + struct bch_qid qid = inode->ei_qid; + + qid.q[QTYP_PRJ] = projid; + + return bch2_fs_quota_transfer(c, inode, qid, + 1 << QTYP_PRJ, + KEY_TYPE_QUOTA_PREALLOC); +} + struct inode *bch2_vfs_inode_get(struct bch_fs *, u64); /* returns 0 if we want to do the update, or error is passed up */ |