Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

quota: move function-macros from quota.h to quotaops.h

Move declarations of some macros, which should be in fact functions to
quotaops.h. This way they can be later converted to inline functions
because we can now use declarations from quota.h. Also add necessary
includes of quotaops.h to a few files.

[akpm@linux-foundation.org: fix JFS build]
[akpm@linux-foundation.org: fix UFS build]
[vegard.nossum@gmail.com: fix QUOTA=n build]
Signed-off-by: Jan Kara <jack@suse.cz>
Cc: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Arjen Pool <arjenpool@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jan Kara and committed by
Linus Torvalds
74abb989 02a55ca8

+35 -19
+1
fs/ext2/super.c
··· 31 31 #include <linux/seq_file.h> 32 32 #include <linux/mount.h> 33 33 #include <linux/log2.h> 34 + #include <linux/quotaops.h> 34 35 #include <asm/uaccess.h> 35 36 #include "ext2.h" 36 37 #include "xattr.h"
+1
fs/jfs/super.c
··· 22 22 #include <linux/parser.h> 23 23 #include <linux/completion.h> 24 24 #include <linux/vfs.h> 25 + #include <linux/quotaops.h> 25 26 #include <linux/mount.h> 26 27 #include <linux/moduleparam.h> 27 28 #include <linux/kthread.h>
+1
fs/quota_v1.c
··· 1 1 #include <linux/errno.h> 2 2 #include <linux/fs.h> 3 3 #include <linux/quota.h> 4 + #include <linux/quotaops.h> 4 5 #include <linux/dqblk_v1.h> 5 6 #include <linux/quotaio_v1.h> 6 7 #include <linux/kernel.h>
+1
fs/quota_v2.c
··· 11 11 #include <linux/init.h> 12 12 #include <linux/module.h> 13 13 #include <linux/slab.h> 14 + #include <linux/quotaops.h> 14 15 15 16 #include <asm/byteorder.h> 16 17
+1
fs/reiserfs/super.c
··· 22 22 #include <linux/blkdev.h> 23 23 #include <linux/buffer_head.h> 24 24 #include <linux/exportfs.h> 25 + #include <linux/quotaops.h> 25 26 #include <linux/vfs.h> 26 27 #include <linux/mnt_namespace.h> 27 28 #include <linux/mount.h>
+1
fs/ufs/super.c
··· 76 76 77 77 #include <linux/errno.h> 78 78 #include <linux/fs.h> 79 + #include <linux/quotaops.h> 79 80 #include <linux/slab.h> 80 81 #include <linux/time.h> 81 82 #include <linux/stat.h>
+3 -19
include/linux/quota.h
··· 41 41 #define __DQUOT_VERSION__ "dquot_6.5.1" 42 42 #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 43 43 44 - typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ 45 - typedef __u64 qsize_t; /* Type in which we store sizes */ 46 - 47 44 /* Size of blocks in which are counted size limits */ 48 45 #define QUOTABLOCK_BITS 10 49 46 #define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS) ··· 169 172 170 173 #include <asm/atomic.h> 171 174 175 + typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ 176 + typedef __u64 qsize_t; /* Type in which we store sizes */ 177 + 172 178 extern spinlock_t dq_data_lock; 173 179 174 180 /* Maximal numbers of writes for quota operation (insert/delete/update) ··· 224 224 225 225 extern void mark_info_dirty(struct super_block *sb, int type); 226 226 #define info_dirty(info) test_bit(DQF_INFO_DIRTY_B, &(info)->dqi_flags) 227 - 228 - #define sb_dqopt(sb) (&(sb)->s_dquot) 229 - #define sb_dqinfo(sb, type) (sb_dqopt(sb)->info+(type)) 230 227 231 228 struct dqstats { 232 229 int lookups; ··· 331 334 struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ 332 335 struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */ 333 336 }; 334 - 335 - #define sb_has_quota_enabled(sb, type) ((type)==USRQUOTA ? \ 336 - (sb_dqopt(sb)->flags & DQUOT_USR_ENABLED) : (sb_dqopt(sb)->flags & DQUOT_GRP_ENABLED)) 337 - 338 - #define sb_any_quota_enabled(sb) (sb_has_quota_enabled(sb, USRQUOTA) | \ 339 - sb_has_quota_enabled(sb, GRPQUOTA)) 340 - 341 - #define sb_has_quota_suspended(sb, type) \ 342 - ((type) == USRQUOTA ? (sb_dqopt(sb)->flags & DQUOT_USR_SUSPENDED) : \ 343 - (sb_dqopt(sb)->flags & DQUOT_GRP_SUSPENDED)) 344 - 345 - #define sb_any_quota_suspended(sb) (sb_has_quota_suspended(sb, USRQUOTA) | \ 346 - sb_has_quota_suspended(sb, GRPQUOTA)) 347 337 348 338 int register_quota_format(struct quota_format_type *fmt); 349 339 void unregister_quota_format(struct quota_format_type *fmt);
+26
include/linux/quotaops.h
··· 14 14 15 15 #include <linux/fs.h> 16 16 17 + #define sb_dqopt(sb) (&(sb)->s_dquot) 18 + 17 19 #if defined(CONFIG_QUOTA) 18 20 19 21 /* ··· 53 51 void vfs_dq_drop(struct inode *inode); 54 52 int vfs_dq_transfer(struct inode *inode, struct iattr *iattr); 55 53 int vfs_dq_quota_on_remount(struct super_block *sb); 54 + 55 + #define sb_dqinfo(sb, type) (sb_dqopt(sb)->info+(type)) 56 + 57 + /* 58 + * Functions for checking status of quota 59 + */ 60 + 61 + #define sb_has_quota_enabled(sb, type) ((type)==USRQUOTA ? \ 62 + (sb_dqopt(sb)->flags & DQUOT_USR_ENABLED) : (sb_dqopt(sb)->flags & DQUOT_GRP_ENABLED)) 63 + 64 + #define sb_any_quota_enabled(sb) (sb_has_quota_enabled(sb, USRQUOTA) | \ 65 + sb_has_quota_enabled(sb, GRPQUOTA)) 66 + 67 + #define sb_has_quota_suspended(sb, type) \ 68 + ((type) == USRQUOTA ? (sb_dqopt(sb)->flags & DQUOT_USR_SUSPENDED) : \ 69 + (sb_dqopt(sb)->flags & DQUOT_GRP_SUSPENDED)) 70 + 71 + #define sb_any_quota_suspended(sb) (sb_has_quota_suspended(sb, USRQUOTA) | \ 72 + sb_has_quota_suspended(sb, GRPQUOTA)) 56 73 57 74 /* 58 75 * Operations supported for diskquotas. ··· 179 158 } 180 159 181 160 #else 161 + 162 + #define sb_has_quota_enabled(sb, type) 0 163 + #define sb_any_quota_enabled(sb) 0 164 + #define sb_has_quota_suspended(sb, type) 0 165 + #define sb_any_quota_suspended(sb) 0 182 166 183 167 /* 184 168 * NO-OP when quota not configured.