Whamcloud - gitweb
LU-6401 obdclass: make get/set_wire_obdo non-inline 66/19266/6
authorBen Evans <bevans@cray.com>
Thu, 31 Mar 2016 19:15:28 +0000 (14:15 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 5 Jul 2016 23:48:37 +0000 (23:48 +0000)
In http://review.whamcloud.com/#/c/16917/ it was requested that
lustre_get_wire_obdo and lustre_set_wire_obdo to not be
inlined functions.

Signed-off-by: Ben Evans <bevans@cray.com>
Change-Id: Ia0537dfbf2fdbd5e83fe49cda4ab6213d999e5e2
Reviewed-on: http://review.whamcloud.com/19266
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lustre_obdo.h
lustre/obdclass/obdo.c
lustre/ptlrpc/layout.c

index 8455b0d..d3afac9 100644 (file)
 #include <lustre/lustre_idl.h>
 
 /**
- * Dumper for struct obdo
- */
-void dump_obdo(struct obdo *oa);
-
-/**
  * Create an obdo to send over the wire
  */
-static inline void lustre_set_wire_obdo(const struct obd_connect_data *ocd,
-                                       struct obdo *wobdo,
-                                       const struct obdo *lobdo)
-{
-       *wobdo = *lobdo;
-       wobdo->o_flags &= ~OBD_FL_LOCAL_MASK;
-       if (ocd == NULL)
-               return;
-
-       if (unlikely(!(ocd->ocd_connect_flags & OBD_CONNECT_FID)) &&
-           fid_seq_is_echo(ostid_seq(&lobdo->o_oi))) {
-               /* Currently OBD_FL_OSTID will only be used when 2.4 echo
-                * client communicate with pre-2.4 server */
-               wobdo->o_oi.oi.oi_id = fid_oid(&lobdo->o_oi.oi_fid);
-               wobdo->o_oi.oi.oi_seq = fid_seq(&lobdo->o_oi.oi_fid);
-       }
-}
+void lustre_set_wire_obdo(const struct obd_connect_data *ocd,
+                         struct obdo *wobdo,
+                         const struct obdo *lobdo);
 
 /**
  * Create a local obdo from a wire based odbo
  */
-static inline void lustre_get_wire_obdo(const struct obd_connect_data *ocd,
-                                       struct obdo *lobdo,
-                                       const struct obdo *wobdo)
-{
-       __u32 local_flags = 0;
-
-       if (lobdo->o_valid & OBD_MD_FLFLAGS)
-               local_flags = lobdo->o_flags & OBD_FL_LOCAL_MASK;
-
-       *lobdo = *wobdo;
-       if (local_flags != 0) {
-               lobdo->o_valid |= OBD_MD_FLFLAGS;
-               lobdo->o_flags &= ~OBD_FL_LOCAL_MASK;
-               lobdo->o_flags |= local_flags;
-       }
-       if (ocd == NULL)
-               return;
-
-       if (unlikely(!(ocd->ocd_connect_flags & OBD_CONNECT_FID)) &&
-           fid_seq_is_echo(wobdo->o_oi.oi.oi_seq)) {
-               /* see above */
-               lobdo->o_oi.oi_fid.f_seq = wobdo->o_oi.oi.oi_seq;
-               lobdo->o_oi.oi_fid.f_oid = wobdo->o_oi.oi.oi_id;
-               lobdo->o_oi.oi_fid.f_ver = 0;
-       }
-}
-
+void lustre_get_wire_obdo(const struct obd_connect_data *ocd,
+                         struct obdo *lobdo,
+                         const struct obdo *wobdo);
 #endif
index 45cb2f4..dffd029 100644 (file)
@@ -48,6 +48,7 @@
 #endif
 #include <obd_class.h>
 #include <lustre/lustre_idl.h>
+#include <lustre_obdo.h>
 
 void obdo_set_parent_fid(struct obdo *dst, const struct lu_fid *parent)
 {
@@ -169,3 +170,56 @@ void obdo_to_ioobj(const struct obdo *oa, struct obd_ioobj *ioobj)
        ioobj->ioo_max_brw = 0;
 }
 EXPORT_SYMBOL(obdo_to_ioobj);
+
+/**
+ * Create an obdo to send over the wire
+ */
+void lustre_set_wire_obdo(const struct obd_connect_data *ocd,
+                                struct obdo *wobdo,
+                                const struct obdo *lobdo)
+{
+       *wobdo = *lobdo;
+       wobdo->o_flags &= ~OBD_FL_LOCAL_MASK;
+       if (ocd == NULL)
+               return;
+
+       if (unlikely(!(ocd->ocd_connect_flags & OBD_CONNECT_FID)) &&
+           fid_seq_is_echo(ostid_seq(&lobdo->o_oi))) {
+               /* Currently OBD_FL_OSTID will only be used when 2.4 echo
+                * client communicate with pre-2.4 server */
+               wobdo->o_oi.oi.oi_id = fid_oid(&lobdo->o_oi.oi_fid);
+               wobdo->o_oi.oi.oi_seq = fid_seq(&lobdo->o_oi.oi_fid);
+       }
+}
+EXPORT_SYMBOL(lustre_set_wire_obdo);
+
+/**
+ * Create a local obdo from a wire based odbo
+ */
+void lustre_get_wire_obdo(const struct obd_connect_data *ocd,
+                                struct obdo *lobdo,
+                                const struct obdo *wobdo)
+{
+       __u32 local_flags = 0;
+
+       if (lobdo->o_valid & OBD_MD_FLFLAGS)
+               local_flags = lobdo->o_flags & OBD_FL_LOCAL_MASK;
+
+       *lobdo = *wobdo;
+       if (local_flags != 0) {
+               lobdo->o_valid |= OBD_MD_FLFLAGS;
+               lobdo->o_flags &= ~OBD_FL_LOCAL_MASK;
+               lobdo->o_flags |= local_flags;
+       }
+       if (ocd == NULL)
+               return;
+
+       if (unlikely(!(ocd->ocd_connect_flags & OBD_CONNECT_FID)) &&
+           fid_seq_is_echo(wobdo->o_oi.oi.oi_seq)) {
+               /* see above */
+               lobdo->o_oi.oi_fid.f_seq = wobdo->o_oi.oi.oi_seq;
+               lobdo->o_oi.oi_fid.f_oid = wobdo->o_oi.oi.oi_id;
+               lobdo->o_oi.oi_fid.f_ver = 0;
+       }
+}
+EXPORT_SYMBOL(lustre_get_wire_obdo);
index 04a0da1..92f31e2 100644 (file)
@@ -1103,8 +1103,9 @@ EXPORT_SYMBOL(RMF_LAYOUT_INTENT);
  * OST request field.
  */
 struct req_msg_field RMF_OST_BODY =
-        DEFINE_MSGF("ost_body", 0,
-                    sizeof(struct ost_body), lustre_swab_ost_body, dump_ost_body);
+       DEFINE_MSGF("ost_body", 0,
+                   sizeof(struct ost_body), lustre_swab_ost_body,
+                   dump_ost_body);
 EXPORT_SYMBOL(RMF_OST_BODY);
 
 struct req_msg_field RMF_OBD_IOOBJ =