#include <obd_class.h>
#include <lustre_disk.h>
#include <dt_object.h>
+#include <lquota.h>
#include "osd_oi.h"
#include "osd_iam.h"
#include "osd_scrub.h"
+#include "osd_quota_fmt.h"
struct inode;
cfs_mutex_t od_otable_mutex;
struct osd_otable_it *od_otable_it;
struct osd_scrub od_scrub;
+
+ /* service name associated with the osd device */
+ char od_svname[MAX_OBD_NAME];
+
+ /* quota slave instance */
+ struct qsd_instance *od_quota_slave;
};
#define OSD_TRACK_DECLARES
struct iam_iterator oi_it;
};
+/**
+ * Iterator's in-memory data structure for quota file.
+ */
+struct osd_it_quota {
+ struct osd_object *oiq_obj;
+ /** tree blocks path to where the entry is stored */
+ uint oiq_blk[LUSTRE_DQTREEDEPTH];
+ /** on-disk offset for current key where quota record can be found */
+ loff_t oiq_offset;
+ /** identifier for current quota record */
+ __u64 oiq_id;
+};
+
#define MAX_BLOCKS_PER_PAGE (CFS_PAGE_SIZE / 512)
struct osd_iobuf {
/** osd iterator context used for iterator session */
- union {
- struct osd_it_iam oti_it;
- /** ldiskfs iterator data structure, see osd_it_ea_{init, fini} */
- struct osd_it_ea oti_it_ea;
- };
+ union {
+ struct osd_it_iam oti_it;
+ /* ldiskfs iterator data structure,
+ * see osd_it_ea_{init, fini} */
+ struct osd_it_ea oti_it_ea;
+ struct osd_it_quota oti_it_quota;
+ };
/** pre-allocated buffer used by oti_it_ea, size OSD_IT_EA_BUFSIZE */
void *oti_it_ea_buf;
#define OSD_FID_REC_SZ 32
char oti_ldp[OSD_FID_REC_SZ];
char oti_ldp2[OSD_FID_REC_SZ];
+
+ /* used by quota code */
+ union {
+ struct if_dqblk oti_dqblk;
+ struct if_dqinfo oti_dqinfo;
+ };
};
extern int ldiskfs_pdo;
int osd_oii_lookup(struct osd_device *dev, const struct lu_fid *fid,
struct osd_inode_id *id);
+/* osd_quota_fmt.c */
+int walk_tree_dqentry(const struct lu_env *env, struct osd_object *obj,
+ int type, uint blk, int depth, uint index,
+ struct osd_it_quota *it);
+int walk_block_dqentry(const struct lu_env *env, struct osd_object *obj,
+ int type, uint blk, uint index,
+ struct osd_it_quota *it);
+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);
/*
* Invariants, assertions.
*/
return result;
}
+/**
+ * Quota/Accounting handling
+ */
+extern const struct dt_index_operations osd_acct_index_ops;
+int osd_acct_obj_lookup(struct osd_thread_info *info, struct osd_device *osd,
+ const struct lu_fid *fid, struct osd_inode_id *id);
+
#endif /* __KERNEL__ */
#endif /* _OSD_INTERNAL_H */