Whamcloud - gitweb
LU-1305 osd: new index flag DT_IND_RANGE
[fs/lustre-release.git] / lustre / include / dt_object.h
index 197ff1e..7e41e6c 100644 (file)
@@ -200,7 +200,12 @@ enum dt_index_flags {
         /** index can be modified */
         DT_IND_UPDATE = 1 << 2,
         /** index supports records with non-unique (duplicate) keys */
-        DT_IND_NONUNQ = 1 << 3
+        DT_IND_NONUNQ = 1 << 3,
+        /**
+         * index support fixed-size keys sorted with natural numerical way
+         * and is able to return left-side value if no exact value found
+         */
+        DT_IND_RANGE = 1 << 4,
 };
 
 /**
@@ -731,10 +736,25 @@ struct dt_object *dt_store_open(const struct lu_env *env,
                                 const char *filename,
                                 struct lu_fid *fid);
 
+struct dt_object *dt_find_or_create(const struct lu_env *env,
+                                    struct dt_device *dt,
+                                    const struct lu_fid *fid,
+                                    struct dt_object_format *dof,
+                                    struct lu_attr *attr);
+
 struct dt_object *dt_locate(const struct lu_env *env,
                             struct dt_device *dev,
                             const struct lu_fid *fid);
 
+static inline int dt_object_sync(const struct lu_env *env,
+                                 struct dt_object *o)
+{
+        LASSERT(o);
+        LASSERT(o->do_ops);
+        LASSERT(o->do_ops->do_object_sync);
+        return o->do_ops->do_object_sync(env, o);
+}
+
 int dt_declare_version_set(const struct lu_env *env, struct dt_object *o,
                            struct thandle *th);
 void dt_version_set(const struct lu_env *env, struct dt_object *o,
@@ -1249,4 +1269,7 @@ static inline int dt_lookup(const struct lu_env *env,
                 ret = -ENOENT;
         return ret;
 }
+
+#define LU221_BAD_TIME (0x80000000U + 24 * 3600)
+
 #endif /* __LUSTRE_DT_OBJECT_H */