Whamcloud - gitweb
LU-4423 obdclass: use workqueue for zombie management
[fs/lustre-release.git] / lustre / include / lustre_export.h
index c9ae7ea..6c5a08a 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2016, Intel Corporation.
+ * Copyright (c) 2011, 2017, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -42,6 +42,8 @@
  * @{
  */
 
+#include <linux/workqueue.h>
+
 #include <lprocfs_status.h>
 #include <uapi/linux/lustre/lustre_idl.h>
 #include <lustre_dlm.h>
@@ -202,6 +204,8 @@ struct obd_export {
        struct obd_uuid         exp_client_uuid;
         /** To link all exports on an obd device */
        struct list_head        exp_obd_chain;
+       /** work_struct for destruction of export */
+       struct work_struct      exp_zombie_work;
        /* Unlinked export list */
        struct list_head        exp_stale_list;
        struct hlist_node       exp_uuid_hash;  /** uuid-export hash*/
@@ -324,7 +328,9 @@ static inline __u64 *exp_connect_flags2_ptr(struct obd_export *exp)
 
 static inline __u64 exp_connect_flags2(struct obd_export *exp)
 {
-       return *exp_connect_flags2_ptr(exp);
+       if (exp_connect_flags(exp) & OBD_CONNECT_FLAGS2)
+               return *exp_connect_flags2_ptr(exp);
+       return 0;
 }
 
 static inline int exp_max_brw_size(struct obd_export *exp)
@@ -409,6 +415,13 @@ static inline bool imp_connect_disp_stripe(struct obd_import *imp)
        return ocd->ocd_connect_flags & OBD_CONNECT_DISP_STRIPE;
 }
 
+static inline bool imp_connect_shortio(struct obd_import *imp)
+{
+       struct obd_connect_data *ocd = &imp->imp_connect_data;
+
+       return ocd->ocd_connect_flags & OBD_CONNECT_SHORTIO;
+}
+
 static inline __u64 exp_connect_ibits(struct obd_export *exp)
 {
        struct obd_connect_data *ocd;
@@ -432,13 +445,17 @@ static inline int exp_connect_lockahead(struct obd_export *exp)
        return !!(exp_connect_flags2(exp) & OBD_CONNECT2_LOCKAHEAD);
 }
 
+static inline int exp_connect_flr(struct obd_export *exp)
+{
+       return !!(exp_connect_flags2(exp) & OBD_CONNECT2_FLR);
+}
+
 extern struct obd_export *class_conn2export(struct lustre_handle *conn);
 extern struct obd_device *class_conn2obd(struct lustre_handle *conn);
 
 #define KKUC_CT_DATA_MAGIC     0x092013cea
 struct kkuc_ct_data {
        __u32           kcd_magic;
-       struct obd_uuid kcd_uuid;
        __u32           kcd_archive;
 };