Lines Matching refs:mdsc
15 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb);
17 atomic64_inc(&mdsc->quotarealms_count);
19 atomic64_dec(&mdsc->quotarealms_count);
25 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(sb);
28 if (atomic64_read(&mdsc->quotarealms_count) > 0)
40 void ceph_handle_quota(struct ceph_mds_client *mdsc,
44 struct super_block *sb = mdsc->fsc->sb;
50 if (!ceph_inc_mds_stopping_blocker(mdsc, session))
80 ceph_dec_mds_stopping_blocker(mdsc);
84 find_quotarealm_inode(struct ceph_mds_client *mdsc, u64 ino)
89 mutex_lock(&mdsc->quotarealms_inodes_mutex);
90 node = &(mdsc->quotarealms_inodes.rb_node);
111 rb_insert_color(&qri->node, &mdsc->quotarealms_inodes);
115 mutex_unlock(&mdsc->quotarealms_inodes_mutex);
123 * maintained in the mdsc and freed only when the filesystem is umounted.
128 static struct inode *lookup_quotarealm_inode(struct ceph_mds_client *mdsc,
135 qri = find_quotarealm_inode(mdsc, realm->ino);
176 void ceph_cleanup_quotarealms_inodes(struct ceph_mds_client *mdsc)
183 * mdsc->quotarealms_inodes_mutex...
185 mutex_lock(&mdsc->quotarealms_inodes_mutex);
186 while (!RB_EMPTY_ROOT(&mdsc->quotarealms_inodes)) {
187 node = rb_first(&mdsc->quotarealms_inodes);
189 rb_erase(node, &mdsc->quotarealms_inodes);
193 mutex_unlock(&mdsc->quotarealms_inodes_mutex);
205 * Callers of this function need to hold mdsc->snap_rwsem. However, if there's
211 static int get_quota_realm(struct ceph_mds_client *mdsc, struct inode *inode,
228 ceph_get_snap_realm(mdsc, realm);
242 up_read(&mdsc->snap_rwsem);
243 in = lookup_quotarealm_inode(mdsc, inode->i_sb, realm);
244 down_read(&mdsc->snap_rwsem);
247 ceph_put_snap_realm(mdsc, realm);
264 ceph_get_snap_realm(mdsc, next);
265 ceph_put_snap_realm(mdsc, realm);
269 ceph_put_snap_realm(mdsc, realm);
276 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(old->i_sb);
288 down_read(&mdsc->snap_rwsem);
289 get_quota_realm(mdsc, old, QUOTA_GET_ANY, &old_realm, true);
290 ret = get_quota_realm(mdsc, new, QUOTA_GET_ANY, &new_realm, false);
292 up_read(&mdsc->snap_rwsem);
294 ceph_put_snap_realm(mdsc, old_realm);
298 up_read(&mdsc->snap_rwsem);
301 ceph_put_snap_realm(mdsc, old_realm);
303 ceph_put_snap_realm(mdsc, new_realm);
324 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb);
334 down_read(&mdsc->snap_rwsem);
338 ceph_get_snap_realm(mdsc, realm);
352 up_read(&mdsc->snap_rwsem);
353 in = lookup_quotarealm_inode(mdsc, inode->i_sb, realm);
354 down_read(&mdsc->snap_rwsem);
357 ceph_put_snap_realm(mdsc, realm);
399 ceph_get_snap_realm(mdsc, next);
400 ceph_put_snap_realm(mdsc, realm);
404 ceph_put_snap_realm(mdsc, realm);
405 up_read(&mdsc->snap_rwsem);
485 struct ceph_mds_client *mdsc = fsc->mdsc;
492 down_read(&mdsc->snap_rwsem);
493 get_quota_realm(mdsc, d_inode(fsc->sb->s_root), QUOTA_GET_MAX_BYTES,
495 up_read(&mdsc->snap_rwsem);
536 ceph_put_snap_realm(mdsc, realm);