Whamcloud - gitweb
LU-1866 lfsck: enhance otable-based iteration
[fs/lustre-release.git] / lustre / osd-ldiskfs / osd_internal.h
index f28af74..1dec8c2 100644 (file)
@@ -169,6 +169,16 @@ struct osd_obj_map {
        struct semaphore om_dir_init_sem;
 };
 
+struct osd_mdobj {
+       struct dentry   *om_root;      /* AGENT/<index> */
+       obd_seq         om_index;     /* mdt index */
+       cfs_list_t      om_list;      /* list to omm_list */
+};
+
+struct osd_mdobj_map {
+       struct dentry   *omm_agent_dentry;
+};
+
 #define osd_ldiskfs_find_entry(dir, dentry, de, lock)   \
         ll_ldiskfs_find_entry(dir, dentry, de, lock)
 #define osd_ldiskfs_add_entry(handle, child, cinode, hlock) \
@@ -206,11 +216,9 @@ struct osd_otable_cache {
 
 struct osd_otable_it {
        struct osd_device       *ooi_dev;
+       pid_t                    ooi_pid;
        struct osd_otable_cache  ooi_cache;
 
-       /* For osd_otable_it_key. */
-       __u8                     ooi_key[16];
-
        /* The following bits can be updated/checked w/o lock protection.
         * If more bits will be introduced in the future and need lock to
         * protect, please add comment. */
@@ -220,7 +228,9 @@ struct osd_otable_it {
                                                    * filled into cache. */
                                 ooi_user_ready:1, /* The user out of OSD is
                                                    * ready to iterate. */
-                                ooi_waiting:1; /* it::next is waiting. */
+                                ooi_waiting:1, /* it::next is waiting. */
+                                ooi_stopping:1; /* Someone is stopping
+                                                 * the iteration. */
 };
 
 extern const int osd_dto_credits_noquota[];
@@ -264,6 +274,7 @@ struct osd_device {
        struct lu_site            od_site;
 
        struct osd_obj_map      *od_ost_map;
+       struct osd_mdobj_map    *od_mdt_map;
 
         unsigned long long        od_readcache_max_filesize;
         int                       od_read_cache;
@@ -276,6 +287,7 @@ struct osd_device {
        struct mutex              od_otable_mutex;
        struct osd_otable_it     *od_otable_it;
        struct osd_scrub          od_scrub;
+       cfs_list_t                od_ios_list;
 
        /* service name associated with the osd device */
        char                      od_svname[MAX_OBD_NAME];
@@ -589,6 +601,7 @@ struct osd_thread_info {
        bool                    oti_rollback;
 #endif
 
+       char                    oti_name[48];
 };
 
 extern int ldiskfs_pdo;
@@ -607,6 +620,8 @@ int osd_object_auth(const struct lu_env *env, struct dt_object *dt,
                     struct lustre_capa *capa, __u64 opc);
 struct inode *osd_iget(struct osd_thread_info *info, struct osd_device *dev,
                       struct osd_inode_id *id);
+int osd_ea_fid_set(struct osd_thread_info *info, struct inode *inode,
+                  const struct lu_fid *fid);
 int osd_get_lma(struct osd_thread_info *info, struct inode *inode,
                struct dentry *dentry, struct lustre_mdt_attrs *lma);
 
@@ -627,6 +642,7 @@ int osd_obj_spec_insert(struct osd_thread_info *info, struct osd_device *osd,
 
 void osd_scrub_file_reset(struct osd_scrub *scrub, __u8 *uuid, __u64 flags);
 int osd_scrub_file_store(struct osd_scrub *scrub);
+char *osd_lf_fid2name(const struct lu_fid *fid);
 int osd_scrub_start(struct osd_device *dev);
 int osd_scrub_setup(const struct lu_env *env, struct osd_device *dev);
 void osd_scrub_cleanup(const struct lu_env *env, struct osd_device *dev);
@@ -638,6 +654,15 @@ int osd_scrub_dump(struct osd_device *dev, char *buf, int len);
 
 int osd_fld_lookup(const struct lu_env *env, struct osd_device *osd,
                   const struct lu_fid *fid, struct lu_seq_range *range);
+struct dentry *osd_agent_lookup(struct osd_mdobj_map *omm, int index);
+struct dentry *osd_agent_load(const struct osd_device *osd, int mdt_index,
+                             int create);
+
+int osd_delete_agent_inode(const struct lu_env *env, struct osd_device *osd,
+                          struct osd_object *obj, struct osd_thandle *oh);
+int osd_create_agent_inode(const struct lu_env *env, struct osd_device *osd,
+                          struct osd_object *obj, struct osd_thandle *oh);
+
 /* 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,
@@ -662,6 +687,9 @@ 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);
 
+/* osd_compat.c */
+struct osd_obj_seq *osd_seq_load(struct osd_device *osd, obd_seq seq);
+
 static inline bool is_quota_glb_feat(const struct dt_index_features *feat)
 {
        return (feat == &dt_quota_iusr_features ||