Lines Matching refs:mdsc
15 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb); in ceph_adjust_quota_realms_count() local
17 atomic64_inc(&mdsc->quotarealms_count); in ceph_adjust_quota_realms_count()
19 atomic64_dec(&mdsc->quotarealms_count); in ceph_adjust_quota_realms_count()
25 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(sb); in ceph_has_realms_with_quotas() local
28 if (atomic64_read(&mdsc->quotarealms_count) > 0) in ceph_has_realms_with_quotas()
37 void ceph_handle_quota(struct ceph_mds_client *mdsc, in ceph_handle_quota() argument
41 struct super_block *sb = mdsc->fsc->sb; in ceph_handle_quota()
82 find_quotarealm_inode(struct ceph_mds_client *mdsc, u64 ino) in find_quotarealm_inode() argument
87 mutex_lock(&mdsc->quotarealms_inodes_mutex); in find_quotarealm_inode()
88 node = &(mdsc->quotarealms_inodes.rb_node); in find_quotarealm_inode()
109 rb_insert_color(&qri->node, &mdsc->quotarealms_inodes); in find_quotarealm_inode()
113 mutex_unlock(&mdsc->quotarealms_inodes_mutex); in find_quotarealm_inode()
126 static struct inode *lookup_quotarealm_inode(struct ceph_mds_client *mdsc, in lookup_quotarealm_inode() argument
133 qri = find_quotarealm_inode(mdsc, realm->ino); in lookup_quotarealm_inode()
174 void ceph_cleanup_quotarealms_inodes(struct ceph_mds_client *mdsc) in ceph_cleanup_quotarealms_inodes() argument
183 mutex_lock(&mdsc->quotarealms_inodes_mutex); in ceph_cleanup_quotarealms_inodes()
184 while (!RB_EMPTY_ROOT(&mdsc->quotarealms_inodes)) { in ceph_cleanup_quotarealms_inodes()
185 node = rb_first(&mdsc->quotarealms_inodes); in ceph_cleanup_quotarealms_inodes()
187 rb_erase(node, &mdsc->quotarealms_inodes); in ceph_cleanup_quotarealms_inodes()
191 mutex_unlock(&mdsc->quotarealms_inodes_mutex); in ceph_cleanup_quotarealms_inodes()
209 static struct ceph_snap_realm *get_quota_realm(struct ceph_mds_client *mdsc, in get_quota_realm() argument
223 ceph_get_snap_realm(mdsc, realm); in get_quota_realm()
237 up_read(&mdsc->snap_rwsem); in get_quota_realm()
238 in = lookup_quotarealm_inode(mdsc, inode->i_sb, realm); in get_quota_realm()
239 down_read(&mdsc->snap_rwsem); in get_quota_realm()
242 ceph_put_snap_realm(mdsc, realm); in get_quota_realm()
257 ceph_get_snap_realm(mdsc, next); in get_quota_realm()
258 ceph_put_snap_realm(mdsc, realm); in get_quota_realm()
262 ceph_put_snap_realm(mdsc, realm); in get_quota_realm()
269 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(old->i_sb); in ceph_quota_is_same_realm() local
280 down_read(&mdsc->snap_rwsem); in ceph_quota_is_same_realm()
281 old_realm = get_quota_realm(mdsc, old, true); in ceph_quota_is_same_realm()
282 new_realm = get_quota_realm(mdsc, new, false); in ceph_quota_is_same_realm()
284 up_read(&mdsc->snap_rwsem); in ceph_quota_is_same_realm()
286 ceph_put_snap_realm(mdsc, old_realm); in ceph_quota_is_same_realm()
290 up_read(&mdsc->snap_rwsem); in ceph_quota_is_same_realm()
293 ceph_put_snap_realm(mdsc, old_realm); in ceph_quota_is_same_realm()
295 ceph_put_snap_realm(mdsc, new_realm); in ceph_quota_is_same_realm()
316 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb); in check_quota_exceeded() local
326 down_read(&mdsc->snap_rwsem); in check_quota_exceeded()
330 ceph_get_snap_realm(mdsc, realm); in check_quota_exceeded()
344 up_read(&mdsc->snap_rwsem); in check_quota_exceeded()
345 in = lookup_quotarealm_inode(mdsc, inode->i_sb, realm); in check_quota_exceeded()
346 down_read(&mdsc->snap_rwsem); in check_quota_exceeded()
349 ceph_put_snap_realm(mdsc, realm); in check_quota_exceeded()
392 ceph_get_snap_realm(mdsc, next); in check_quota_exceeded()
393 ceph_put_snap_realm(mdsc, realm); in check_quota_exceeded()
397 ceph_put_snap_realm(mdsc, realm); in check_quota_exceeded()
398 up_read(&mdsc->snap_rwsem); in check_quota_exceeded()
478 struct ceph_mds_client *mdsc = fsc->mdsc; in ceph_quota_update_statfs() local
485 down_read(&mdsc->snap_rwsem); in ceph_quota_update_statfs()
486 realm = get_quota_realm(mdsc, d_inode(fsc->sb->s_root), true); in ceph_quota_update_statfs()
487 up_read(&mdsc->snap_rwsem); in ceph_quota_update_statfs()
514 ceph_put_snap_realm(mdsc, realm); in ceph_quota_update_statfs()
533 int ceph_quota_check_rename(struct ceph_mds_client *mdsc, in ceph_quota_check_rename() argument