Blame view

fs/gfs2/quota.h 2.02 KB
7336d0e65   Thomas Gleixner   treewide: Replace...
1
  /* SPDX-License-Identifier: GPL-2.0-only */
b3b94faa5   David Teigland   [GFS2] The core o...
2
3
  /*
   * Copyright (C) Sistina Software, Inc.  1997-2003 All rights reserved.
3a8a9a103   Steven Whitehouse   [GFS2] Update cop...
4
   * Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
b3b94faa5   David Teigland   [GFS2] The core o...
5
6
7
8
   */
  
  #ifndef __QUOTA_DOT_H__
  #define __QUOTA_DOT_H__
2147dbfd0   Steven Whitehouse   GFS2: Use generic...
9
  #include <linux/list_lru.h>
f2f7ba523   Steven Whitehouse   [GFS2] Make heade...
10
11
  struct gfs2_inode;
  struct gfs2_sbd;
f4108a607   Eric W. Biederman   gfs2: Split NO_QU...
12
13
  #define NO_UID_QUOTA_CHANGE INVALID_UID
  #define NO_GID_QUOTA_CHANGE INVALID_GID
b3b94faa5   David Teigland   [GFS2] The core o...
14

b54e9a0b9   Bob Peterson   GFS2: Extract quo...
15
  extern int gfs2_qa_alloc(struct gfs2_inode *ip);
a097dc7e2   Bob Peterson   GFS2: Make rgrp r...
16
  extern void gfs2_qa_delete(struct gfs2_inode *ip, atomic_t *wcount);
7c06b5d67   Eric W. Biederman   gfs2: Use kuid_t ...
17
  extern int gfs2_quota_hold(struct gfs2_inode *ip, kuid_t uid, kgid_t gid);
9ac1b4d9b   Steven Whitehouse   GFS2: Move gfs2_r...
18
  extern void gfs2_quota_unhold(struct gfs2_inode *ip);
b3b94faa5   David Teigland   [GFS2] The core o...
19

7c06b5d67   Eric W. Biederman   gfs2: Use kuid_t ...
20
  extern int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, kgid_t gid);
9ac1b4d9b   Steven Whitehouse   GFS2: Move gfs2_r...
21
  extern void gfs2_quota_unlock(struct gfs2_inode *ip);
b3b94faa5   David Teigland   [GFS2] The core o...
22

b8fbf471e   Abhi Das   gfs2: perform quo...
23
24
  extern int gfs2_quota_check(struct gfs2_inode *ip, kuid_t uid, kgid_t gid,
  			    struct gfs2_alloc_parms *ap);
9ac1b4d9b   Steven Whitehouse   GFS2: Move gfs2_r...
25
  extern void gfs2_quota_change(struct gfs2_inode *ip, s64 change,
7c06b5d67   Eric W. Biederman   gfs2: Use kuid_t ...
26
  			      kuid_t uid, kgid_t gid);
b3b94faa5   David Teigland   [GFS2] The core o...
27

ceed17236   Jan Kara   quota: Split dquo...
28
  extern int gfs2_quota_sync(struct super_block *sb, int type);
ed87dabcc   Eric W. Biederman   gfs2: Convert gfs...
29
  extern int gfs2_quota_refresh(struct gfs2_sbd *sdp, struct kqid qid);
b3b94faa5   David Teigland   [GFS2] The core o...
30

9ac1b4d9b   Steven Whitehouse   GFS2: Move gfs2_r...
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   David Teigland   [GFS2] The core o...
34

3d3c10f2c   Benjamin Marzinski   GFS2: Improve sta...
35
  extern void gfs2_wake_up_statfs(struct gfs2_sbd *sdp);
b8fbf471e   Abhi Das   gfs2: perform quo...
36
37
  static inline int gfs2_quota_lock_check(struct gfs2_inode *ip,
  					struct gfs2_alloc_parms *ap)
d82661d96   Steven Whitehouse   [GFS2] Streamline...
38
39
40
  {
  	struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
  	int ret;
174d1232e   Andreas Gruenbacher   gfs2: Fix falloca...
41
42
  
  	ap->allowed = UINT_MAX; /* Assume we are permitted a whole lot */
d82661d96   Steven Whitehouse   [GFS2] Streamline...
43
44
  	if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
  		return 0;
f4108a607   Eric W. Biederman   gfs2: Split NO_QU...
45
  	ret = gfs2_quota_lock(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE);
d82661d96   Steven Whitehouse   [GFS2] Streamline...
46
47
48
49
  	if (ret)
  		return ret;
  	if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON)
  		return 0;
b8fbf471e   Abhi Das   gfs2: perform quo...
50
  	ret = gfs2_quota_check(ip, ip->i_inode.i_uid, ip->i_inode.i_gid, ap);
d82661d96   Steven Whitehouse   [GFS2] Streamline...
51
52
53
54
  	if (ret)
  		gfs2_quota_unlock(ip);
  	return ret;
  }
cc632e7f9   Steven Whitehouse   GFS2: Hook gfs2_q...
55
  extern const struct quotactl_ops gfs2_quotactl_ops;
2147dbfd0   Steven Whitehouse   GFS2: Use generic...
56
57
  extern struct shrinker gfs2_qd_shrinker;
  extern struct list_lru gfs2_qd_lru;
c754fbbb1   Steven Whitehouse   GFS2: Use RCU/hli...
58
  extern void __init gfs2_quota_hash_init(void);
0a7ab79c5   Abhijith Das   GFS2: change gfs2...
59

b3b94faa5   David Teigland   [GFS2] The core o...
60
  #endif /* __QUOTA_DOT_H__ */