Whamcloud - gitweb
LU-1431 ptlrpc: PTLRPC_BRW_MAX_SIZE usage cleanup.
[fs/lustre-release.git] / lustre / include / lustre_export.h
index 60595cd..b2250d3 100644 (file)
@@ -218,8 +218,9 @@ struct obd_export {
         * of exp_imp_reverse
         */
        spinlock_t                exp_lock;
-        /** Compatibility flags for this export */
-        __u64                     exp_connect_flags;
+       /** Compatibility flags for this export are embedded into
+        *  exp_connect_data */
+       struct obd_connect_data   exp_connect_data;
         enum obd_option           exp_flags;
         unsigned long             exp_failed:1,
                                   exp_in_recovery:1,
@@ -270,6 +271,25 @@ struct obd_export {
 #define exp_filter_data u.eu_filter_data
 #define exp_ec_data     u.eu_ec_data
 
+static inline __u64 *exp_connect_flags_ptr(struct obd_export *exp)
+{
+       return &exp->exp_connect_data.ocd_connect_flags;
+}
+
+static inline __u64 exp_connect_flags(struct obd_export *exp)
+{
+       return *exp_connect_flags_ptr(exp);
+}
+
+static inline int exp_brw_size(struct obd_export *exp)
+{
+       LASSERT(exp != NULL);
+       if (exp_connect_flags(exp) & OBD_CONNECT_BRW_SIZE)
+               return exp->exp_connect_data.ocd_brw_size;
+
+       return ONE_MB_BRW_SIZE;
+}
+
 static inline int exp_expired(struct obd_export *exp, cfs_duration_t age)
 {
         LASSERT(exp->exp_delayed);
@@ -279,20 +299,20 @@ static inline int exp_expired(struct obd_export *exp, cfs_duration_t age)
 
 static inline int exp_connect_cancelset(struct obd_export *exp)
 {
-        LASSERT(exp != NULL);
-        return !!(exp->exp_connect_flags & OBD_CONNECT_CANCELSET);
+       LASSERT(exp != NULL);
+       return !!(exp_connect_flags(exp) & OBD_CONNECT_CANCELSET);
 }
 
 static inline int exp_connect_lru_resize(struct obd_export *exp)
 {
-        LASSERT(exp != NULL);
-        return !!(exp->exp_connect_flags & OBD_CONNECT_LRU_RESIZE);
+       LASSERT(exp != NULL);
+       return !!(exp_connect_flags(exp) & OBD_CONNECT_LRU_RESIZE);
 }
 
 static inline int exp_connect_rmtclient(struct obd_export *exp)
 {
-        LASSERT(exp != NULL);
-        return !!(exp->exp_connect_flags & OBD_CONNECT_RMT_CLIENT);
+       LASSERT(exp != NULL);
+       return !!(exp_connect_flags(exp) & OBD_CONNECT_RMT_CLIENT);
 }
 
 static inline int client_is_remote(struct obd_export *exp)
@@ -305,20 +325,20 @@ static inline int client_is_remote(struct obd_export *exp)
 
 static inline int exp_connect_vbr(struct obd_export *exp)
 {
-        LASSERT(exp != NULL);
-        LASSERT(exp->exp_connection);
-        return !!(exp->exp_connect_flags & OBD_CONNECT_VBR);
+       LASSERT(exp != NULL);
+       LASSERT(exp->exp_connection);
+       return !!(exp_connect_flags(exp) & OBD_CONNECT_VBR);
 }
 
 static inline int exp_connect_som(struct obd_export *exp)
 {
-        LASSERT(exp != NULL);
-        return !!(exp->exp_connect_flags & OBD_CONNECT_SOM);
+       LASSERT(exp != NULL);
+       return !!(exp_connect_flags(exp) & OBD_CONNECT_SOM);
 }
 
 static inline int exp_connect_umask(struct obd_export *exp)
 {
-        return !!(exp->exp_connect_flags & OBD_CONNECT_UMASK);
+       return !!(exp_connect_flags(exp) & OBD_CONNECT_UMASK);
 }
 
 static inline int imp_connect_lru_resize(struct obd_import *imp)
@@ -332,13 +352,13 @@ static inline int imp_connect_lru_resize(struct obd_import *imp)
 
 static inline int exp_connect_layout(struct obd_export *exp)
 {
-       return !!(exp->exp_connect_flags & OBD_CONNECT_LAYOUTLOCK);
+       return !!(exp_connect_flags(exp) & OBD_CONNECT_LAYOUTLOCK);
 }
 
 static inline bool exp_connect_lvb_type(struct obd_export *exp)
 {
        LASSERT(exp != NULL);
-       if (exp->exp_connect_flags & OBD_CONNECT_LVB_TYPE)
+       if (exp_connect_flags(exp) & OBD_CONNECT_LVB_TYPE)
                return true;
        else
                return false;