1 #include <linux/errno.h>
3 #include <linux/quota.h>
6 #include <linux/kernel.h>
8 #include <linux/module.h>
10 #include <asm/byteorder.h>
18 #define QUOTABLOCK_BITS 10
19 #define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS)
60 if (!sb_dqopt(dquot->
dq_sb)->files[type])
65 dquot->
dq_sb->s_op->quota_read(dquot->
dq_sb, type, (
char *)&dqblk,
69 v1_disk2mem_dqblk(&dquot->
dq_dqb, &dqblk);
70 if (dquot->
dq_dqb.dqb_bhardlimit == 0 &&
71 dquot->
dq_dqb.dqb_bsoftlimit == 0 &&
72 dquot->
dq_dqb.dqb_ihardlimit == 0 &&
73 dquot->
dq_dqb.dqb_isoftlimit == 0)
80 static int v1_commit_dqblk(
struct dquot *dquot)
82 short type = dquot->
dq_id.type;
86 v1_mem2disk_dqblk(&dqblk, &dquot->
dq_dqb);
90 sb_dqopt(dquot->
dq_sb)->info[
type].dqi_bgrace;
92 sb_dqopt(dquot->
dq_sb)->info[
type].dqi_igrace;
95 if (sb_dqopt(dquot->
dq_sb)->files[type])
96 ret = dquot->
dq_sb->s_op->quota_write(dquot->
dq_sb, type,
100 quota_error(dquot->
dq_sb,
"dquota write failed");
114 #define V2_INITQMAGICS {\
125 static int v1_check_quota_file(
struct super_block *
sb,
int type)
135 isize = i_size_read(inode);
145 size = sb->
s_op->quota_read(sb, type, (
char *)&dqhead,
152 "VFS: %s: Refusing to turn on old quota format on given file."
153 " It probably contains newer quota format.\n", sb->
s_id);
157 static int v1_read_file_info(
struct super_block *
sb,
int type)
163 ret = sb->
s_op->quota_read(sb, type, (
char *)&dqblk,
172 dqopt->
info[
type].dqi_maxblimit = 0xffffffff;
173 dqopt->
info[
type].dqi_maxilimit = 0xffffffff;
182 static int v1_write_file_info(
struct super_block *sb,
int type)
189 ret = sb->
s_op->quota_read(sb, type, (
char *)&dqblk,
196 dqblk.dqb_itime = dqopt->
info[
type].dqi_igrace;
197 dqblk.dqb_btime = dqopt->
info[
type].dqi_bgrace;
198 ret = sb->
s_op->quota_write(sb, type, (
char *)&dqblk,
209 .check_quota_file = v1_check_quota_file,
210 .read_file_info = v1_read_file_info,
211 .write_file_info = v1_write_file_info,
212 .free_file_info =
NULL,
213 .read_dqblk = v1_read_dqblk,
214 .commit_dqblk = v1_commit_dqblk,
219 .qf_ops = &v1_format_ops,
223 static int __init init_v1_quota_format(
void)
228 static void __exit exit_v1_quota_format(
void)