/* We don't need the lock and we have to acquire quota file locks
* which will later depend on this lock */
- up_write(&sb_dqopt(sb)->dqio_sem);
+ up_read(&sb_dqopt(sb)->dqio_sem);
info->dqi_max_spc_limit = 0x7fffffffffffffffLL;
info->dqi_max_ino_limit = 0x7fffffffffffffffLL;
oinfo = kmalloc(sizeof(struct ocfs2_mem_dqinfo), GFP_NOFS);
goto out_err;
}
- down_write(&sb_dqopt(sb)->dqio_sem);
+ down_read(&sb_dqopt(sb)->dqio_sem);
return 0;
out_err:
if (oinfo) {
kfree(oinfo);
}
brelse(bh);
- down_write(&sb_dqopt(sb)->dqio_sem);
+ down_read(&sb_dqopt(sb)->dqio_sem);
return -1;
}
dqopt->info[type].dqi_format = fmt;
dqopt->info[type].dqi_fmt_id = format_id;
INIT_LIST_HEAD(&dqopt->info[type].dqi_dirty_list);
- down_write(&dqopt->dqio_sem);
+ down_read(&dqopt->dqio_sem);
error = dqopt->ops[type]->read_file_info(sb, type);
if (error < 0) {
- up_write(&dqopt->dqio_sem);
+ up_read(&dqopt->dqio_sem);
goto out_file_init;
}
if (dqopt->flags & DQUOT_QUOTA_SYS_FILE)
dqopt->info[type].dqi_flags |= DQF_SYS_FILE;
- up_write(&dqopt->dqio_sem);
+ up_read(&dqopt->dqio_sem);
spin_lock(&dq_state_lock);
dqopt->flags |= dquot_state_flag(flags, type);
spin_unlock(&dq_state_lock);