Whamcloud - gitweb
LU-2675 obd: decruft md_enqueue() and md_intent_lock()
[fs/lustre-release.git] / lustre / include / obd_class.h
index 2f71625..2692599 100644 (file)
@@ -86,13 +86,12 @@ struct lu_device_type;
 
 /* genops.c */
 struct obd_export *class_conn2export(struct lustre_handle *);
-int class_register_type(struct obd_ops *, struct md_ops *,
+int class_register_type(struct obd_ops *, struct md_ops *, bool enable_proc,
                        struct lprocfs_seq_vars *module_vars,
 #ifndef HAVE_ONLY_PROCFS_SEQ
                        struct lprocfs_vars *,
 #endif
-                       const char *nm,
-                       struct lu_device_type *ldt);
+                       const char *nm, struct lu_device_type *ldt);
 int class_unregister_type(const char *nm);
 
 struct obd_device *class_newdev(const char *type_name, const char *name);
@@ -129,6 +128,10 @@ struct kuc_hdr * kuc_ptr(void *p);
 int kuc_ispayload(void *p);
 void *kuc_alloc(int payload_len, int transport, int type);
 void kuc_free(void *p, int payload_len);
+int obd_get_request_slot(struct client_obd *cli);
+void obd_put_request_slot(struct client_obd *cli);
+__u32 obd_get_max_rpcs_in_flight(struct client_obd *cli);
+int obd_set_max_rpcs_in_flight(struct client_obd *cli, __u32 max);
 
 struct llog_handle;
 struct llog_rec_hdr;
@@ -1040,18 +1043,19 @@ static inline int obd_fid_fini(struct obd_device *obd)
        RETURN(rc);
 }
 
-static inline int obd_fid_alloc(struct obd_export *exp,
+static inline int obd_fid_alloc(const struct lu_env *env,
+                               struct obd_export *exp,
                                 struct lu_fid *fid,
                                 struct md_op_data *op_data)
 {
-        int rc;
-        ENTRY;
+       int rc;
+       ENTRY;
 
-        EXP_CHECK_DT_OP(exp, fid_alloc);
-        EXP_COUNTER_INCREMENT(exp, fid_alloc);
+       EXP_CHECK_DT_OP(exp, fid_alloc);
+       EXP_COUNTER_INCREMENT(exp, fid_alloc);
 
-        rc = OBP(exp->exp_obd, fid_alloc)(exp, fid, op_data);
-        RETURN(rc);
+       rc = OBP(exp->exp_obd, fid_alloc)(env, exp, fid, op_data);
+       RETURN(rc);
 }
 
 static inline int obd_ping(const struct lu_env *env, struct obd_export *exp)
@@ -1677,19 +1681,18 @@ static inline int md_done_writing(struct obd_export *exp,
 
 static inline int md_enqueue(struct obd_export *exp,
                             struct ldlm_enqueue_info *einfo,
+                            const union ldlm_policy_data *policy,
                             struct lookup_intent *it,
                             struct md_op_data *op_data,
                             struct lustre_handle *lockh,
-                            void *lmm, int lmmsize,
-                            struct ptlrpc_request **req,
                             __u64 extra_lock_flags)
 {
-        int rc;
-        ENTRY;
-        EXP_CHECK_MD_OP(exp, enqueue);
-        EXP_MD_COUNTER_INCREMENT(exp, enqueue);
-        rc = MDP(exp->exp_obd, enqueue)(exp, einfo, it, op_data, lockh,
-                                        lmm, lmmsize, req, extra_lock_flags);
+       int rc;
+       ENTRY;
+       EXP_CHECK_MD_OP(exp, enqueue);
+       EXP_MD_COUNTER_INCREMENT(exp, enqueue);
+       rc = MDP(exp->exp_obd, enqueue)(exp, einfo, policy, it, op_data, lockh,
+                                       extra_lock_flags);
         RETURN(rc);
 }
 
@@ -1706,20 +1709,19 @@ static inline int md_getattr_name(struct obd_export *exp,
 }
 
 static inline int md_intent_lock(struct obd_export *exp,
-                                struct md_op_data *op_data, void *lmm,
-                                int lmmsize, struct lookup_intent *it,
-                                int lookup_flags, struct ptlrpc_request **reqp,
+                                struct md_op_data *op_data,
+                                struct lookup_intent *it,
+                                struct ptlrpc_request **reqp,
                                 ldlm_blocking_callback cb_blocking,
                                 __u64 extra_lock_flags)
 {
-        int rc;
-        ENTRY;
-        EXP_CHECK_MD_OP(exp, intent_lock);
-        EXP_MD_COUNTER_INCREMENT(exp, intent_lock);
-        rc = MDP(exp->exp_obd, intent_lock)(exp, op_data, lmm, lmmsize,
-                                            it, lookup_flags, reqp, cb_blocking,
-                                            extra_lock_flags);
-        RETURN(rc);
+       int rc;
+       ENTRY;
+       EXP_CHECK_MD_OP(exp, intent_lock);
+       EXP_MD_COUNTER_INCREMENT(exp, intent_lock);
+       rc = MDP(exp->exp_obd, intent_lock)(exp, op_data, it, reqp, cb_blocking,
+                                           extra_lock_flags);
+       RETURN(rc);
 }
 
 static inline int md_link(struct obd_export *exp, struct md_op_data *op_data,
@@ -1954,13 +1956,14 @@ static inline ldlm_mode_t md_lock_match(struct obd_export *exp, __u64 flags,
 }
 
 static inline int md_init_ea_size(struct obd_export *exp, int easize,
-                                  int def_asize, int cookiesize)
+                                 int def_asize, int cookiesize,
+                                 int def_cookiesize)
 {
-        ENTRY;
-        EXP_CHECK_MD_OP(exp, init_ea_size);
-        EXP_MD_COUNTER_INCREMENT(exp, init_ea_size);
-        RETURN(MDP(exp->exp_obd, init_ea_size)(exp, easize, def_asize,
-                                               cookiesize));
+       ENTRY;
+       EXP_CHECK_MD_OP(exp, init_ea_size);
+       EXP_MD_COUNTER_INCREMENT(exp, init_ea_size);
+       RETURN(MDP(exp->exp_obd, init_ea_size)(exp, easize, def_asize,
+                                              cookiesize, def_cookiesize));
 }
 
 static inline int md_get_remote_perm(struct obd_export *exp,
@@ -2097,6 +2100,15 @@ void class_exit_uuidlist(void);
 /* prng.c */
 #define ll_generate_random_uuid(uuid_out) cfs_get_random_bytes(uuid_out, sizeof(class_uuid_t))
 
+/* root squash info */
+struct rw_semaphore;
+struct root_squash_info {
+       uid_t                   rsi_uid;
+       gid_t                   rsi_gid;
+       struct list_head        rsi_nosquash_nids;
+       struct rw_semaphore     rsi_sem;
+};
+
 #ifdef __KERNEL__
 int server_name2index(const char *svname, __u32 *idx, const char **endptr);
 #else