Lines Matching refs:sb

21 static int check_quotactl_permission(struct super_block *sb, int type, int cmd,  in check_quotactl_permission()  argument
45 return security_quotactl(cmd, type, id, sb); in check_quotactl_permission()
48 static void quota_sync_one(struct super_block *sb, void *arg) in quota_sync_one() argument
52 if (sb->s_qcop && sb->s_qcop->quota_sync && in quota_sync_one()
53 (sb->s_quota_types & (1 << type))) in quota_sync_one()
54 sb->s_qcop->quota_sync(sb, type); in quota_sync_one()
82 static int quota_quotaon(struct super_block *sb, int type, int cmd, qid_t id, in quota_quotaon() argument
85 if (!sb->s_qcop->quota_on && !sb->s_qcop->quota_enable) in quota_quotaon()
87 if (sb->s_qcop->quota_enable) in quota_quotaon()
88 return sb->s_qcop->quota_enable(sb, qtype_enforce_flag(type)); in quota_quotaon()
91 return sb->s_qcop->quota_on(sb, type, id, path); in quota_quotaon()
94 static int quota_quotaoff(struct super_block *sb, int type) in quota_quotaoff() argument
96 if (!sb->s_qcop->quota_off && !sb->s_qcop->quota_disable) in quota_quotaoff()
98 if (sb->s_qcop->quota_disable) in quota_quotaoff()
99 return sb->s_qcop->quota_disable(sb, qtype_enforce_flag(type)); in quota_quotaoff()
100 return sb->s_qcop->quota_off(sb, type); in quota_quotaoff()
103 static int quota_getfmt(struct super_block *sb, int type, void __user *addr) in quota_getfmt() argument
107 mutex_lock(&sb_dqopt(sb)->dqonoff_mutex); in quota_getfmt()
108 if (!sb_has_quota_active(sb, type)) { in quota_getfmt()
109 mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex); in quota_getfmt()
112 fmt = sb_dqopt(sb)->info[type].dqi_format->qf_fmt_id; in quota_getfmt()
113 mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex); in quota_getfmt()
119 static int quota_getinfo(struct super_block *sb, int type, void __user *addr) in quota_getinfo() argument
128 if (!sb->s_qcop->get_state) in quota_getinfo()
130 ret = sb->s_qcop->get_state(sb, &state); in quota_getinfo()
149 static int quota_setinfo(struct super_block *sb, int type, void __user *addr) in quota_setinfo() argument
156 if (!sb->s_qcop->set_info) in quota_setinfo()
176 return sb->s_qcop->set_info(sb, type, &qinfo); in quota_setinfo()
203 static int quota_getquota(struct super_block *sb, int type, qid_t id, in quota_getquota() argument
211 if (!sb->s_qcop->get_dqblk) in quota_getquota()
216 ret = sb->s_qcop->get_dqblk(sb, qid, &fdq); in quota_getquota()
251 static int quota_setquota(struct super_block *sb, int type, qid_t id, in quota_setquota() argument
260 if (!sb->s_qcop->set_dqblk) in quota_setquota()
266 return sb->s_qcop->set_dqblk(sb, qid, &fdq); in quota_setquota()
269 static int quota_enable(struct super_block *sb, void __user *addr) in quota_enable() argument
275 if (!sb->s_qcop->quota_enable) in quota_enable()
277 return sb->s_qcop->quota_enable(sb, flags); in quota_enable()
280 static int quota_disable(struct super_block *sb, void __user *addr) in quota_disable() argument
286 if (!sb->s_qcop->quota_disable) in quota_disable()
288 return sb->s_qcop->quota_disable(sb, flags); in quota_disable()
310 static int quota_getstate(struct super_block *sb, struct fs_quota_stat *fqs) in quota_getstate() argument
316 ret = sb->s_qcop->get_state(sb, &state); in quota_getstate()
367 static int quota_getxstate(struct super_block *sb, void __user *addr) in quota_getxstate() argument
372 if (!sb->s_qcop->get_state) in quota_getxstate()
374 ret = quota_getstate(sb, &fqs); in quota_getxstate()
380 static int quota_getstatev(struct super_block *sb, struct fs_quota_statv *fqs) in quota_getstatev() argument
386 ret = sb->s_qcop->get_state(sb, &state); in quota_getstatev()
428 static int quota_getxstatev(struct super_block *sb, void __user *addr) in quota_getxstatev() argument
433 if (!sb->s_qcop->get_state) in quota_getxstatev()
447 ret = quota_getstatev(sb, &fqs); in quota_getxstatev()
544 static int quota_setxquota(struct super_block *sb, int type, qid_t id, in quota_setxquota() argument
553 if (!sb->s_qcop->set_dqblk) in quota_setxquota()
564 if (!sb->s_qcop->set_info) in quota_setxquota()
567 ret = sb->s_qcop->set_info(sb, type, &qinfo); in quota_setxquota()
574 return sb->s_qcop->set_dqblk(sb, qid, &qdq); in quota_setxquota()
606 static int quota_getxquota(struct super_block *sb, int type, qid_t id, in quota_getxquota() argument
614 if (!sb->s_qcop->get_dqblk) in quota_getxquota()
619 ret = sb->s_qcop->get_dqblk(sb, qid, &qdq); in quota_getxquota()
628 static int quota_rmxquota(struct super_block *sb, void __user *addr) in quota_rmxquota() argument
634 if (!sb->s_qcop->rm_xquota) in quota_rmxquota()
636 return sb->s_qcop->rm_xquota(sb, flags); in quota_rmxquota()
640 static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, in do_quotactl() argument
651 if (!sb->s_qcop) in do_quotactl()
653 if (!(sb->s_quota_types & (1 << type))) in do_quotactl()
656 ret = check_quotactl_permission(sb, type, cmd, id); in do_quotactl()
662 return quota_quotaon(sb, type, cmd, id, path); in do_quotactl()
664 return quota_quotaoff(sb, type); in do_quotactl()
666 return quota_getfmt(sb, type, addr); in do_quotactl()
668 return quota_getinfo(sb, type, addr); in do_quotactl()
670 return quota_setinfo(sb, type, addr); in do_quotactl()
672 return quota_getquota(sb, type, id, addr); in do_quotactl()
674 return quota_setquota(sb, type, id, addr); in do_quotactl()
676 if (!sb->s_qcop->quota_sync) in do_quotactl()
678 return sb->s_qcop->quota_sync(sb, type); in do_quotactl()
680 return quota_enable(sb, addr); in do_quotactl()
682 return quota_disable(sb, addr); in do_quotactl()
684 return quota_rmxquota(sb, addr); in do_quotactl()
686 return quota_getxstate(sb, addr); in do_quotactl()
688 return quota_getxstatev(sb, addr); in do_quotactl()
690 return quota_setxquota(sb, type, id, addr); in do_quotactl()
692 return quota_getxquota(sb, type, id, addr); in do_quotactl()
694 if (sb->s_flags & MS_RDONLY) in do_quotactl()
731 struct super_block *sb; in quotactl_block() local
741 sb = get_super_thawed(bdev); in quotactl_block()
743 sb = get_super(bdev); in quotactl_block()
745 if (!sb) in quotactl_block()
748 return sb; in quotactl_block()
764 struct super_block *sb = NULL; in SYSCALL_DEFINE4() local
795 sb = quotactl_block(special, cmds); in SYSCALL_DEFINE4()
796 if (IS_ERR(sb)) { in SYSCALL_DEFINE4()
797 ret = PTR_ERR(sb); in SYSCALL_DEFINE4()
801 ret = do_quotactl(sb, type, cmds, id, addr, pathp); in SYSCALL_DEFINE4()
803 drop_super(sb); in SYSCALL_DEFINE4()