diff options
author | Christoph Hellwig <hch@lst.de> | 2009-06-08 09:33:32 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@brick.lst.de> | 2009-06-08 09:33:32 -0400 |
commit | 7d095257e321214e4cf359abd131ba1f09c60cba (patch) | |
tree | 3f71e2650651616f8ba168b64a82ab48aedef14c /fs/xfs/xfs_mount.h | |
parent | 0c5e1ce89f1eacc366ec421c0f5f681159479c28 (diff) |
xfs: kill xfs_qmops
Kill the quota ops function vector and replace it with direct calls or
stubs in the CONFIG_XFS_QUOTA=n case.
Make sure we check XFS_IS_QUOTA_RUNNING in the right spots. We can remove
the number of those checks because the XFS_TRANS_DQ_DIRTY flag can't be set
otherwise.
This brings us back closer to the way this code worked in IRIX and earlier
Linux versions, but we keep a lot of the more useful factoring of common
code.
Eventually we should also kill xfs_qm_bhv.c, but that's left for a later
patch.
Reduces the size of the source code by about 250 lines and the size of
XFS module by about 1.5 kilobytes with quotas enabled:
text data bss dec hex filename
615957 2960 3848 622765 980ad fs/xfs/xfs.o
617231 3152 3848 624231 98667 fs/xfs/xfs.o.old
Fallout:
- xfs_qm_dqattach is split into xfs_qm_dqattach_locked which expects
the inode locked and xfs_qm_dqattach which does the locking around it,
thus removing XFS_QMOPT_ILOCKED.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Diffstat (limited to 'fs/xfs/xfs_mount.h')
-rw-r--r-- | fs/xfs/xfs_mount.h | 84 |
1 files changed, 2 insertions, 82 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index d6a64392f983..a5122382afde 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h | |||
@@ -64,6 +64,8 @@ struct xfs_swapext; | |||
64 | struct xfs_mru_cache; | 64 | struct xfs_mru_cache; |
65 | struct xfs_nameops; | 65 | struct xfs_nameops; |
66 | struct xfs_ail; | 66 | struct xfs_ail; |
67 | struct xfs_quotainfo; | ||
68 | |||
67 | 69 | ||
68 | /* | 70 | /* |
69 | * Prototypes and functions for the Data Migration subsystem. | 71 | * Prototypes and functions for the Data Migration subsystem. |
@@ -107,86 +109,6 @@ typedef struct xfs_dmops { | |||
107 | (*(mp)->m_dm_ops->xfs_send_unmount)(mp,ip,right,mode,rval,fl) | 109 | (*(mp)->m_dm_ops->xfs_send_unmount)(mp,ip,right,mode,rval,fl) |
108 | 110 | ||
109 | 111 | ||
110 | /* | ||
111 | * Prototypes and functions for the Quota Management subsystem. | ||
112 | */ | ||
113 | |||
114 | struct xfs_dquot; | ||
115 | struct xfs_dqtrxops; | ||
116 | struct xfs_quotainfo; | ||
117 | |||
118 | typedef int (*xfs_qminit_t)(struct xfs_mount *, uint *, uint *); | ||
119 | typedef int (*xfs_qmmount_t)(struct xfs_mount *, uint, uint); | ||
120 | typedef void (*xfs_qmunmount_t)(struct xfs_mount *); | ||
121 | typedef void (*xfs_qmdone_t)(struct xfs_mount *); | ||
122 | typedef void (*xfs_dqrele_t)(struct xfs_dquot *); | ||
123 | typedef int (*xfs_dqattach_t)(struct xfs_inode *, uint); | ||
124 | typedef void (*xfs_dqdetach_t)(struct xfs_inode *); | ||
125 | typedef int (*xfs_dqpurgeall_t)(struct xfs_mount *, uint); | ||
126 | typedef int (*xfs_dqvopalloc_t)(struct xfs_mount *, | ||
127 | struct xfs_inode *, uid_t, gid_t, prid_t, uint, | ||
128 | struct xfs_dquot **, struct xfs_dquot **); | ||
129 | typedef void (*xfs_dqvopcreate_t)(struct xfs_trans *, struct xfs_inode *, | ||
130 | struct xfs_dquot *, struct xfs_dquot *); | ||
131 | typedef int (*xfs_dqvoprename_t)(struct xfs_inode **); | ||
132 | typedef struct xfs_dquot * (*xfs_dqvopchown_t)( | ||
133 | struct xfs_trans *, struct xfs_inode *, | ||
134 | struct xfs_dquot **, struct xfs_dquot *); | ||
135 | typedef int (*xfs_dqvopchownresv_t)(struct xfs_trans *, struct xfs_inode *, | ||
136 | struct xfs_dquot *, struct xfs_dquot *, uint); | ||
137 | typedef void (*xfs_dqstatvfs_t)(struct xfs_inode *, struct kstatfs *); | ||
138 | typedef int (*xfs_dqsync_t)(struct xfs_mount *, int flags); | ||
139 | |||
140 | typedef struct xfs_qmops { | ||
141 | xfs_qminit_t xfs_qminit; | ||
142 | xfs_qmdone_t xfs_qmdone; | ||
143 | xfs_qmmount_t xfs_qmmount; | ||
144 | xfs_qmunmount_t xfs_qmunmount; | ||
145 | xfs_dqrele_t xfs_dqrele; | ||
146 | xfs_dqattach_t xfs_dqattach; | ||
147 | xfs_dqdetach_t xfs_dqdetach; | ||
148 | xfs_dqpurgeall_t xfs_dqpurgeall; | ||
149 | xfs_dqvopalloc_t xfs_dqvopalloc; | ||
150 | xfs_dqvopcreate_t xfs_dqvopcreate; | ||
151 | xfs_dqvoprename_t xfs_dqvoprename; | ||
152 | xfs_dqvopchown_t xfs_dqvopchown; | ||
153 | xfs_dqvopchownresv_t xfs_dqvopchownresv; | ||
154 | xfs_dqstatvfs_t xfs_dqstatvfs; | ||
155 | xfs_dqsync_t xfs_dqsync; | ||
156 | struct xfs_dqtrxops *xfs_dqtrxops; | ||
157 | } xfs_qmops_t; | ||
158 | |||
159 | #define XFS_QM_INIT(mp, mnt, fl) \ | ||
160 | (*(mp)->m_qm_ops->xfs_qminit)(mp, mnt, fl) | ||
161 | #define XFS_QM_MOUNT(mp, mnt, fl) \ | ||
162 | (*(mp)->m_qm_ops->xfs_qmmount)(mp, mnt, fl) | ||
163 | #define XFS_QM_UNMOUNT(mp) \ | ||
164 | (*(mp)->m_qm_ops->xfs_qmunmount)(mp) | ||
165 | #define XFS_QM_DONE(mp) \ | ||
166 | (*(mp)->m_qm_ops->xfs_qmdone)(mp) | ||
167 | #define XFS_QM_DQRELE(mp, dq) \ | ||
168 | (*(mp)->m_qm_ops->xfs_dqrele)(dq) | ||
169 | #define XFS_QM_DQATTACH(mp, ip, fl) \ | ||
170 | (*(mp)->m_qm_ops->xfs_dqattach)(ip, fl) | ||
171 | #define XFS_QM_DQDETACH(mp, ip) \ | ||
172 | (*(mp)->m_qm_ops->xfs_dqdetach)(ip) | ||
173 | #define XFS_QM_DQPURGEALL(mp, fl) \ | ||
174 | (*(mp)->m_qm_ops->xfs_dqpurgeall)(mp, fl) | ||
175 | #define XFS_QM_DQVOPALLOC(mp, ip, uid, gid, prid, fl, dq1, dq2) \ | ||
176 | (*(mp)->m_qm_ops->xfs_dqvopalloc)(mp, ip, uid, gid, prid, fl, dq1, dq2) | ||
177 | #define XFS_QM_DQVOPCREATE(mp, tp, ip, dq1, dq2) \ | ||
178 | (*(mp)->m_qm_ops->xfs_dqvopcreate)(tp, ip, dq1, dq2) | ||
179 | #define XFS_QM_DQVOPRENAME(mp, ip) \ | ||
180 | (*(mp)->m_qm_ops->xfs_dqvoprename)(ip) | ||
181 | #define XFS_QM_DQVOPCHOWN(mp, tp, ip, dqp, dq) \ | ||
182 | (*(mp)->m_qm_ops->xfs_dqvopchown)(tp, ip, dqp, dq) | ||
183 | #define XFS_QM_DQVOPCHOWNRESV(mp, tp, ip, dq1, dq2, fl) \ | ||
184 | (*(mp)->m_qm_ops->xfs_dqvopchownresv)(tp, ip, dq1, dq2, fl) | ||
185 | #define XFS_QM_DQSTATVFS(ip, statp) \ | ||
186 | (*(ip)->i_mount->m_qm_ops->xfs_dqstatvfs)(ip, statp) | ||
187 | #define XFS_QM_DQSYNC(mp, flags) \ | ||
188 | (*(mp)->m_qm_ops->xfs_dqsync)(mp, flags) | ||
189 | |||
190 | #ifdef HAVE_PERCPU_SB | 112 | #ifdef HAVE_PERCPU_SB |
191 | 113 | ||
192 | /* | 114 | /* |
@@ -510,8 +432,6 @@ extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); | |||
510 | 432 | ||
511 | extern int xfs_dmops_get(struct xfs_mount *); | 433 | extern int xfs_dmops_get(struct xfs_mount *); |
512 | extern void xfs_dmops_put(struct xfs_mount *); | 434 | extern void xfs_dmops_put(struct xfs_mount *); |
513 | extern int xfs_qmops_get(struct xfs_mount *); | ||
514 | extern void xfs_qmops_put(struct xfs_mount *); | ||
515 | 435 | ||
516 | extern struct xfs_dmops xfs_dmcore_xfs; | 436 | extern struct xfs_dmops xfs_dmcore_xfs; |
517 | 437 | ||