Lines Matching refs:sb
132 void __quota_error(struct super_block *sb, const char *func, in __quota_error() argument
145 sb->s_id, func, &vaf); in __quota_error()
253 hashfn(const struct super_block *sb, struct kqid qid) in hashfn() argument
259 tmp = (((unsigned long)sb>>L1_CACHE_SHIFT) ^ id) * (MAXQUOTAS - type); in hashfn()
278 static struct dquot *find_dquot(unsigned int hashent, struct super_block *sb, in find_dquot() argument
286 if (dquot->dq_sb == sb && qid_eq(dquot->dq_id, qid)) in find_dquot()
393 void mark_info_dirty(struct super_block *sb, int type) in mark_info_dirty() argument
395 set_bit(DQF_INFO_DIRTY_B, &sb_dqopt(sb)->info[type].dqi_flags); in mark_info_dirty()
513 static void invalidate_dquots(struct super_block *sb, int type) in invalidate_dquots() argument
520 if (dquot->dq_sb != sb) in invalidate_dquots()
561 int dquot_scan_active(struct super_block *sb, in dquot_scan_active() argument
568 mutex_lock(&sb_dqopt(sb)->dqonoff_mutex); in dquot_scan_active()
573 if (dquot->dq_sb != sb) in dquot_scan_active()
599 mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex); in dquot_scan_active()
605 int dquot_writeback_dquots(struct super_block *sb, int type) in dquot_writeback_dquots() argument
609 struct quota_info *dqopt = sb_dqopt(sb); in dquot_writeback_dquots()
617 if (!sb_has_quota_active(sb, cnt)) in dquot_writeback_dquots()
635 err = sb->dq_op->write_dquot(dquot); in dquot_writeback_dquots()
645 if ((cnt == type || type == -1) && sb_has_quota_active(sb, cnt) in dquot_writeback_dquots()
647 sb->dq_op->write_info(sb, cnt); in dquot_writeback_dquots()
656 int dquot_quota_sync(struct super_block *sb, int type) in dquot_quota_sync() argument
658 struct quota_info *dqopt = sb_dqopt(sb); in dquot_quota_sync()
662 ret = dquot_writeback_dquots(sb, type); in dquot_quota_sync()
671 if (sb->s_op->sync_fs) in dquot_quota_sync()
672 sb->s_op->sync_fs(sb, 1); in dquot_quota_sync()
673 sync_blockdev(sb->s_bdev); in dquot_quota_sync()
683 if (!sb_has_quota_active(sb, cnt)) in dquot_quota_sync()
797 struct dquot *dquot_alloc(struct super_block *sb, int type) in dquot_alloc() argument
803 static struct dquot *get_empty_dquot(struct super_block *sb, int type) in get_empty_dquot() argument
807 dquot = sb->dq_op->alloc_dquot(sb, type); in get_empty_dquot()
817 dquot->dq_sb = sb; in get_empty_dquot()
832 struct dquot *dqget(struct super_block *sb, struct kqid qid) in dqget() argument
834 unsigned int hashent = hashfn(sb, qid); in dqget()
837 if (!sb_has_quota_active(sb, qid.type)) in dqget()
842 if (!sb_has_quota_active(sb, qid.type)) { in dqget()
849 dquot = find_dquot(hashent, sb, qid); in dqget()
853 empty = get_empty_dquot(sb, qid.type); in dqget()
880 sb->dq_op->acquire_dquot(dquot) < 0) { in dqget()
919 static void add_dquot_ref(struct super_block *sb, int type) in add_dquot_ref() argument
927 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { in add_dquot_ref()
962 quota_error(sb, "Writes happened before quota was turned on " in add_dquot_ref()
1020 static void remove_dquot_ref(struct super_block *sb, int type, in remove_dquot_ref() argument
1027 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { in remove_dquot_ref()
1047 "inconsistent. Please run quotacheck(8).\n", sb->s_id); in remove_dquot_ref()
1053 static void drop_dquot_ref(struct super_block *sb, int type) in drop_dquot_ref() argument
1057 if (sb->dq_op) { in drop_dquot_ref()
1058 remove_dquot_ref(sb, type, &tofree_head); in drop_dquot_ref()
1300 struct super_block *sb = dquot->dq_sb; in check_bdq() local
1302 if (!sb_has_quota_limits_enabled(sb, dquot->dq_id.type) || in check_bdq()
1333 sb_dqopt(sb)->info[dquot->dq_id.type].dqi_bgrace; in check_bdq()
1380 struct super_block *sb = inode->i_sb; in dquot_active() local
1384 return sb_any_quota_loaded(sb) & ~sb_any_quota_suspended(sb); in dquot_active()
1397 struct super_block *sb = inode->i_sb; in __dquot_initialize() local
1421 if (!sb_has_quota_active(sb, cnt)) in __dquot_initialize()
1440 got[cnt] = dqget(sb, qid); in __dquot_initialize()
1454 if (!sb_has_quota_active(sb, cnt)) in __dquot_initialize()
1963 struct super_block *sb = inode->i_sb; in dquot_transfer() local
1970 transfer_to[USRQUOTA] = dqget(sb, make_kqid_uid(iattr->ia_uid)); in dquot_transfer()
1972 transfer_to[GRPQUOTA] = dqget(sb, make_kqid_gid(iattr->ia_gid)); in dquot_transfer()
1983 int dquot_commit_info(struct super_block *sb, int type) in dquot_commit_info() argument
1986 struct quota_info *dqopt = sb_dqopt(sb); in dquot_commit_info()
1989 ret = dqopt->ops[type]->write_file_info(sb, type); in dquot_commit_info()
2026 int dquot_disable(struct super_block *sb, int type, unsigned int flags) in dquot_disable() argument
2029 struct quota_info *dqopt = sb_dqopt(sb); in dquot_disable()
2047 if (!sb_any_quota_loaded(sb)) { in dquot_disable()
2055 if (!sb_has_quota_loaded(sb, cnt)) in dquot_disable()
2067 if (!sb_has_quota_loaded(sb, cnt) && in dquot_disable()
2068 sb_has_quota_suspended(sb, cnt)) { in dquot_disable()
2080 if (sb_has_quota_loaded(sb, cnt) && !(flags & DQUOT_SUSPENDED)) in dquot_disable()
2084 drop_dquot_ref(sb, cnt); in dquot_disable()
2085 invalidate_dquots(sb, cnt); in dquot_disable()
2091 sb->dq_op->write_info(sb, cnt); in dquot_disable()
2093 dqopt->ops[cnt]->free_file_info(sb, cnt); in dquot_disable()
2097 if (!sb_has_quota_loaded(sb, cnt)) in dquot_disable()
2112 if (sb->s_op->sync_fs) in dquot_disable()
2113 sb->s_op->sync_fs(sb, 1); in dquot_disable()
2114 sync_blockdev(sb->s_bdev); in dquot_disable()
2125 if (!sb_has_quota_loaded(sb, cnt)) { in dquot_disable()
2136 if (sb->s_bdev) in dquot_disable()
2137 invalidate_bdev(sb->s_bdev); in dquot_disable()
2157 int dquot_quota_off(struct super_block *sb, int type) in dquot_quota_off() argument
2159 return dquot_disable(sb, type, in dquot_quota_off()
2176 struct super_block *sb = inode->i_sb; in vfs_load_quota_inode() local
2177 struct quota_info *dqopt = sb_dqopt(sb); in vfs_load_quota_inode()
2191 if (!sb->s_op->quota_write || !sb->s_op->quota_read || in vfs_load_quota_inode()
2192 (type == PRJQUOTA && sb->dq_op->get_projid == NULL)) { in vfs_load_quota_inode()
2209 sync_filesystem(sb); in vfs_load_quota_inode()
2210 invalidate_bdev(sb->s_bdev); in vfs_load_quota_inode()
2213 if (sb_has_quota_loaded(sb, type)) { in vfs_load_quota_inode()
2239 if (!fmt->qf_ops->check_quota_file(sb, type)) in vfs_load_quota_inode()
2247 error = dqopt->ops[type]->read_file_info(sb, type); in vfs_load_quota_inode()
2259 add_dquot_ref(sb, type); in vfs_load_quota_inode()
2284 int dquot_resume(struct super_block *sb, int type) in dquot_resume() argument
2286 struct quota_info *dqopt = sb_dqopt(sb); in dquot_resume()
2296 if (!sb_has_quota_suspended(sb, cnt)) { in dquot_resume()
2320 int dquot_quota_on(struct super_block *sb, int type, int format_id, in dquot_quota_on() argument
2327 if (path->dentry->d_sb != sb) in dquot_quota_on()
2345 struct super_block *sb = inode->i_sb; in dquot_enable() local
2346 struct quota_info *dqopt = sb_dqopt(sb); in dquot_enable()
2354 if (sb_has_quota_loaded(sb, type)) { in dquot_enable()
2357 if (!sb_has_quota_loaded(sb, type)) { in dquot_enable()
2362 sb_has_quota_usage_enabled(sb, type)) { in dquot_enable()
2367 sb_has_quota_limits_enabled(sb, type)) { in dquot_enable()
2372 sb_dqopt(sb)->flags |= dquot_state_flag(flags, type); in dquot_enable()
2388 int dquot_quota_on_mount(struct super_block *sb, char *qf_name, in dquot_quota_on_mount() argument
2394 mutex_lock(&d_inode(sb->s_root)->i_mutex); in dquot_quota_on_mount()
2395 dentry = lookup_one_len(qf_name, sb->s_root, strlen(qf_name)); in dquot_quota_on_mount()
2396 mutex_unlock(&d_inode(sb->s_root)->i_mutex); in dquot_quota_on_mount()
2416 static int dquot_quota_enable(struct super_block *sb, unsigned int flags) in dquot_quota_enable() argument
2420 struct quota_info *dqopt = sb_dqopt(sb); in dquot_quota_enable()
2432 if (!sb_has_quota_usage_enabled(sb, type)) in dquot_quota_enable()
2445 dquot_disable(sb, type, DQUOT_LIMITS_ENABLED); in dquot_quota_enable()
2453 static int dquot_quota_disable(struct super_block *sb, unsigned int flags) in dquot_quota_disable() argument
2457 struct quota_info *dqopt = sb_dqopt(sb); in dquot_quota_disable()
2472 if (!sb_has_quota_limits_enabled(sb, type)) in dquot_quota_disable()
2479 ret = dquot_disable(sb, type, DQUOT_LIMITS_ENABLED); in dquot_quota_disable()
2514 int dquot_get_dqblk(struct super_block *sb, struct kqid qid, in dquot_get_dqblk() argument
2519 dquot = dqget(sb, qid); in dquot_get_dqblk()
2626 int dquot_set_dqblk(struct super_block *sb, struct kqid qid, in dquot_set_dqblk() argument
2632 dquot = dqget(sb, qid); in dquot_set_dqblk()
2645 int dquot_get_state(struct super_block *sb, struct qc_state *state) in dquot_get_state() argument
2649 struct quota_info *dqopt = sb_dqopt(sb); in dquot_get_state()
2652 mutex_lock(&sb_dqopt(sb)->dqonoff_mutex); in dquot_get_state()
2655 if (!sb_has_quota_active(sb, type)) in dquot_get_state()
2658 mi = sb_dqopt(sb)->info + type; in dquot_get_state()
2665 if (sb_has_quota_limits_enabled(sb, type)) in dquot_get_state()
2674 mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex); in dquot_get_state()
2680 int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii) in dquot_set_dqinfo() argument
2688 mutex_lock(&sb_dqopt(sb)->dqonoff_mutex); in dquot_set_dqinfo()
2689 if (!sb_has_quota_active(sb, type)) { in dquot_set_dqinfo()
2693 mi = sb_dqopt(sb)->info + type; in dquot_set_dqinfo()
2713 mark_info_dirty(sb, type); in dquot_set_dqinfo()
2715 sb->dq_op->write_info(sb, type); in dquot_set_dqinfo()
2717 mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex); in dquot_set_dqinfo()