X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fosd-ldiskfs%2Fosd_internal.h;h=ab5fc62afbd55b4145f8b00de9bfb4e1bf32e8f4;hp=939d5393142990848bee6452fc6bc378ae6385e7;hb=3ff4a0744c229e0199bc7d93db9221c3bfb1f846;hpb=35920b759ed78441db0cd9de6ac8ec66da862f22 diff --git a/lustre/osd-ldiskfs/osd_internal.h b/lustre/osd-ldiskfs/osd_internal.h index 939d539..ab5fc62a 100644 --- a/lustre/osd-ldiskfs/osd_internal.h +++ b/lustre/osd-ldiskfs/osd_internal.h @@ -287,6 +287,7 @@ struct osd_device { struct fsfilt_operations *od_fsops; int od_connects; + struct lu_site od_site; /* * mapping for legacy OST objids @@ -354,6 +355,7 @@ struct osd_thandle { unsigned short ot_id_cnt; unsigned short ot_id_type; uid_t ot_id_array[OSD_MAX_UGID_CNT]; + struct lquota_trans *ot_quota_trans; #ifdef OSD_TRACK_DECLARES unsigned char ot_declare_attr_set; @@ -612,6 +614,10 @@ struct osd_thread_info { struct if_dqblk oti_dqblk; struct if_dqinfo oti_dqinfo; }; + struct lquota_id_info oti_qi; + struct lquota_trans oti_quota_trans; + union lquota_rec oti_quota_rec; + __u64 oti_quota_id; }; extern int ldiskfs_pdo; @@ -631,8 +637,6 @@ int osd_statfs(const struct lu_env *env, struct dt_device *dev, struct obd_statfs *sfs); int osd_object_auth(const struct lu_env *env, struct dt_object *dt, struct lustre_capa *capa, __u64 opc); -void osd_declare_qid(struct dt_object *dt, struct osd_thandle *oh, - int type, uid_t id, struct inode *inode); struct inode *osd_iget(struct osd_thread_info *info, struct osd_device *dev, struct osd_inode_id *id); struct inode *osd_iget_fid(struct osd_thread_info *info, struct osd_device *dev, @@ -680,6 +684,27 @@ loff_t find_tree_dqentry(const struct lu_env *env, struct osd_object *obj, int type, qid_t dqid, uint blk, int depth, struct osd_it_quota *it); +/* osd_quota.c */ +int osd_declare_qid(const struct lu_env *env, struct osd_thandle *oh, + struct lquota_id_info *qi, bool allocated, int *flags); +int osd_declare_inode_qid(const struct lu_env *env, qid_t uid, qid_t gid, + long long space, struct osd_thandle *oh, + bool is_blk, bool allocated, int *flags, bool force); +const struct dt_rec *osd_quota_pack(struct osd_object *obj, + const struct dt_rec *rec, + union lquota_rec *quota_rec); +void osd_quota_unpack(struct osd_object *obj, const struct dt_rec *rec); +int osd_quota_migration(const struct lu_env *env, struct dt_object *dt, + const struct dt_index_features *feat); + +static inline bool is_quota_glb_feat(const struct dt_index_features *feat) +{ + return (feat == &dt_quota_iusr_features || + feat == &dt_quota_busr_features || + feat == &dt_quota_igrp_features || + feat == &dt_quota_bgrp_features) ? true : false; +} + /* * Invariants, assertions. */