quota: Cleanup flags definitions
Currently all quota flags were defined just in kernel-private headers. Export flags readable / writeable from userspace to userspace via include/uapi/linux/quota.h. Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
96827adcc2
commit
9c45101e88
|
@ -1248,7 +1248,7 @@ static int ignore_hardlimit(struct dquot *dquot)
|
||||||
|
|
||||||
return capable(CAP_SYS_RESOURCE) &&
|
return capable(CAP_SYS_RESOURCE) &&
|
||||||
(info->dqi_format->qf_fmt_id != QFMT_VFS_OLD ||
|
(info->dqi_format->qf_fmt_id != QFMT_VFS_OLD ||
|
||||||
!(info->dqi_flags & V1_DQF_RSQUASH));
|
!(info->dqi_flags & DQF_ROOT_SQUASH));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* needs dq_data_lock */
|
/* needs dq_data_lock */
|
||||||
|
|
|
@ -5,9 +5,6 @@
|
||||||
#ifndef _LINUX_DQBLK_V1_H
|
#ifndef _LINUX_DQBLK_V1_H
|
||||||
#define _LINUX_DQBLK_V1_H
|
#define _LINUX_DQBLK_V1_H
|
||||||
|
|
||||||
/* Root squash turned on */
|
|
||||||
#define V1_DQF_RSQUASH 1
|
|
||||||
|
|
||||||
/* Numbers of blocks needed for updates */
|
/* Numbers of blocks needed for updates */
|
||||||
#define V1_INIT_ALLOC 1
|
#define V1_INIT_ALLOC 1
|
||||||
#define V1_INIT_REWRITE 1
|
#define V1_INIT_REWRITE 1
|
||||||
|
|
|
@ -223,12 +223,14 @@ struct mem_dqinfo {
|
||||||
|
|
||||||
struct super_block;
|
struct super_block;
|
||||||
|
|
||||||
#define DQF_MASK 0xffff /* Mask for format specific flags */
|
/* Mask for flags passed to userspace */
|
||||||
#define DQF_GETINFO_MASK 0x1ffff /* Mask for flags passed to userspace */
|
#define DQF_GETINFO_MASK (DQF_ROOT_SQUASH | DQF_SYS_FILE)
|
||||||
#define DQF_SETINFO_MASK 0xffff /* Mask for flags modifiable from userspace */
|
/* Mask for flags modifiable from userspace */
|
||||||
#define DQF_SYS_FILE_B 16
|
#define DQF_SETINFO_MASK DQF_ROOT_SQUASH
|
||||||
#define DQF_SYS_FILE (1 << DQF_SYS_FILE_B) /* Quota file stored as system file */
|
|
||||||
#define DQF_INFO_DIRTY_B 31
|
enum {
|
||||||
|
DQF_INFO_DIRTY_B = DQF_PRIVATE,
|
||||||
|
};
|
||||||
#define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */
|
#define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */
|
||||||
|
|
||||||
extern void mark_info_dirty(struct super_block *sb, int type);
|
extern void mark_info_dirty(struct super_block *sb, int type);
|
||||||
|
|
|
@ -126,10 +126,22 @@ struct if_dqblk {
|
||||||
#define IIF_FLAGS 4
|
#define IIF_FLAGS 4
|
||||||
#define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
|
#define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
|
||||||
|
|
||||||
|
enum {
|
||||||
|
DQF_ROOT_SQUASH_B = 0,
|
||||||
|
DQF_SYS_FILE_B = 16,
|
||||||
|
/* Kernel internal flags invisible to userspace */
|
||||||
|
DQF_PRIVATE
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Root squash enabled (for v1 quota format) */
|
||||||
|
#define DQF_ROOT_SQUASH (1 << DQF_ROOT_SQUASH_B)
|
||||||
|
/* Quota stored in a system file */
|
||||||
|
#define DQF_SYS_FILE (1 << DQF_SYS_FILE_B)
|
||||||
|
|
||||||
struct if_dqinfo {
|
struct if_dqinfo {
|
||||||
__u64 dqi_bgrace;
|
__u64 dqi_bgrace;
|
||||||
__u64 dqi_igrace;
|
__u64 dqi_igrace;
|
||||||
__u32 dqi_flags;
|
__u32 dqi_flags; /* DFQ_* */
|
||||||
__u32 dqi_valid;
|
__u32 dqi_valid;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue