Blame view
fs/gfs2/quota.h
2.02 KB
7336d0e65
|
1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
b3b94faa5
|
2 3 |
/* * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
3a8a9a103
|
4 |
* Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. |
b3b94faa5
|
5 6 7 8 |
*/ #ifndef __QUOTA_DOT_H__ #define __QUOTA_DOT_H__ |
2147dbfd0
|
9 |
#include <linux/list_lru.h> |
f2f7ba523
|
10 11 |
struct gfs2_inode; struct gfs2_sbd; |
f4108a607
|
12 13 |
#define NO_UID_QUOTA_CHANGE INVALID_UID #define NO_GID_QUOTA_CHANGE INVALID_GID |
b3b94faa5
|
14 |
|
b54e9a0b9
|
15 |
extern int gfs2_qa_alloc(struct gfs2_inode *ip); |
a097dc7e2
|
16 |
extern void gfs2_qa_delete(struct gfs2_inode *ip, atomic_t *wcount); |
7c06b5d67
|
17 |
extern int gfs2_quota_hold(struct gfs2_inode *ip, kuid_t uid, kgid_t gid); |
9ac1b4d9b
|
18 |
extern void gfs2_quota_unhold(struct gfs2_inode *ip); |
b3b94faa5
|
19 |
|
7c06b5d67
|
20 |
extern int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, kgid_t gid); |
9ac1b4d9b
|
21 |
extern void gfs2_quota_unlock(struct gfs2_inode *ip); |
b3b94faa5
|
22 |
|
b8fbf471e
|
23 24 |
extern int gfs2_quota_check(struct gfs2_inode *ip, kuid_t uid, kgid_t gid, struct gfs2_alloc_parms *ap); |
9ac1b4d9b
|
25 |
extern void gfs2_quota_change(struct gfs2_inode *ip, s64 change, |
7c06b5d67
|
26 |
kuid_t uid, kgid_t gid); |
b3b94faa5
|
27 |
|
ceed17236
|
28 |
extern int gfs2_quota_sync(struct super_block *sb, int type); |
ed87dabcc
|
29 |
extern int gfs2_quota_refresh(struct gfs2_sbd *sdp, struct kqid qid); |
b3b94faa5
|
30 |
|
9ac1b4d9b
|
31 32 33 |
extern int gfs2_quota_init(struct gfs2_sbd *sdp); extern void gfs2_quota_cleanup(struct gfs2_sbd *sdp); extern int gfs2_quotad(void *data); |
b3b94faa5
|
34 |
|
3d3c10f2c
|
35 |
extern void gfs2_wake_up_statfs(struct gfs2_sbd *sdp); |
b8fbf471e
|
36 37 |
static inline int gfs2_quota_lock_check(struct gfs2_inode *ip, struct gfs2_alloc_parms *ap) |
d82661d96
|
38 39 40 |
{ struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); int ret; |
174d1232e
|
41 42 |
ap->allowed = UINT_MAX; /* Assume we are permitted a whole lot */ |
d82661d96
|
43 44 |
if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF) return 0; |
f4108a607
|
45 |
ret = gfs2_quota_lock(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE); |
d82661d96
|
46 47 48 49 |
if (ret) return ret; if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON) return 0; |
b8fbf471e
|
50 |
ret = gfs2_quota_check(ip, ip->i_inode.i_uid, ip->i_inode.i_gid, ap); |
d82661d96
|
51 52 53 54 |
if (ret) gfs2_quota_unlock(ip); return ret; } |
cc632e7f9
|
55 |
extern const struct quotactl_ops gfs2_quotactl_ops; |
2147dbfd0
|
56 57 |
extern struct shrinker gfs2_qd_shrinker; extern struct list_lru gfs2_qd_lru; |
c754fbbb1
|
58 |
extern void __init gfs2_quota_hash_init(void); |
0a7ab79c5
|
59 |
|
b3b94faa5
|
60 |
#endif /* __QUOTA_DOT_H__ */ |