Whamcloud - gitweb
LU-1403 ucred: ucred cleanup
[fs/lustre-release.git] / lustre / mdt / mdt_internal.h
index f1d60b8..b990ba9 100644 (file)
@@ -71,6 +71,7 @@
 #include <lustre_idmap.h>
 #include <lustre_eacl.h>
 #include <lustre_fsfilt.h>
+#include <lustre_quota.h>
 
 /* check if request's xid is equal to last one or not*/
 static inline int req_xid_is_last(struct ptlrpc_request *req)
@@ -132,7 +133,7 @@ struct mdt_device {
         /* mdt state flags */
         unsigned long              mdt_state;
         /* lock to protect IOepoch */
-        cfs_spinlock_t             mdt_ioepoch_lock;
+       spinlock_t                 mdt_ioepoch_lock;
         __u64                      mdt_ioepoch;
 
         /* transaction callbacks */
@@ -146,7 +147,7 @@ struct mdt_device {
         struct upcall_cache        *mdt_identity_cache;
 
         /* sptlrpc rules */
-        cfs_rwlock_t               mdt_sptlrpc_lock;
+       rwlock_t                   mdt_sptlrpc_lock;
         struct sptlrpc_rule_set    mdt_sptlrpc_rset;
 
         /* capability keys */
@@ -162,9 +163,9 @@ struct mdt_device {
                                    mdt_som_conf:1;
 
        /* statfs optimization: we cache a bit  */
-       struct obd_statfs          mdt_osfs;
-       __u64                      mdt_osfs_age;
-       cfs_spinlock_t             mdt_osfs_lock;
+       struct obd_statfs          mdt_osfs;
+       __u64                      mdt_osfs_age;
+       spinlock_t                 mdt_osfs_lock;
 
         /* root squash */
         uid_t                      mdt_squash_uid;
@@ -172,13 +173,18 @@ struct mdt_device {
         cfs_list_t                 mdt_nosquash_nids;
         char                      *mdt_nosquash_str;
         int                        mdt_nosquash_strlen;
-        cfs_rw_semaphore_t         mdt_squash_sem;
+       struct rw_semaphore        mdt_squash_sem;
 
         cfs_proc_dir_entry_t      *mdt_proc_entry;
         struct lprocfs_stats      *mdt_stats;
         int                        mdt_sec_level;
         struct rename_stats        mdt_rename_stats;
        struct lu_fid              mdt_md_root_fid;
+
+       /* connection to quota master */
+       struct obd_export         *mdt_qmt_exp;
+       /* quota master device associated with this MDT */
+       struct lu_device          *mdt_qmt_dev;
 };
 
 #define MDT_SERVICE_WATCHDOG_FACTOR     (2)
@@ -196,9 +202,9 @@ struct mdt_object {
         int                     mot_ioepoch_count;
         int                     mot_writecount;
         /* Lock to protect object's IO epoch. */
-        cfs_mutex_t             mot_ioepoch_mutex;
+       struct mutex            mot_ioepoch_mutex;
         /* Lock to protect create_data */
-        cfs_mutex_t             mot_lov_mutex;
+       struct mutex            mot_lov_mutex;
 };
 
 enum mdt_object_flags {
@@ -330,7 +336,6 @@ struct mdt_thread_info {
         const struct ldlm_request *mti_dlm_req;
 
         __u32                      mti_has_trans:1, /* has txn already? */
-                                   mti_no_need_trans:1,
                                    mti_cross_ref:1;
 
         /* opdata for mdt_reint_open(), has the same as
@@ -704,7 +709,8 @@ static inline int mdt_check_resent(struct mdt_thread_info *info,
         RETURN(0);
 }
 
-struct md_ucred *mdt_ucred(const struct mdt_thread_info *info);
+struct lu_ucred *mdt_ucred(const struct mdt_thread_info *info);
+struct lu_ucred *mdt_ucred_check(const struct mdt_thread_info *info);
 
 static inline int is_identity_get_disabled(struct upcall_cache *cache)
 {
@@ -719,7 +725,7 @@ static inline int mdt_fid_lock(struct ldlm_namespace *ns,
                                ldlm_mode_t mode,
                                ldlm_policy_data_t *policy,
                                const struct ldlm_res_id *res_id,
-                               int flags, const __u64 *client_cookie)
+                              __u64 flags, const __u64 *client_cookie)
 {
         int rc;
 
@@ -729,7 +735,7 @@ static inline int mdt_fid_lock(struct ldlm_namespace *ns,
         rc = ldlm_cli_enqueue_local(ns, res_id, LDLM_IBITS, policy,
                                     mode, &flags, mdt_blocking_ast,
                                     ldlm_completion_ast, NULL, NULL, 0,
-                                    client_cookie, lh);
+                                   LVB_T_NONE, client_cookie, lh);
         return rc == ELDLM_OK ? 0 : -EIO;
 }
 
@@ -754,6 +760,9 @@ static inline ldlm_mode_t mdt_mdl_mode2dlm_mode(mdl_mode_t mode)
         return mdt_dlm_lock_modes[mode];
 }
 
+/* mdt_lvb.c */
+extern struct ldlm_valblock_ops mdt_lvbo;
+
 static inline struct lu_name *mdt_name(const struct lu_env *env,
                                        char *name, int namelen)
 {