Lines Matching refs:oinfo
115 struct ocfs2_mem_dqinfo *oinfo = in ocfs2_global_is_id() local
118 if (qtree_entry_unused(&oinfo->dqi_gi, dp)) in ocfs2_global_is_id()
168 struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_quota_read() local
169 struct inode *gqinode = oinfo->dqi_gqinode; in ocfs2_quota_read()
218 struct ocfs2_mem_dqinfo *oinfo = info->dqi_priv; in ocfs2_quota_write() local
219 struct inode *gqinode = oinfo->dqi_gqinode; in ocfs2_quota_write()
244 oinfo->dqi_gqi_bh, in ocfs2_quota_write()
292 ocfs2_mark_inode_dirty(handle, gqinode, oinfo->dqi_gqi_bh); in ocfs2_quota_write()
296 int ocfs2_lock_global_qf(struct ocfs2_mem_dqinfo *oinfo, int ex) in ocfs2_lock_global_qf() argument
301 status = ocfs2_inode_lock(oinfo->dqi_gqinode, &bh, ex); in ocfs2_lock_global_qf()
305 if (!oinfo->dqi_gqi_count++) in ocfs2_lock_global_qf()
306 oinfo->dqi_gqi_bh = bh; in ocfs2_lock_global_qf()
308 WARN_ON(bh != oinfo->dqi_gqi_bh); in ocfs2_lock_global_qf()
311 mutex_lock(&oinfo->dqi_gqinode->i_mutex); in ocfs2_lock_global_qf()
312 down_write(&OCFS2_I(oinfo->dqi_gqinode)->ip_alloc_sem); in ocfs2_lock_global_qf()
314 down_read(&OCFS2_I(oinfo->dqi_gqinode)->ip_alloc_sem); in ocfs2_lock_global_qf()
319 void ocfs2_unlock_global_qf(struct ocfs2_mem_dqinfo *oinfo, int ex) in ocfs2_unlock_global_qf() argument
322 up_write(&OCFS2_I(oinfo->dqi_gqinode)->ip_alloc_sem); in ocfs2_unlock_global_qf()
323 mutex_unlock(&oinfo->dqi_gqinode->i_mutex); in ocfs2_unlock_global_qf()
325 up_read(&OCFS2_I(oinfo->dqi_gqinode)->ip_alloc_sem); in ocfs2_unlock_global_qf()
327 ocfs2_inode_unlock(oinfo->dqi_gqinode, ex); in ocfs2_unlock_global_qf()
328 brelse(oinfo->dqi_gqi_bh); in ocfs2_unlock_global_qf()
330 if (!--oinfo->dqi_gqi_count) in ocfs2_unlock_global_qf()
331 oinfo->dqi_gqi_bh = NULL; in ocfs2_unlock_global_qf()
343 struct ocfs2_mem_dqinfo *oinfo = info->dqi_priv; in ocfs2_global_read_info() local
356 oinfo->dqi_gi.dqi_sb = sb; in ocfs2_global_read_info()
357 oinfo->dqi_gi.dqi_type = type; in ocfs2_global_read_info()
358 ocfs2_qinfo_lock_res_init(&oinfo->dqi_gqlock, oinfo); in ocfs2_global_read_info()
359 oinfo->dqi_gi.dqi_entry_size = sizeof(struct ocfs2_global_disk_dqblk); in ocfs2_global_read_info()
360 oinfo->dqi_gi.dqi_ops = &ocfs2_global_ops; in ocfs2_global_read_info()
361 oinfo->dqi_gqi_bh = NULL; in ocfs2_global_read_info()
362 oinfo->dqi_gqi_count = 0; in ocfs2_global_read_info()
363 oinfo->dqi_gqinode = gqinode; in ocfs2_global_read_info()
364 status = ocfs2_lock_global_qf(oinfo, 0); in ocfs2_global_read_info()
370 status = ocfs2_extent_map_get_blocks(gqinode, 0, &oinfo->dqi_giblk, in ocfs2_global_read_info()
375 status = ocfs2_qinfo_lock(oinfo, 0); in ocfs2_global_read_info()
381 ocfs2_qinfo_unlock(oinfo, 0); in ocfs2_global_read_info()
382 ocfs2_unlock_global_qf(oinfo, 0); in ocfs2_global_read_info()
393 oinfo->dqi_syncms = le32_to_cpu(dinfo.dqi_syncms); in ocfs2_global_read_info()
394 oinfo->dqi_gi.dqi_blocks = le32_to_cpu(dinfo.dqi_blocks); in ocfs2_global_read_info()
395 oinfo->dqi_gi.dqi_free_blk = le32_to_cpu(dinfo.dqi_free_blk); in ocfs2_global_read_info()
396 oinfo->dqi_gi.dqi_free_entry = le32_to_cpu(dinfo.dqi_free_entry); in ocfs2_global_read_info()
397 oinfo->dqi_gi.dqi_blocksize_bits = sb->s_blocksize_bits; in ocfs2_global_read_info()
398 oinfo->dqi_gi.dqi_usable_bs = sb->s_blocksize - in ocfs2_global_read_info()
400 oinfo->dqi_gi.dqi_qtree_depth = qtree_depth(&oinfo->dqi_gi); in ocfs2_global_read_info()
401 INIT_DELAYED_WORK(&oinfo->dqi_sync_work, qsync_work_fn); in ocfs2_global_read_info()
402 schedule_delayed_work(&oinfo->dqi_sync_work, in ocfs2_global_read_info()
403 msecs_to_jiffies(oinfo->dqi_syncms)); in ocfs2_global_read_info()
408 ocfs2_unlock_global_qf(oinfo, 0); in ocfs2_global_read_info()
418 struct ocfs2_mem_dqinfo *oinfo = info->dqi_priv; in __ocfs2_global_write_info() local
427 dinfo.dqi_syncms = cpu_to_le32(oinfo->dqi_syncms); in __ocfs2_global_write_info()
428 dinfo.dqi_blocks = cpu_to_le32(oinfo->dqi_gi.dqi_blocks); in __ocfs2_global_write_info()
429 dinfo.dqi_free_blk = cpu_to_le32(oinfo->dqi_gi.dqi_free_blk); in __ocfs2_global_write_info()
430 dinfo.dqi_free_entry = cpu_to_le32(oinfo->dqi_gi.dqi_free_entry); in __ocfs2_global_write_info()
458 struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_global_qinit_alloc() local
464 return oinfo->dqi_gi.dqi_qtree_depth; in ocfs2_global_qinit_alloc()
595 struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_sync_dquot_helper() local
604 status = ocfs2_lock_global_qf(oinfo, 1); in ocfs2_sync_dquot_helper()
625 ocfs2_unlock_global_qf(oinfo, 1); in ocfs2_sync_dquot_helper()
632 struct ocfs2_mem_dqinfo *oinfo = container_of(work, in qsync_work_fn() local
635 struct super_block *sb = oinfo->dqi_gqinode->i_sb; in qsync_work_fn()
637 dquot_scan_active(sb, ocfs2_sync_dquot_helper, oinfo->dqi_type); in qsync_work_fn()
638 schedule_delayed_work(&oinfo->dqi_sync_work, in qsync_work_fn()
639 msecs_to_jiffies(oinfo->dqi_syncms)); in qsync_work_fn()
671 struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_calc_qdel_credits() local
677 return (oinfo->dqi_gi.dqi_qtree_depth + 2) * in ocfs2_calc_qdel_credits()
707 struct ocfs2_mem_dqinfo *oinfo = in ocfs2_release_dquot() local
732 status = ocfs2_lock_global_qf(oinfo, 1); in ocfs2_release_dquot()
765 ocfs2_unlock_global_qf(oinfo, 1); in ocfs2_release_dquot()
875 struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_mark_dquot_dirty() local
894 status = ocfs2_lock_global_qf(oinfo, 1); in ocfs2_mark_dquot_dirty()
915 ocfs2_unlock_global_qf(oinfo, 1); in ocfs2_mark_dquot_dirty()
927 struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_write_info() local
929 status = ocfs2_lock_global_qf(oinfo, 1); in ocfs2_write_info()
941 ocfs2_unlock_global_qf(oinfo, 1); in ocfs2_write_info()