Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / ptlrpc / layout.c
index 1ddf68c..562335c 100644 (file)
@@ -16,8 +16,8 @@
  * in the LICENSE file that accompanied this code).
  *
  * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see [sun.com URL with a
- * copy of GPLv2].
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
  *
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  * CA 95054 USA or visit www.sun.com if you need additional information or
@@ -66,7 +66,7 @@
 #endif
 /* struct ptlrpc_request, lustre_msg* */
 #include <lustre_req_layout.h>
-#include <linux/lustre_acl.h>
+#include <lustre_acl.h>
 
 /*
  * empty set of fields... for suitable definition of emptiness.
@@ -504,6 +504,17 @@ static const struct req_msg_field *ost_get_last_id_server[] = {
         &RMF_OBD_ID
 };
 
+static const struct req_msg_field *ost_get_fiemap_client[] = {
+        &RMF_PTLRPC_BODY,
+        &RMF_FIEMAP_KEY,
+        &RMF_FIEMAP_VAL
+};
+
+static const struct req_msg_field *ost_get_fiemap_server[] = {
+        &RMF_PTLRPC_BODY,
+        &RMF_FIEMAP_VAL
+};
+
 static const struct req_format *req_formats[] = {
         &RQF_OBD_PING,
         &RQF_SEC_CTX,
@@ -556,6 +567,7 @@ static const struct req_format *req_formats[] = {
         &RQF_OST_SET_INFO,
         &RQF_OST_GET_INFO_GENERIC,
         &RQF_OST_GET_INFO_LAST_ID,
+        &RQF_OST_GET_INFO_FIEMAP,
         &RQF_LDLM_ENQUEUE,
         &RQF_LDLM_ENQUEUE_LVB,
         &RQF_LDLM_CONVERT,
@@ -582,7 +594,7 @@ static const struct req_format *req_formats[] = {
 struct req_msg_field {
         __u32       rmf_flags;
         const char *rmf_name;
-        /*
+        /**
          * Field length. (-1) means "variable length".
          */
         int         rmf_size;
@@ -809,6 +821,14 @@ const struct req_msg_field RMF_OBD_ID =
                     sizeof(obd_id), lustre_swab_ost_last_id);
 EXPORT_SYMBOL(RMF_OBD_ID);
 
+const struct req_msg_field RMF_FIEMAP_KEY =
+        DEFINE_MSGF("fiemap", 0, sizeof(struct ll_fiemap_info_key),
+                    lustre_swab_fiemap);
+EXPORT_SYMBOL(RMF_FIEMAP_KEY);
+
+const struct req_msg_field RMF_FIEMAP_VAL =
+        DEFINE_MSGF("fiemap", 0, -1, lustre_swab_fiemap);
+EXPORT_SYMBOL(RMF_FIEMAP_VAL);
 
 /*
  * Request formats.
@@ -1172,6 +1192,11 @@ const struct req_format RQF_OST_GET_INFO_LAST_ID =
                                                 ost_get_last_id_server);
 EXPORT_SYMBOL(RQF_OST_GET_INFO_LAST_ID);
 
+const struct req_format RQF_OST_GET_INFO_FIEMAP =
+        DEFINE_REQ_FMT0("OST_GET_INFO_FIEMAP", ost_get_fiemap_client,
+                                               ost_get_fiemap_server);
+EXPORT_SYMBOL(RQF_OST_GET_INFO_FIEMAP);
+
 
 #if !defined(__REQ_LAYOUT_USER__)
 
@@ -1348,8 +1373,11 @@ static void *__req_capsule_get(struct req_capsule *pill,
                 [RCL_SERVER] = "server"
         };
 
+        LASSERT(pill != NULL);
+        LASSERT(pill != LP_POISON);
         fmt = pill->rc_fmt;
         LASSERT(fmt != NULL);
+        LASSERT(fmt != LP_POISON);
         LASSERT(__req_format_is_sane(fmt));
 
         offset = __req_capsule_offset(pill, field, loc);