Whamcloud - gitweb
LU-2675 llog: remove obd_llog_init() and obd_llod_finish()
[fs/lustre-release.git] / lustre / include / obd.h
index d7eb8b0..d85d984 100644 (file)
 
 #ifndef __OBD_H
 #define __OBD_H
-#ifndef __KERNEL__
-# error "userspace should not include <obd.h>"
-#endif
 
-#if defined(__linux__)
 #include <linux/obd.h>
-#else
-#error Unsupported operating system.
-#endif
 
 #include <lustre/lustre_idl.h>
 #include <lustre_lib.h>
@@ -57,6 +50,8 @@
 #include <lustre_export.h>
 #include <lustre_fid.h>
 #include <lustre_fld.h>
+#include <lustre_handles.h>
+#include <lustre_intent.h>
 #include <lustre_capa.h>
 #include <lvfs.h>
 
@@ -89,6 +84,11 @@ static inline void loi_init(struct lov_oinfo *loi)
 {
 }
 
+/* If we are unable to get the maximum object size from the OST in
+ * ocd_maxbytes using OBD_CONNECT_MAXBYTES, then we fall back to using
+ * the old maximum object size from ext3. */
+#define LUSTRE_EXT3_STRIPE_MAXBYTES 0x1fffffff000ULL
+
 struct lov_stripe_md {
        atomic_t        lsm_refc;
        spinlock_t      lsm_lock;
@@ -107,7 +107,7 @@ struct lov_stripe_md {
                 __u32 lw_pattern;          /* striping pattern (RAID0, RAID1) */
                 __u16 lw_stripe_count;  /* number of objects being striped over */
                 __u16 lw_layout_gen;       /* generation of the layout */
-                char  lw_pool_name[LOV_MAXPOOLNAME]; /* pool name */
+               char  lw_pool_name[LOV_MAXPOOLNAME + 1]; /* pool name */
         } lsm_wire;
 
         struct lov_oinfo *lsm_oinfo[0];
@@ -302,13 +302,13 @@ struct client_obd {
        /* lru for osc caching pages */
        struct cl_client_cache  *cl_cache;
        struct list_head         cl_lru_osc; /* member of cl_cache->ccc_lru */
-       atomic_t                *cl_lru_left;
-       atomic_t                 cl_lru_busy;
-       atomic_t                 cl_lru_shrinkers;
-       atomic_t                 cl_lru_in_list;
+       atomic_long_t           *cl_lru_left;
+       atomic_long_t            cl_lru_busy;
+       atomic_long_t            cl_lru_in_list;
+       atomic_long_t            cl_unstable_count;
        struct list_head         cl_lru_list; /* lru page list */
        client_obd_lock_t        cl_lru_list_lock; /* page list protector */
-       atomic_t                 cl_unstable_count;
+       atomic_t                 cl_lru_shrinkers;
 
        /* number of in flight destroy rpcs is limited to max_rpcs_in_flight */
        atomic_t                 cl_destroy_in_flight;
@@ -337,7 +337,7 @@ struct client_obd {
        /* used by quotacheck when the servers are older than 2.4 */
        int                      cl_qchk_stat; /* quotacheck stat of the peer */
 #define CL_NOT_QUOTACHECKED 1   /* client->cl_qchk_stat init value */
-#if LUSTRE_VERSION_CODE >= OBD_OCD_VERSION(2, 7, 50, 0)
+#if LUSTRE_VERSION_CODE >= OBD_OCD_VERSION(2, 7, 53, 0)
 #warning "please consider removing quotacheck compatibility code"
 #endif
 
@@ -419,7 +419,7 @@ struct lov_obd {
 struct lmv_tgt_desc {
        struct obd_uuid         ltd_uuid;
        struct obd_export       *ltd_exp;
-       int                     ltd_idx;
+       __u32                   ltd_idx;
        struct mutex            ltd_fid_mutex;
        unsigned long           ltd_active:1; /* target up for requests */
 };
@@ -449,9 +449,8 @@ struct lmv_obd {
        int                     max_def_easize;
        int                     max_cookiesize;
        int                     max_def_cookiesize;
-       int                     server_timeout;
 
-       int                     tgts_size; /* size of tgts array */
+       __u32                   tgts_size; /* size of tgts array */
        struct lmv_tgt_desc     **tgts;
 
        struct obd_connect_data conn_data;
@@ -808,7 +807,7 @@ struct md_op_data {
         struct lu_fid           op_fid2; /* operation fid2 (usualy child) */
         struct lu_fid           op_fid3; /* 2 extra fids to find conflicting */
         struct lu_fid           op_fid4; /* to the operation locks. */
-        mdsno_t                 op_mds;  /* what mds server open will go to */
+       u32                     op_mds;  /* what mds server open will go to */
         struct lustre_handle    op_handle;
         obd_time                op_mod_time;
         const char             *op_name;
@@ -873,13 +872,12 @@ struct md_enqueue_info {
         struct inode           *mi_dir;
         md_enqueue_cb_t         mi_cb;
         __u64                   mi_cbdata;
-        unsigned int            mi_generation;
 };
 
 struct obd_ops {
        struct module *o_owner;
        int (*o_iocontrol)(unsigned int cmd, struct obd_export *exp, int len,
-                          void *karg, void *uarg);
+                          void *karg, void __user *uarg);
         int (*o_get_info)(const struct lu_env *env, struct obd_export *,
                           __u32 keylen, void *key, __u32 *vallen, void *val,
                           struct lov_stripe_md *lsm);
@@ -967,11 +965,6 @@ struct obd_ops {
         int (*o_init_export)(struct obd_export *exp);
         int (*o_destroy_export)(struct obd_export *exp);
 
-        /* llog related obd_methods */
-        int (*o_llog_init)(struct obd_device *obd, struct obd_llog_group *grp,
-                           struct obd_device *disk_obd, int *idx);
-        int (*o_llog_finish)(struct obd_device *obd, int count);
-
         int (*o_import_event)(struct obd_device *, struct obd_import *,
                               enum obd_import_event);
 
@@ -1025,6 +1018,17 @@ struct md_open_data {
        bool                             mod_is_create;
 };
 
+struct obd_client_handle {
+       struct lustre_handle     och_fh;
+       struct lu_fid            och_fid;
+       struct md_open_data     *och_mod;
+       struct lustre_handle     och_lease_handle; /* open lock for lease */
+       __u32                    och_magic;
+       int                      och_flags;
+};
+
+#define OBD_CLIENT_HANDLE_MAGIC 0xd15ea5ed
+
 struct lookup_intent;
 struct cl_attr;