Whamcloud - gitweb
LU-8619 osd: define DN_MAX_BONUSLEN
[fs/lustre-release.git] / lustre / osd-zfs / osd_internal.h
index 56203e6..ea15344 100644 (file)
@@ -196,7 +196,6 @@ struct osd_thread_info {
 
        struct lquota_id_info    oti_qi;
        struct lu_seq_range      oti_seq_range;
-       struct lu_buf            oti_xattr_lbuf;
 };
 
 extern struct lu_context_key osd_key;
@@ -212,6 +211,7 @@ struct osd_thandle {
        struct list_head         ot_stop_dcb_list;
        struct list_head         ot_unlinked_list;
        struct list_head         ot_sa_list;
+       struct semaphore         ot_sa_lock;
        dmu_tx_t                *ot_tx;
        struct lquota_trans      ot_quota_trans;
        __u32                    ot_write_commit:1,
@@ -329,7 +329,7 @@ struct osd_object {
        struct rw_semaphore      oo_sem;
 
        /* to serialize some updates: destroy vs. others,
-        * xattr_set, etc */
+        * xattr_set, object block size change etc */
        struct rw_semaphore      oo_guard;
 
        /* protected by oo_guard */
@@ -343,15 +343,21 @@ struct osd_object {
        uint64_t                 oo_xattr;
        enum osd_destroy_type    oo_destroy;
 
-       __u32                    oo_destroyed:1,
-                                oo_late_xattr:1;
+       __u32                    oo_destroyed:1;
 
        /* the i_flags in LMA */
        __u32                    oo_lma_flags;
-       /* record size for index file */
-       unsigned char            oo_keysize;
-       unsigned char            oo_recsize;
-       unsigned char            oo_recusize;   /* unit size */
+       union {
+               int             oo_ea_in_bonus; /* EA bytes we expect */
+               struct {
+                       /* record size for index file */
+                       unsigned char            oo_keysize;
+                       unsigned char            oo_recsize;
+                       unsigned char            oo_recusize;   /* unit size */
+               };
+       };
+
+
 };
 
 int osd_statfs(const struct lu_env *, struct dt_device *, struct obd_statfs *);
@@ -456,8 +462,7 @@ int osd_procfs_fini(struct osd_device *osd);
 
 /* osd_object.c */
 extern char *osd_obj_tag;
-void osd_object_sa_dirty_rele(const struct lu_env *env, struct osd_thandle *oh);
-void osd_object_sa_dirty_add(struct osd_object *obj, struct osd_thandle *oh);
+void osd_object_sa_dirty_rele(struct osd_thandle *oh);
 int __osd_obj2dbuf(const struct lu_env *env, objset_t *os,
                   uint64_t oid, dmu_buf_t **dbp);
 struct lu_object *osd_object_alloc(const struct lu_env *env,
@@ -467,10 +472,12 @@ int osd_object_sa_update(struct osd_object *obj, sa_attr_type_t type,
                         void *buf, uint32_t buflen, struct osd_thandle *oh);
 int __osd_zap_create(const struct lu_env *env, struct osd_device *osd,
                     dmu_buf_t **zap_dbp, dmu_tx_t *tx, struct lu_attr *la,
-                    uint64_t parent, zap_flags_t flags);
+                    zap_flags_t flags);
 int __osd_object_create(const struct lu_env *env, struct osd_object *obj,
-                       dmu_buf_t **dbp, dmu_tx_t *tx, struct lu_attr *la,
-                       uint64_t parent);
+                       dmu_buf_t **dbp, dmu_tx_t *tx, struct lu_attr *la);
+int __osd_attr_init(const struct lu_env *env, struct osd_device *osd,
+                   sa_handle_t *sa_hdl, dmu_tx_t *tx,
+                   struct lu_attr *la, uint64_t parent);
 
 /* osd_oi.c */
 int osd_oi_init(const struct lu_env *env, struct osd_device *o);
@@ -478,7 +485,7 @@ void osd_oi_fini(const struct lu_env *env, struct osd_device *o);
 int osd_fid_lookup(const struct lu_env *env,
                   struct osd_device *, const struct lu_fid *, uint64_t *);
 uint64_t osd_get_name_n_idx(const struct lu_env *env, struct osd_device *osd,
-                           const struct lu_fid *fid, char *buf);
+                           const struct lu_fid *fid, char *buf, int bufsize);
 int osd_options_init(void);
 int osd_ost_seq_exists(const struct lu_env *env, struct osd_device *osd,
                       __u64 seq);
@@ -495,8 +502,6 @@ void osd_zap_cursor_fini(zap_cursor_t *zc);
 uint64_t osd_zap_cursor_serialize(zap_cursor_t *zc);
 
 /* osd_xattr.c */
-int __osd_sa_xattr_update(const struct lu_env *env, struct osd_object *obj,
-                         struct osd_thandle *oh);
 int __osd_xattr_load(struct osd_device *osd, uint64_t dnode,
                     nvlist_t **sa_xattr);
 int __osd_xattr_get_large(const struct lu_env *env, struct osd_device *osd,
@@ -529,6 +534,8 @@ int __osd_sa_xattr_set(const struct lu_env *env, struct osd_object *obj,
 int __osd_xattr_set(const struct lu_env *env, struct osd_object *obj,
                    const struct lu_buf *buf, const char *name, int fl,
                    struct osd_thandle *oh);
+int __osd_sa_xattr_update(const struct lu_env *env, struct osd_object *obj,
+                         struct osd_thandle *oh);
 static inline int
 osd_xattr_set_internal(const struct lu_env *env, struct osd_object *obj,
                       const struct lu_buf *buf, const char *name, int fl,
@@ -648,4 +655,16 @@ osd_zap_create_flags(objset_t *os, int normflags, zap_flags_t flags,
 }
 #endif /* HAVE_DMU_OBJECT_ALLOC_DNSIZE */
 
+#ifdef HAVE_DMU_PREFETCH_6ARG
+#define osd_dmu_prefetch(os, obj, lvl, off, len, pri)  \
+       dmu_prefetch((os), (obj), (lvl), (off), (len), (pri))
+#else
+#define osd_dmu_prefetch(os, obj, lvl, off, len, pri)  \
+       dmu_prefetch((os), (obj), (lvl), (off))
+#endif
+
+#ifndef DN_MAX_BONUSLEN
+#define DN_MAX_BONUSLEN        DN_OLD_MAX_BONUSLEN
+#endif
+
 #endif /* _OSD_INTERNAL_H */