• Home
  • Raw
  • Download

Lines Matching refs:sb

26 static int check_quotactl_permission(struct super_block *sb, int type, int cmd,  in check_quotactl_permission()  argument
50 return security_quotactl(cmd, type, id, sb); in check_quotactl_permission()
53 static void quota_sync_one(struct super_block *sb, void *arg) in quota_sync_one() argument
57 if (sb->s_qcop && sb->s_qcop->quota_sync && in quota_sync_one()
58 (sb->s_quota_types & (1 << type))) in quota_sync_one()
59 sb->s_qcop->quota_sync(sb, type); in quota_sync_one()
85 static int quota_quotaon(struct super_block *sb, int type, qid_t id, in quota_quotaon() argument
88 if (!sb->s_qcop->quota_on && !sb->s_qcop->quota_enable) in quota_quotaon()
90 if (sb->s_qcop->quota_enable) in quota_quotaon()
91 return sb->s_qcop->quota_enable(sb, qtype_enforce_flag(type)); in quota_quotaon()
94 return sb->s_qcop->quota_on(sb, type, id, path); in quota_quotaon()
97 static int quota_quotaoff(struct super_block *sb, int type) in quota_quotaoff() argument
99 if (!sb->s_qcop->quota_off && !sb->s_qcop->quota_disable) in quota_quotaoff()
101 if (sb->s_qcop->quota_disable) in quota_quotaoff()
102 return sb->s_qcop->quota_disable(sb, qtype_enforce_flag(type)); in quota_quotaoff()
103 return sb->s_qcop->quota_off(sb, type); in quota_quotaoff()
106 static int quota_getfmt(struct super_block *sb, int type, void __user *addr) in quota_getfmt() argument
110 if (!sb_has_quota_active(sb, type)) in quota_getfmt()
112 fmt = sb_dqopt(sb)->info[type].dqi_format->qf_fmt_id; in quota_getfmt()
118 static int quota_getinfo(struct super_block *sb, int type, void __user *addr) in quota_getinfo() argument
125 if (!sb->s_qcop->get_state) in quota_getinfo()
127 ret = sb->s_qcop->get_state(sb, &state); in quota_getinfo()
146 static int quota_setinfo(struct super_block *sb, int type, void __user *addr) in quota_setinfo() argument
153 if (!sb->s_qcop->set_info) in quota_setinfo()
173 return sb->s_qcop->set_info(sb, type, &qinfo); in quota_setinfo()
200 static int quota_getquota(struct super_block *sb, int type, qid_t id, in quota_getquota() argument
208 if (!sb->s_qcop->get_dqblk) in quota_getquota()
211 if (!qid_has_mapping(sb->s_user_ns, qid)) in quota_getquota()
213 ret = sb->s_qcop->get_dqblk(sb, qid, &fdq); in quota_getquota()
236 static int quota_getnextquota(struct super_block *sb, int type, qid_t id, in quota_getnextquota() argument
244 if (!sb->s_qcop->get_nextdqblk) in quota_getnextquota()
247 if (!qid_has_mapping(sb->s_user_ns, qid)) in quota_getnextquota()
249 ret = sb->s_qcop->get_nextdqblk(sb, &qid, &fdq); in quota_getnextquota()
286 static int quota_setquota(struct super_block *sb, int type, qid_t id, in quota_setquota() argument
303 if (!sb->s_qcop->set_dqblk) in quota_setquota()
306 if (!qid_has_mapping(sb->s_user_ns, qid)) in quota_setquota()
309 return sb->s_qcop->set_dqblk(sb, qid, &fdq); in quota_setquota()
312 static int quota_enable(struct super_block *sb, void __user *addr) in quota_enable() argument
318 if (!sb->s_qcop->quota_enable) in quota_enable()
320 return sb->s_qcop->quota_enable(sb, flags); in quota_enable()
323 static int quota_disable(struct super_block *sb, void __user *addr) in quota_disable() argument
329 if (!sb->s_qcop->quota_disable) in quota_disable()
331 return sb->s_qcop->quota_disable(sb, flags); in quota_disable()
353 static int quota_getstate(struct super_block *sb, int type, in quota_getstate() argument
360 ret = sb->s_qcop->get_state(sb, &state); in quota_getstate()
433 static int quota_getxstate(struct super_block *sb, int type, void __user *addr) in quota_getxstate() argument
438 if (!sb->s_qcop->get_state) in quota_getxstate()
440 ret = quota_getstate(sb, type, &fqs); in quota_getxstate()
451 static int quota_getstatev(struct super_block *sb, int type, in quota_getstatev() argument
458 ret = sb->s_qcop->get_state(sb, &state); in quota_getstatev()
496 static int quota_getxstatev(struct super_block *sb, int type, void __user *addr) in quota_getxstatev() argument
501 if (!sb->s_qcop->get_state) in quota_getxstatev()
515 ret = quota_getstatev(sb, type, &fqs); in quota_getxstatev()
623 static int quota_setxquota(struct super_block *sb, int type, qid_t id, in quota_setxquota() argument
632 if (!sb->s_qcop->set_dqblk) in quota_setxquota()
635 if (!qid_has_mapping(sb->s_user_ns, qid)) in quota_setxquota()
638 if (from_kqid(sb->s_user_ns, qid) == 0 && in quota_setxquota()
643 if (!sb->s_qcop->set_info) in quota_setxquota()
646 ret = sb->s_qcop->set_info(sb, type, &qinfo); in quota_setxquota()
653 return sb->s_qcop->set_dqblk(sb, qid, &qdq); in quota_setxquota()
704 static int quota_getxquota(struct super_block *sb, int type, qid_t id, in quota_getxquota() argument
712 if (!sb->s_qcop->get_dqblk) in quota_getxquota()
715 if (!qid_has_mapping(sb->s_user_ns, qid)) in quota_getxquota()
717 ret = sb->s_qcop->get_dqblk(sb, qid, &qdq); in quota_getxquota()
730 static int quota_getnextxquota(struct super_block *sb, int type, qid_t id, in quota_getnextxquota() argument
739 if (!sb->s_qcop->get_nextdqblk) in quota_getnextxquota()
742 if (!qid_has_mapping(sb->s_user_ns, qid)) in quota_getnextxquota()
744 ret = sb->s_qcop->get_nextdqblk(sb, &qid, &qdq); in quota_getnextxquota()
754 static int quota_rmxquota(struct super_block *sb, void __user *addr) in quota_rmxquota() argument
760 if (!sb->s_qcop->rm_xquota) in quota_rmxquota()
762 return sb->s_qcop->rm_xquota(sb, flags); in quota_rmxquota()
766 static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, in do_quotactl() argument
776 if (!sb->s_qcop) in do_quotactl()
778 if (!(sb->s_quota_types & (1 << type))) in do_quotactl()
781 ret = check_quotactl_permission(sb, type, cmd, id); in do_quotactl()
787 return quota_quotaon(sb, type, id, path); in do_quotactl()
789 return quota_quotaoff(sb, type); in do_quotactl()
791 return quota_getfmt(sb, type, addr); in do_quotactl()
793 return quota_getinfo(sb, type, addr); in do_quotactl()
795 return quota_setinfo(sb, type, addr); in do_quotactl()
797 return quota_getquota(sb, type, id, addr); in do_quotactl()
799 return quota_getnextquota(sb, type, id, addr); in do_quotactl()
801 return quota_setquota(sb, type, id, addr); in do_quotactl()
803 if (!sb->s_qcop->quota_sync) in do_quotactl()
805 return sb->s_qcop->quota_sync(sb, type); in do_quotactl()
807 return quota_enable(sb, addr); in do_quotactl()
809 return quota_disable(sb, addr); in do_quotactl()
811 return quota_rmxquota(sb, addr); in do_quotactl()
813 return quota_getxstate(sb, type, addr); in do_quotactl()
815 return quota_getxstatev(sb, type, addr); in do_quotactl()
817 return quota_setxquota(sb, type, id, addr); in do_quotactl()
819 return quota_getxquota(sb, type, id, addr); in do_quotactl()
821 return quota_getnextxquota(sb, type, id, addr); in do_quotactl()
823 if (sb_rdonly(sb)) in do_quotactl()
868 struct super_block *sb; in quotactl_block() local
889 sb = user_get_super(dev, excl); in quotactl_block()
890 if (!sb) in quotactl_block()
892 if (thawed && sb->s_writers.frozen != SB_UNFROZEN) { in quotactl_block()
894 up_write(&sb->s_umount); in quotactl_block()
896 up_read(&sb->s_umount); in quotactl_block()
897 wait_event(sb->s_writers.wait_unfrozen, in quotactl_block()
898 sb->s_writers.frozen == SB_UNFROZEN); in quotactl_block()
899 put_super(sb); in quotactl_block()
902 return sb; in quotactl_block()
919 struct super_block *sb = NULL; in SYSCALL_DEFINE4() local
953 sb = quotactl_block(special, cmds); in SYSCALL_DEFINE4()
954 if (IS_ERR(sb)) { in SYSCALL_DEFINE4()
955 ret = PTR_ERR(sb); in SYSCALL_DEFINE4()
959 ret = do_quotactl(sb, type, cmds, id, addr, pathp); in SYSCALL_DEFINE4()
962 drop_super(sb); in SYSCALL_DEFINE4()
964 drop_super_exclusive(sb); in SYSCALL_DEFINE4()
974 struct super_block *sb; in SYSCALL_DEFINE4() local
994 sb = f.file->f_path.mnt->mnt_sb; in SYSCALL_DEFINE4()
996 down_write(&sb->s_umount); in SYSCALL_DEFINE4()
998 down_read(&sb->s_umount); in SYSCALL_DEFINE4()
1000 ret = do_quotactl(sb, type, cmds, id, addr, ERR_PTR(-EINVAL)); in SYSCALL_DEFINE4()
1003 up_write(&sb->s_umount); in SYSCALL_DEFINE4()
1005 up_read(&sb->s_umount); in SYSCALL_DEFINE4()