Lines Matching refs:oinfo
117 struct ocfs2_mem_dqinfo *oinfo = in ocfs2_global_is_id() local
120 if (qtree_entry_unused(&oinfo->dqi_gi, dp)) in ocfs2_global_is_id()
170 struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_quota_read() local
171 struct inode *gqinode = oinfo->dqi_gqinode; in ocfs2_quota_read()
220 struct ocfs2_mem_dqinfo *oinfo = info->dqi_priv; in ocfs2_quota_write() local
221 struct inode *gqinode = oinfo->dqi_gqinode; in ocfs2_quota_write()
246 oinfo->dqi_gqi_bh, in ocfs2_quota_write()
294 ocfs2_mark_inode_dirty(handle, gqinode, oinfo->dqi_gqi_bh); in ocfs2_quota_write()
298 int ocfs2_lock_global_qf(struct ocfs2_mem_dqinfo *oinfo, int ex) in ocfs2_lock_global_qf() argument
303 status = ocfs2_inode_lock(oinfo->dqi_gqinode, &bh, ex); in ocfs2_lock_global_qf()
307 if (!oinfo->dqi_gqi_count++) in ocfs2_lock_global_qf()
308 oinfo->dqi_gqi_bh = bh; in ocfs2_lock_global_qf()
310 WARN_ON(bh != oinfo->dqi_gqi_bh); in ocfs2_lock_global_qf()
313 inode_lock(oinfo->dqi_gqinode); in ocfs2_lock_global_qf()
314 down_write(&OCFS2_I(oinfo->dqi_gqinode)->ip_alloc_sem); in ocfs2_lock_global_qf()
316 down_read(&OCFS2_I(oinfo->dqi_gqinode)->ip_alloc_sem); in ocfs2_lock_global_qf()
321 void ocfs2_unlock_global_qf(struct ocfs2_mem_dqinfo *oinfo, int ex) in ocfs2_unlock_global_qf() argument
324 up_write(&OCFS2_I(oinfo->dqi_gqinode)->ip_alloc_sem); in ocfs2_unlock_global_qf()
325 inode_unlock(oinfo->dqi_gqinode); in ocfs2_unlock_global_qf()
327 up_read(&OCFS2_I(oinfo->dqi_gqinode)->ip_alloc_sem); in ocfs2_unlock_global_qf()
329 ocfs2_inode_unlock(oinfo->dqi_gqinode, ex); in ocfs2_unlock_global_qf()
330 brelse(oinfo->dqi_gqi_bh); in ocfs2_unlock_global_qf()
332 if (!--oinfo->dqi_gqi_count) in ocfs2_unlock_global_qf()
333 oinfo->dqi_gqi_bh = NULL; in ocfs2_unlock_global_qf()
345 struct ocfs2_mem_dqinfo *oinfo = info->dqi_priv; in ocfs2_global_read_info() local
358 oinfo->dqi_gi.dqi_sb = sb; in ocfs2_global_read_info()
359 oinfo->dqi_gi.dqi_type = type; in ocfs2_global_read_info()
360 ocfs2_qinfo_lock_res_init(&oinfo->dqi_gqlock, oinfo); in ocfs2_global_read_info()
361 oinfo->dqi_gi.dqi_entry_size = sizeof(struct ocfs2_global_disk_dqblk); in ocfs2_global_read_info()
362 oinfo->dqi_gi.dqi_ops = &ocfs2_global_ops; in ocfs2_global_read_info()
363 oinfo->dqi_gqi_bh = NULL; in ocfs2_global_read_info()
364 oinfo->dqi_gqi_count = 0; in ocfs2_global_read_info()
365 oinfo->dqi_gqinode = gqinode; in ocfs2_global_read_info()
366 status = ocfs2_lock_global_qf(oinfo, 0); in ocfs2_global_read_info()
372 status = ocfs2_extent_map_get_blocks(gqinode, 0, &oinfo->dqi_giblk, in ocfs2_global_read_info()
377 status = ocfs2_qinfo_lock(oinfo, 0); in ocfs2_global_read_info()
383 ocfs2_qinfo_unlock(oinfo, 0); in ocfs2_global_read_info()
384 ocfs2_unlock_global_qf(oinfo, 0); in ocfs2_global_read_info()
395 oinfo->dqi_syncms = le32_to_cpu(dinfo.dqi_syncms); in ocfs2_global_read_info()
396 oinfo->dqi_gi.dqi_blocks = le32_to_cpu(dinfo.dqi_blocks); in ocfs2_global_read_info()
397 oinfo->dqi_gi.dqi_free_blk = le32_to_cpu(dinfo.dqi_free_blk); in ocfs2_global_read_info()
398 oinfo->dqi_gi.dqi_free_entry = le32_to_cpu(dinfo.dqi_free_entry); in ocfs2_global_read_info()
399 oinfo->dqi_gi.dqi_blocksize_bits = sb->s_blocksize_bits; in ocfs2_global_read_info()
400 oinfo->dqi_gi.dqi_usable_bs = sb->s_blocksize - in ocfs2_global_read_info()
402 oinfo->dqi_gi.dqi_qtree_depth = qtree_depth(&oinfo->dqi_gi); in ocfs2_global_read_info()
403 INIT_DELAYED_WORK(&oinfo->dqi_sync_work, qsync_work_fn); in ocfs2_global_read_info()
404 schedule_delayed_work(&oinfo->dqi_sync_work, in ocfs2_global_read_info()
405 msecs_to_jiffies(oinfo->dqi_syncms)); in ocfs2_global_read_info()
410 ocfs2_unlock_global_qf(oinfo, 0); in ocfs2_global_read_info()
420 struct ocfs2_mem_dqinfo *oinfo = info->dqi_priv; in __ocfs2_global_write_info() local
429 dinfo.dqi_syncms = cpu_to_le32(oinfo->dqi_syncms); in __ocfs2_global_write_info()
430 dinfo.dqi_blocks = cpu_to_le32(oinfo->dqi_gi.dqi_blocks); in __ocfs2_global_write_info()
431 dinfo.dqi_free_blk = cpu_to_le32(oinfo->dqi_gi.dqi_free_blk); in __ocfs2_global_write_info()
432 dinfo.dqi_free_entry = cpu_to_le32(oinfo->dqi_gi.dqi_free_entry); in __ocfs2_global_write_info()
464 struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_global_qinit_alloc() local
470 return oinfo->dqi_gi.dqi_qtree_depth; in ocfs2_global_qinit_alloc()
601 struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_sync_dquot_helper() local
610 status = ocfs2_lock_global_qf(oinfo, 1); in ocfs2_sync_dquot_helper()
631 ocfs2_unlock_global_qf(oinfo, 1); in ocfs2_sync_dquot_helper()
638 struct ocfs2_mem_dqinfo *oinfo = container_of(work, in qsync_work_fn() local
641 struct super_block *sb = oinfo->dqi_gqinode->i_sb; in qsync_work_fn()
649 dquot_scan_active(sb, ocfs2_sync_dquot_helper, oinfo->dqi_type); in qsync_work_fn()
652 schedule_delayed_work(&oinfo->dqi_sync_work, in qsync_work_fn()
653 msecs_to_jiffies(oinfo->dqi_syncms)); in qsync_work_fn()
685 struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_calc_qdel_credits() local
691 return (oinfo->dqi_gi.dqi_qtree_depth + 2) * in ocfs2_calc_qdel_credits()
721 struct ocfs2_mem_dqinfo *oinfo = in ocfs2_release_dquot() local
746 status = ocfs2_lock_global_qf(oinfo, 1); in ocfs2_release_dquot()
779 ocfs2_unlock_global_qf(oinfo, 1); in ocfs2_release_dquot()
920 struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_mark_dquot_dirty() local
939 status = ocfs2_lock_global_qf(oinfo, 1); in ocfs2_mark_dquot_dirty()
960 ocfs2_unlock_global_qf(oinfo, 1); in ocfs2_mark_dquot_dirty()
972 struct ocfs2_mem_dqinfo *oinfo = sb_dqinfo(sb, type)->dqi_priv; in ocfs2_write_info() local
974 status = ocfs2_lock_global_qf(oinfo, 1); in ocfs2_write_info()
986 ocfs2_unlock_global_qf(oinfo, 1); in ocfs2_write_info()