Whamcloud - gitweb
- CROW-related fixes from b_hd_mdref
[fs/lustre-release.git] / lustre / include / linux / obd.h
index 283b1db..104acc0 100644 (file)
@@ -13,6 +13,7 @@
 #define IOC_OSC_TYPE         'h'
 #define IOC_OSC_MIN_NR       20
 #define IOC_OSC_SET_ACTIVE   _IOWR(IOC_OSC_TYPE, 21, struct obd_device *)
+#define IOC_OSC_CTL_RECOVERY _IOWR(IOC_OSC_TYPE, 22, struct obd_device *)
 #define IOC_OSC_MAX_NR       50
 
 #define IOC_MDC_TYPE         'i'
@@ -20,7 +21,6 @@
 #define IOC_MDC_LOOKUP       _IOWR(IOC_MDC_TYPE, 20, struct obd_device *)
 /* Moved to lustre_user.h
 #define IOC_MDC_GETSTRIPE    _IOWR(IOC_MDC_TYPE, 21, struct lov_mds_md *) */
-#define IOC_MDC_FINISH_GNS   _IOWR(IOC_MDC_TYPE, 22, struct obd_device *)
 #define IOC_MDC_MAX_NR       50
 
 #ifdef __KERNEL__
@@ -206,6 +206,7 @@ struct filter_obd {
         const char          *fo_fstype;
         struct super_block  *fo_sb;
         struct vfsmount     *fo_vfsmnt;
+        struct lvfs_obd_ctxt *fo_lvfs_ctxt;
 
         int                    fo_group_count;
         struct dentry         *fo_dentry_O;     /* the "O"bject directory dentry */
@@ -254,6 +255,11 @@ struct filter_obd {
 
         struct list_head         fo_llog_list;
         spinlock_t               fo_llog_list_lock;
+
+        /* which secure flavor from remote is denied */
+        spinlock_t              fo_denylist_lock;
+        struct list_head        fo_denylist;
+
 };
 
 struct mds_server_data;
@@ -275,6 +281,10 @@ struct client_obd {
         int                      cl_max_mds_cookiesize;
         kdev_t                   cl_sandev;
 
+        /* security flavors */
+        __u32                    cl_sec_flavor;
+        __u32                    cl_sec_subflavor;
+
         //struct llog_canceld_ctxt *cl_llcd; /* it's included by obd_llog_ctxt */
         void                    *cl_llcd_offset;
 
@@ -310,8 +320,10 @@ struct client_obd {
         struct obd_service_time  cl_enter_stime;
 
         struct mdc_rpc_lock     *cl_rpc_lock;
-        struct mdc_rpc_lock     *cl_setattr_lock;
+        struct mdc_rpc_lock     *cl_setattr_lock; 
+        struct mdc_rpc_lock     *cl_close_lock;
         struct osc_creator       cl_oscc;
+        int                      cl_async:1;
 };
 
 /* Like a client, with some hangers-on.  Keep mc_client_obd first so that we
@@ -333,18 +345,20 @@ struct mds_obd {
         struct super_block              *mds_sb;
         struct vfsmount                 *mds_vfsmnt;
         struct dentry                   *mds_id_de;
+        struct lvfs_obd_ctxt            *mds_lvfs_ctxt;
         int                              mds_max_mdsize;
         int                              mds_max_cookiesize;
         struct file                     *mds_rcvd_filp;
         struct file                     *mds_fid_filp;
+        struct file                     *mds_virtid_filp;
         spinlock_t                       mds_transno_lock;
         __u64                            mds_last_transno;
         __u64                            mds_mount_count;
         __u64                            mds_io_epoch;
         
         __u64                            mds_last_fid;
-        struct semaphore                 mds_last_fid_sem;
-       int                              mds_last_fid_changed;
+        __u64                            mds_virtid_fid;
+        spinlock_t                       mds_last_fid_lock;
         
         struct semaphore                 mds_epoch_sem;
         struct lustre_id                 mds_rootid;
@@ -353,38 +367,48 @@ struct mds_obd {
         struct dentry                   *mds_logs_dir;
         struct dentry                   *mds_objects_dir;
         struct llog_handle              *mds_cfg_llh;
-        struct obd_device               *mds_lov_obd;
-        struct obd_uuid                  mds_lov_uuid;
         char                            *mds_profile;
-        struct obd_export               *mds_lov_exp;
-        int                              mds_has_lov_desc;
-        struct lov_desc                  mds_lov_desc;
-        obd_id                          *mds_lov_objids;
-        int                              mds_lov_objids_valid;
-        int                              mds_lov_nextid_set;
-        struct file                     *mds_lov_objid_filp;
-        spinlock_t                       mds_lov_lock;
+        struct obd_device               *mds_dt_obd;
+        struct obd_uuid                  mds_dt_uuid;
+        struct obd_export               *mds_dt_exp;
+        int                              mds_has_dt_desc;
+        struct lov_desc                  mds_dt_desc;
+
+        spinlock_t                       mds_dt_lock;
+        obd_id                          *mds_dt_objids;
+        struct file                     *mds_dt_objid_filp;
+        int                              mds_dt_objids_valid;
+
         unsigned long                   *mds_client_bitmap;
         struct semaphore                 mds_orphan_recovery_sem;
         
         int                              mds_num;
         int                              mds_config_version;
 
-        char                            *mds_lmv_name;
-        struct obd_device               *mds_lmv_obd;
-        struct obd_export               *mds_lmv_exp;
+        char                            *mds_md_name;
+        struct obd_device               *mds_md_obd;
+        struct obd_export               *mds_md_exp;
+        struct semaphore                 mds_md_sem;
+        struct obd_uuid                  mds_md_uuid;
+        int                              mds_md_connected;
 
         struct ptlrpc_service           *mds_create_service;
-        struct semaphore                 mds_lmv_sem;
         uid_t                            mds_squash_uid;
         gid_t                            mds_squash_gid;
         ptl_nid_t                        mds_nosquash_nid;
         atomic_t                         mds_real_clients;
-        struct obd_uuid                  mds_lmv_uuid;
+        atomic_t                         mds_open_count;
         struct dentry                   *mds_id_dir;
         int                              mds_obd_type;
-        int                              mds_lmv_connected;
         struct dentry                   *mds_unnamed_dir; /* for mdt_obd_create only */
+
+        /* security related */
+        char                            *mds_mds_sec;
+        char                            *mds_ost_sec;
+        /* which secure flavor from remote to this mds is denied */
+        spinlock_t                      mds_denylist_lock;
+        struct list_head                mds_denylist;
+        struct semaphore                mds_create_sem;
 };
 
 struct echo_obd {
@@ -441,6 +465,10 @@ struct echo_client_obd {
 struct cache_obd {
         struct obd_export      *master_exp; /* local connection to master obd */
         struct obd_export      *cache_exp;  /* local connection to cache obd */
+        struct obd_export      *cache_real_exp;
+        struct obd_export      *master_real_exp;
+        struct obd_device      *master;
+        struct obd_device      *cache;
         char                   *master_name;
         char                   *cache_name;
         int                     refcount;
@@ -456,7 +484,17 @@ struct cm_obd {
         int                     master_group;
         struct cmobd_write_service *write_srv;
 };
-        
+
+struct conf_obd {
+        struct super_block      *cfobd_sb;
+        struct vfsmount         *cfobd_vfsmnt;
+        struct dentry           *cfobd_logs_dir;
+        struct dentry           *cfobd_objects_dir;
+        struct dentry           *cfobd_pending_dir;
+        struct llog_handle      *cfobd_cfg_llh;
+        struct lvfs_obd_ctxt    *cfobd_lvfs_ctxt;
+};
+
 struct lov_tgt_desc {
         struct obd_uuid         uuid;
         __u32                   ltd_gen;
@@ -469,7 +507,7 @@ struct lov_obd {
         struct lov_desc         desc;
         int                     bufsize;
         int                     refcount;
-        int                     lo_catalog_loaded:1;
+        int                     lo_catalog_loaded:1, async:1;
         struct semaphore        lov_llog_sem;
         unsigned long           lov_connect_flags;
         struct lov_tgt_desc    *tgts;
@@ -496,6 +534,7 @@ struct lmv_obd {
         int                     server_timeout;
         int                     connect_flags;
         struct semaphore        init_sem;
+        struct obd_connect_data conn_data;
 };
 
 struct niobuf_local {
@@ -508,13 +547,17 @@ struct niobuf_local {
         int rc;
 };
 
+#define OBD_MODE_ASYNC (1 << 0)
+#define OBD_MODE_CROW  (1 << 1)
+
 /* Don't conflict with on-wire flags OBD_BRW_WRITE, etc */
 #define N_LOCAL_TEMP_PAGE 0x10000000
 
 struct obd_trans_info {
         __u64                    oti_transno;
         __u64                   *oti_objid;
-        /* Only used on the server side for tracking acks. */
+
+        /* only used on the server side for tracking acks. */
         struct oti_req_ack_lock {
                 struct lustre_handle lock;
                 __u32                mode;
@@ -523,6 +566,7 @@ struct obd_trans_info {
         struct llog_cookie       oti_onecookie;
         struct llog_cookie      *oti_logcookies;
         int                      oti_numcookies;
+        int                      oti_flags;
 };
 
 static inline void oti_alloc_cookies(struct obd_trans_info *oti,int num_cookies)
@@ -622,22 +666,29 @@ struct obd_device {
         spinlock_t                       obd_processing_task_lock;
         __u64                            obd_next_recovery_transno;
         int                              obd_replayed_requests;
+        int                              obd_replayed_locks;
         int                              obd_requests_queued_for_recovery;
         wait_queue_head_t                obd_next_transno_waitq;
         struct list_head                 obd_uncommitted_replies;
         spinlock_t                       obd_uncommitted_replies_lock;
         struct timer_list                obd_recovery_timer;
-        struct list_head                 obd_recovery_queue;
-        struct list_head                 obd_delayed_reply_queue;
         time_t                           obd_recovery_start;
         time_t                           obd_recovery_end;
 
+        atomic_t                         obd_req_replay_clients;
+        atomic_t                         obd_lock_replay_clients;
+
+        struct list_head                 obd_req_replay_queue;
+        struct list_head                 obd_lock_replay_queue;
+        struct list_head                 obd_final_req_queue;
+        int                              obd_recovery_stage;
+
         union {
                 struct filter_obd        filter;
                 struct mds_obd           mds;
                 struct client_obd        cli;
                 struct ost_obd           ost;
-                struct echo_client_obd   echo_client;
+                struct echo_client_obd   echocli;
                 struct echo_obd          echo;
                 struct recovd_obd        recovd;
                 struct lov_obd           lov;
@@ -646,6 +697,7 @@ struct obd_device {
                 struct mgmtcli_obd       mgmtcli;
                 struct lmv_obd           lmv;
                 struct cm_obd            cm;
+                struct conf_obd          conf;
         } u;
         
         /* fields used by LProcFS */
@@ -688,8 +740,9 @@ struct obd_ops {
                           int priority);
         int (*o_del_conn)(struct obd_import *imp, struct obd_uuid *uuid);
         int (*o_connect)(struct lustre_handle *conn, struct obd_device *src,
-                         struct obd_uuid *cluuid, unsigned long flags);
-        int (*o_connect_post)(struct obd_export *exp, unsigned long flags);
+                         struct obd_uuid *cluuid, struct obd_connect_data *data,
+                         unsigned long flags);
+        int (*o_connect_post)(struct obd_export *exp, unsigned, unsigned long);
         int (*o_disconnect)(struct obd_export *exp, unsigned long flags);
 
         int (*o_statfs)(struct obd_device *obd, struct obd_statfs *osfs,
@@ -704,6 +757,7 @@ struct obd_ops {
         int (*o_preallocate)(struct lustre_handle *, obd_count *req,
                              obd_id *ids);
         int (*o_create)(struct obd_export *exp,  struct obdo *oa,
+                        void *acl, int acl_size,
                         struct lov_stripe_md **ea, struct obd_trans_info *oti);
         int (*o_destroy)(struct obd_export *exp, struct obdo *oa,
                          struct lov_stripe_md *ea, struct obd_trans_info *oti);
@@ -749,6 +803,8 @@ struct obd_ops {
         int (*o_teardown_async_page)(struct obd_export *exp,
                                      struct lov_stripe_md *lsm,
                                      struct lov_oinfo *loi, void *cookie);
+        int (*o_adjust_kms)(struct obd_export *exp, struct lov_stripe_md *lsm,
+                            obd_off size, int shrink);
         int (*o_punch)(struct obd_export *exp, struct obdo *oa,
                        struct lov_stripe_md *ea, obd_size start,
                        obd_size end, struct obd_trans_info *oti);
@@ -847,8 +903,8 @@ struct md_ops {
                          void *, int, ldlm_completion_callback,
                          ldlm_blocking_callback, void *);
         int (*m_getattr)(struct obd_export *, struct lustre_id *,
-                         __u64, unsigned int,
-                         struct ptlrpc_request **);
+                         __u64, const char *, int,
+                         unsigned int, struct ptlrpc_request **);
         int (*m_getattr_lock)(struct obd_export *, struct lustre_id *,
                               char *, int, __u64,
                               unsigned int, struct ptlrpc_request **);
@@ -874,8 +930,7 @@ struct md_ops {
                         struct ptlrpc_request **);
         int (*m_valid_attrs)(struct obd_export *, struct lustre_id *);
         
-        struct obd_device *(*m_get_real_obd)(struct obd_export *,
-                                             char *name, int len);
+        struct obd_device *(*m_get_real_obd)(struct obd_export *, struct lustre_id *);
         
         int (*m_req2lustre_md)(struct obd_export *exp, 
                                struct ptlrpc_request *req, unsigned int offset,