Commit 9c45101e authored by Jan Kara's avatar Jan Kara

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: default avatarJan Kara <jack@suse.cz>
parent 96827adc
......@@ -1248,7 +1248,7 @@ static int ignore_hardlimit(struct dquot *dquot)
return capable(CAP_SYS_RESOURCE) &&
(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 */
......
......@@ -5,9 +5,6 @@
#ifndef _LINUX_DQBLK_V1_H
#define _LINUX_DQBLK_V1_H
/* Root squash turned on */
#define V1_DQF_RSQUASH 1
/* Numbers of blocks needed for updates */
#define V1_INIT_ALLOC 1
#define V1_INIT_REWRITE 1
......
......@@ -223,12 +223,14 @@ struct mem_dqinfo {
struct super_block;
#define DQF_MASK 0xffff /* Mask for format specific flags */
#define DQF_GETINFO_MASK 0x1ffff /* Mask for flags passed to userspace */
#define DQF_SETINFO_MASK 0xffff /* Mask for flags modifiable from userspace */
#define DQF_SYS_FILE_B 16
#define DQF_SYS_FILE (1 << DQF_SYS_FILE_B) /* Quota file stored as system file */
#define DQF_INFO_DIRTY_B 31
/* Mask for flags passed to userspace */
#define DQF_GETINFO_MASK (DQF_ROOT_SQUASH | DQF_SYS_FILE)
/* Mask for flags modifiable from userspace */
#define DQF_SETINFO_MASK DQF_ROOT_SQUASH
enum {
DQF_INFO_DIRTY_B = DQF_PRIVATE,
};
#define DQF_INFO_DIRTY (1 << DQF_INFO_DIRTY_B) /* Is info dirty? */
extern void mark_info_dirty(struct super_block *sb, int type);
......
......@@ -126,10 +126,22 @@ struct if_dqblk {
#define IIF_FLAGS 4
#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 {
__u64 dqi_bgrace;
__u64 dqi_igrace;
__u32 dqi_flags;
__u32 dqi_flags; /* DFQ_* */
__u32 dqi_valid;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment