Lines Matching refs:inode

13 void ceph_adjust_quota_realms_count(struct inode *inode, bool inc)  in ceph_adjust_quota_realms_count()  argument
15 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb); in ceph_adjust_quota_realms_count()
22 static inline bool ceph_has_realms_with_quotas(struct inode *inode) in ceph_has_realms_with_quotas() argument
24 struct super_block *sb = inode->i_sb; in ceph_has_realms_with_quotas()
26 struct inode *root = d_inode(sb->s_root); in ceph_has_realms_with_quotas()
34 if (ceph_vino_is_reserved(ceph_inode(inode)->i_vino)) in ceph_has_realms_with_quotas()
47 struct inode *inode; in ceph_handle_quota() local
63 inode = ceph_find_inode(sb, vino); in ceph_handle_quota()
64 if (!inode) { in ceph_handle_quota()
68 ci = ceph_inode(inode); in ceph_handle_quota()
78 iput(inode); in ceph_handle_quota()
107 qri->inode = NULL; in find_quotarealm_inode()
128 static struct inode *lookup_quotarealm_inode(struct ceph_mds_client *mdsc, in lookup_quotarealm_inode()
133 struct inode *in; in lookup_quotarealm_inode()
140 if (qri->inode && ceph_is_any_caps(qri->inode)) { in lookup_quotarealm_inode()
143 return qri->inode; in lookup_quotarealm_inode()
151 if (qri->inode) { in lookup_quotarealm_inode()
153 int ret = __ceph_do_getattr(qri->inode, NULL, in lookup_quotarealm_inode()
156 in = qri->inode; in lookup_quotarealm_inode()
169 qri->inode = in; in lookup_quotarealm_inode()
190 iput(qri->inode); in ceph_cleanup_quotarealms_inodes()
211 static int get_quota_realm(struct ceph_mds_client *mdsc, struct inode *inode, in get_quota_realm() argument
217 struct inode *in; in get_quota_realm()
222 if (ceph_snap(inode) != CEPH_NOSNAP) in get_quota_realm()
226 realm = ceph_inode(inode)->i_snap_realm; in get_quota_realm()
231 "null i_snap_realm\n", ceph_vinop(inode)); in get_quota_realm()
236 has_inode = realm->inode; in get_quota_realm()
237 in = has_inode ? igrab(realm->inode) : NULL; in get_quota_realm()
243 in = lookup_quotarealm_inode(mdsc, inode->i_sb, realm); in get_quota_realm()
274 bool ceph_quota_is_same_realm(struct inode *old, struct inode *new) in ceph_quota_is_same_realm()
321 static bool check_quota_exceeded(struct inode *inode, enum quota_check_op op, in check_quota_exceeded() argument
324 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(inode->i_sb); in check_quota_exceeded()
327 struct inode *in; in check_quota_exceeded()
331 if (ceph_snap(inode) != CEPH_NOSNAP) in check_quota_exceeded()
336 realm = ceph_inode(inode)->i_snap_realm; in check_quota_exceeded()
341 "null i_snap_realm\n", ceph_vinop(inode)); in check_quota_exceeded()
346 has_inode = realm->inode; in check_quota_exceeded()
347 in = has_inode ? igrab(realm->inode) : NULL; in check_quota_exceeded()
353 in = lookup_quotarealm_inode(mdsc, inode->i_sb, realm); in check_quota_exceeded()
418 bool ceph_quota_is_max_files_exceeded(struct inode *inode) in ceph_quota_is_max_files_exceeded() argument
420 if (!ceph_has_realms_with_quotas(inode)) in ceph_quota_is_max_files_exceeded()
423 WARN_ON(!S_ISDIR(inode->i_mode)); in ceph_quota_is_max_files_exceeded()
425 return check_quota_exceeded(inode, QUOTA_CHECK_MAX_FILES_OP, 1); in ceph_quota_is_max_files_exceeded()
436 bool ceph_quota_is_max_bytes_exceeded(struct inode *inode, loff_t newsize) in ceph_quota_is_max_bytes_exceeded() argument
438 loff_t size = i_size_read(inode); in ceph_quota_is_max_bytes_exceeded()
440 if (!ceph_has_realms_with_quotas(inode)) in ceph_quota_is_max_bytes_exceeded()
447 return check_quota_exceeded(inode, QUOTA_CHECK_MAX_BYTES_OP, (newsize - size)); in ceph_quota_is_max_bytes_exceeded()
458 bool ceph_quota_is_max_bytes_approaching(struct inode *inode, loff_t newsize) in ceph_quota_is_max_bytes_approaching() argument
460 loff_t size = ceph_inode(inode)->i_reported_size; in ceph_quota_is_max_bytes_approaching()
462 if (!ceph_has_realms_with_quotas(inode)) in ceph_quota_is_max_bytes_approaching()
469 return check_quota_exceeded(inode, QUOTA_CHECK_MAX_BYTES_APPROACHING_OP, in ceph_quota_is_max_bytes_approaching()
488 struct inode *in; in ceph_quota_update_statfs()
500 in = realm->inode ? igrab(realm->inode) : NULL; in ceph_quota_update_statfs()