Whamcloud - gitweb
refactor dual checksum support.
[fs/lustre-release.git] / lustre / llite / llite_lib.c
index c97ad3c..52e89e9 100644 (file)
@@ -35,6 +35,7 @@
 #include <lustre_disk.h>
 #include <lustre_param.h>
 #include <lustre_log.h>
+#include <obd_cksum.h>
 #include "llite_internal.h"
 
 cfs_mem_cache_t *ll_file_data_slab;
@@ -81,7 +82,7 @@ static struct ll_sb_info *ll_init_sbi(void)
 
         ll_generate_random_uuid(uuid);
         class_uuid_unparse(uuid, &sbi->ll_sb_uuid);
-        CDEBUG(D_HA, "generated uuid: %s\n", sbi->ll_sb_uuid.uuid);
+        CDEBUG(D_CONFIG, "generated uuid: %s\n", sbi->ll_sb_uuid.uuid);
 
         spin_lock(&ll_sb_lock);
         list_add_tail(&sbi->ll_list, &ll_super_blocks);
@@ -122,7 +123,7 @@ void ll_free_sbi(struct super_block *sb)
 }
 
 static struct dentry_operations ll_d_root_ops = {
-#ifdef LUSTRE_KERNEL_VERSION
+#ifdef DCACHE_LUSTRE_INVALID
         .d_compare = ll_dcompare,
 #endif
 };
@@ -161,8 +162,7 @@ static int ll_init_ea_size(struct obd_export *md_exp, struct obd_export *dt_exp)
         RETURN(rc);
 }
 
-static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
-                                    uid_t nllu, gid_t nllg)
+static int client_common_fill_super(struct super_block *sb, char *md, char *dt)
 {
         struct inode *root = 0;
         struct ll_sb_info *sbi = ll_s2sbi(sb);
@@ -197,11 +197,12 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
         }
 
         /* indicate the features supported by this client */
-        data->ocd_connect_flags = OBD_CONNECT_IBITS | OBD_CONNECT_NODEVOH |
-                                  OBD_CONNECT_JOIN |
-                                  OBD_CONNECT_ATTRFID | OBD_CONNECT_VERSION |
-                                  OBD_CONNECT_MDS_CAPA | OBD_CONNECT_OSS_CAPA |
-                                  OBD_CONNECT_CANCELSET;
+        data->ocd_connect_flags = OBD_CONNECT_IBITS    | OBD_CONNECT_NODEVOH  |
+                                  OBD_CONNECT_JOIN     | OBD_CONNECT_ATTRFID  |
+                                  OBD_CONNECT_VERSION  | OBD_CONNECT_MDS_CAPA |
+                                  OBD_CONNECT_OSS_CAPA | OBD_CONNECT_CANCELSET|
+                                  OBD_CONNECT_FID;
+
 #ifdef HAVE_LRU_RESIZE_SUPPORT
         if (sbi->ll_flags & LL_SBI_LRU_RESIZE)
                 data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE;
@@ -238,8 +239,6 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
                 data->ocd_connect_flags &= ~OBD_CONNECT_RMT_CLIENT;
                 data->ocd_connect_flags |= OBD_CONNECT_LCL_CLIENT;
         }
-        data->ocd_nllu = nllu;
-        data->ocd_nllg = nllg;
 
         err = obd_connect(NULL, &md_conn, obd, &sbi->ll_sb_uuid, data);
         if (err == -EBUSY) {
@@ -261,7 +260,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
                 GOTO(out_md, err);
         }
 
-        err = obd_statfs(obd, &osfs, cfs_time_current_64() - HZ);
+        err = obd_statfs(obd, &osfs, cfs_time_current_64() - HZ, 0);
         if (err)
                 GOTO(out_md_fid, err);
 
@@ -364,12 +363,26 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
                 GOTO(out_md_fid, err = -ENODEV);
         }
 
-        data->ocd_connect_flags = OBD_CONNECT_GRANT | OBD_CONNECT_VERSION |
+        data->ocd_connect_flags = OBD_CONNECT_GRANT     | OBD_CONNECT_VERSION  |
                                   OBD_CONNECT_REQPORTAL | OBD_CONNECT_BRW_SIZE |
-                                  OBD_CONNECT_CANCELSET;
+                                  OBD_CONNECT_CANCELSET | OBD_CONNECT_FID;
         if (sbi->ll_flags & LL_SBI_OSS_CAPA)
                 data->ocd_connect_flags |= OBD_CONNECT_OSS_CAPA;
 
+        if (!OBD_FAIL_CHECK(OBD_FAIL_OSC_CONNECT_CKSUM)) {
+                /* OBD_CONNECT_CKSUM should always be set, even if checksums are
+                 * disabled by default, because it can still be enabled on the
+                 * fly via /proc. As a consequence, we still need to come to an
+                 * agreement on the supported algorithms at connect time */
+                data->ocd_connect_flags |= OBD_CONNECT_CKSUM;
+
+                if (OBD_FAIL_CHECK(OBD_FAIL_OSC_CKSUM_ADLER_ONLY))
+                        data->ocd_cksum_types = OBD_CKSUM_ADLER;
+                else
+                        /* send the list of supported checksum types */
+                        data->ocd_cksum_types = OBD_CKSUM_ALL;
+        }
+
 #ifdef HAVE_LRU_RESIZE_SUPPORT
         data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE;
 #endif
@@ -421,8 +434,8 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
                 ll_async_page_slab_size =
                         size_round(sizeof(struct ll_async_page)) + err;
                 ll_async_page_slab = cfs_mem_cache_create("ll_async_page",
-                                                        ll_async_page_slab_size,
-                                                           0, 0);
+                                                          ll_async_page_slab_size,
+                                                          0, 0);
                 if (!ll_async_page_slab)
                         GOTO(out_dt_fid, err = -ENOMEM);
         }
@@ -454,9 +467,8 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
                 GOTO(out_dt_fid, err);
         }
         memset(&lmd, 0, sizeof(lmd));
-        err = md_get_lustre_md(sbi->ll_md_exp, request, 
-                               REPLY_REC_OFF, sbi->ll_dt_exp, sbi->ll_md_exp, 
-                               &lmd);
+        err = md_get_lustre_md(sbi->ll_md_exp, request, sbi->ll_dt_exp,
+                               sbi->ll_md_exp, &lmd);
         if (err) {
                 CERROR("failed to understand root inode md: rc = %d\n", err);
                 ptlrpc_req_finished (request);
@@ -487,6 +499,13 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
                 GOTO(out_root, err);
         }
 
+#ifdef CONFIG_FS_POSIX_ACL
+        if (sbi->ll_flags & LL_SBI_RMT_CLIENT) {
+                rct_init(&sbi->ll_rct);
+                et_init(&sbi->ll_et);
+        }
+#endif
+
         checksum = sbi->ll_flags & LL_SBI_CHECKSUM;
         err = obd_set_info_async(sbi->ll_dt_exp, strlen("checksum"),"checksum",
                                  sizeof(checksum), &checksum, NULL);
@@ -675,6 +694,13 @@ void client_common_put_super(struct super_block *sb)
         struct ll_sb_info *sbi = ll_s2sbi(sb);
         ENTRY;
 
+#ifdef CONFIG_FS_POSIX_ACL
+        if (sbi->ll_flags & LL_SBI_RMT_CLIENT) {
+                et_fini(&sbi->ll_et);
+                rct_fini(&sbi->ll_rct);
+        }
+#endif
+
         obd_cancel_unused(sbi->ll_dt_exp, NULL, 0, NULL);
 
         ll_close_thread_shutdown(sbi->ll_lcq);
@@ -694,8 +720,6 @@ void client_common_put_super(struct super_block *sb)
         obd_disconnect(sbi->ll_md_exp);
         sbi->ll_md_exp = NULL;
 
-        lustre_throw_orphan_dentries(sb);
-
         EXIT;
 }
 
@@ -885,7 +909,7 @@ int ll_fill_super(struct super_block *sb)
 
         cfs_module_get();
 
-        sb->s_type->fs_flags |= FS_ODD_RENAME;
+        sb->s_type->fs_flags |= FS_RENAME_DOES_D_MOVE;
         /* client additional sb info */
         lsi->lsi_llsbi = sbi = ll_init_sbi();
         if (!sbi) {
@@ -934,9 +958,7 @@ int ll_fill_super(struct super_block *sb)
         sprintf(md, "%s-%s", lprof->lp_md, ll_instance);
 
         /* connections, registrations, sb setup */
-        err = client_common_fill_super(sb, md, dt,
-                                       lsi->lsi_lmd->lmd_nllu,
-                                       lsi->lsi_lmd->lmd_nllg);
+        err = client_common_fill_super(sb, md, dt);
 
 out_free:
         if (md)
@@ -1168,8 +1190,8 @@ int ll_md_setattr(struct inode *inode, struct md_op_data *op_data,
                 RETURN(rc);
         }
 
-        rc = md_get_lustre_md(sbi->ll_md_exp, request, REPLY_REC_OFF,
-                              sbi->ll_dt_exp, sbi->ll_md_exp, &md);
+        rc = md_get_lustre_md(sbi->ll_md_exp, request, sbi->ll_dt_exp,
+                              sbi->ll_md_exp, &md);
         if (rc) {
                 ptlrpc_req_finished(request);
                 RETURN(rc);
@@ -1306,13 +1328,14 @@ int ll_setattr_raw(struct inode *inode, struct iattr *attr)
         OBD_ALLOC_PTR(op_data);
         if (op_data == NULL)
                 RETURN(-ENOMEM);
-        
+
         memcpy(&op_data->op_attr, attr, sizeof(*attr));
 
         /* Open epoch for truncate. */
-        if (ia_valid & ATTR_SIZE)
+        if ((ll_i2mdexp(inode)->exp_connect_flags & OBD_CONNECT_SOM) &&
+            (ia_valid & ATTR_SIZE))
                 op_data->op_flags = MF_EPOCH_OPEN;
-        
+
         rc = ll_md_setattr(inode, op_data, &mod);
         if (rc)
                 GOTO(out, rc);
@@ -1425,14 +1448,14 @@ int ll_setattr(struct dentry *de, struct iattr *attr)
 }
 
 int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
-                       __u64 max_age)
+                       __u64 max_age, __u32 flags)
 {
         struct ll_sb_info *sbi = ll_s2sbi(sb);
         struct obd_statfs obd_osfs;
         int rc;
         ENTRY;
 
-        rc = obd_statfs(class_exp2obd(sbi->ll_md_exp), osfs, max_age);
+        rc = obd_statfs(class_exp2obd(sbi->ll_md_exp), osfs, max_age, flags);
         if (rc) {
                 CERROR("md_statfs fails: rc = %d\n", rc);
                 RETURN(rc);
@@ -1444,7 +1467,7 @@ int ll_statfs_internal(struct super_block *sb, struct obd_statfs *osfs,
                osfs->os_bavail, osfs->os_blocks, osfs->os_ffree,osfs->os_files);
 
         rc = obd_statfs_rqset(class_exp2obd(sbi->ll_dt_exp),
-                              &obd_osfs, max_age);
+                              &obd_osfs, max_age, flags);
         if (rc) {
                 CERROR("obd_statfs fails: rc = %d\n", rc);
                 RETURN(rc);
@@ -1488,7 +1511,7 @@ int ll_statfs(struct dentry *de, struct kstatfs *sfs)
         /* For now we will always get up-to-date statfs values, but in the
          * future we may allow some amount of caching on the client (e.g.
          * from QOS or lprocfs updates). */
-        rc = ll_statfs_internal(sb, &osfs, cfs_time_current_64() - 1);
+        rc = ll_statfs_internal(sb, &osfs, cfs_time_current_64() - 1, 0);
         if (rc)
                 return rc;
 
@@ -1662,25 +1685,6 @@ void ll_update_inode(struct inode *inode, struct lustre_md *md)
                 inode->i_nlink = body->nlink;
         if (body->valid & OBD_MD_FLRDEV)
                 inode->i_rdev = old_decode_dev(body->rdev);
-        if (body->valid & OBD_MD_FLSIZE) {
-                if (ll_i2mdexp(inode)->exp_connect_flags & OBD_CONNECT_SOM) {
-                        if (lli->lli_flags & (LLIF_DONE_WRITING |
-                                              LLIF_EPOCH_PENDING |
-                                              LLIF_SOM_DIRTY))
-                          CWARN("ino %lu flags %lu still has size authority!"
-                                "do not trust the size got from MDS\n", 
-                                inode->i_ino, lli->lli_flags);
-                        else {
-                                i_size_write(inode, body->size);
-                                lli->lli_flags |= LLIF_MDS_SIZE_LOCK;
-                        }
-                } else {
-                        i_size_write(inode, body->size);
-                }
-
-                if (body->valid & OBD_MD_FLBLOCKS)
-                        inode->i_blocks = body->blocks;
-        }
 
         if (body->valid & OBD_MD_FLID) {
                 /* FID shouldn't be changed! */
@@ -1696,6 +1700,44 @@ void ll_update_inode(struct inode *inode, struct lustre_md *md)
 
         LASSERT(fid_seq(&lli->lli_fid) != 0);
 
+        if (body->valid & OBD_MD_FLSIZE) {
+                if ((ll_i2mdexp(inode)->exp_connect_flags & OBD_CONNECT_SOM) &&
+                    S_ISREG(inode->i_mode) && lli->lli_smd) {
+                        struct lustre_handle lockh;
+                        ldlm_mode_t mode;
+                        
+                        /* As it is possible a blocking ast has been processed
+                         * by this time, we need to check there is an UPDATE 
+                         * lock on the client and set LLIF_MDS_SIZE_LOCK holding
+                         * it. */
+                        mode = ll_take_md_lock(inode, MDS_INODELOCK_UPDATE,
+                                               &lockh);
+                        if (mode) {
+                                if (lli->lli_flags & (LLIF_DONE_WRITING |
+                                                      LLIF_EPOCH_PENDING |
+                                                      LLIF_SOM_DIRTY)) {
+                                        CERROR("ino %lu flags %lu still has "
+                                               "size authority! do not trust "
+                                               "the size got from MDS\n",
+                                               inode->i_ino, lli->lli_flags);
+                                } else {
+                                        /* Use old size assignment to avoid
+                                         * deadlock bz14138 & bz14326 */
+                                        inode->i_size = body->size;
+                                        lli->lli_flags |= LLIF_MDS_SIZE_LOCK;
+                                }
+                                ldlm_lock_decref(&lockh, mode);
+                        }
+                } else {
+                        /* Use old size assignment to avoid
+                         * deadlock bz14138 & bz14326 */
+                        inode->i_size = body->size;
+                }
+
+                if (body->valid & OBD_MD_FLBLOCKS)
+                        inode->i_blocks = body->blocks;
+        }
+
         if (body->valid & OBD_MD_FLMDSCAPA) {
                 LASSERT(md->mds_capa);
                 ll_add_capa(inode, md->mds_capa);
@@ -1777,6 +1819,7 @@ void ll_delete_inode(struct inode *inode)
         if (rc) {
                 CERROR("fid_delete() failed, rc %d\n", rc);
         }
+        truncate_inode_pages(&inode->i_data, 0);
         clear_inode(inode);
 
         EXIT;
@@ -1804,14 +1847,11 @@ int ll_iocontrol(struct inode *inode, struct file *file,
                         RETURN(-abs(rc));
                 }
 
-                body = lustre_msg_buf(req->rq_repmsg, REPLY_REC_OFF,
-                                      sizeof(*body));
+                body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
 
-                /*Now the ext3 will be packed directly back to client,
-                 *no need convert here*/
                 flags = body->flags;
 
-                ptlrpc_req_finished (req);
+                ptlrpc_req_finished(req);
 
                 RETURN(put_user(flags, (int *)arg));
         }
@@ -1974,8 +2014,9 @@ int ll_remount_fs(struct super_block *sb, int *flags, char *data)
         return 0;
 }
 
-int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
-                  int offset, struct super_block *sb)
+int ll_prep_inode(struct inode **inode,
+                  struct ptlrpc_request *req,
+                  struct super_block *sb)
 {
         struct ll_sb_info *sbi = NULL;
         struct lustre_md md;
@@ -1987,8 +2028,8 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
         prune_deathrow(sbi, 1);
         memset(&md, 0, sizeof(struct lustre_md));
 
-        rc = md_get_lustre_md(sbi->ll_md_exp, req, offset,
-                              sbi->ll_dt_exp, sbi->ll_md_exp, &md);
+        rc = md_get_lustre_md(sbi->ll_md_exp, req, sbi->ll_dt_exp,
+                              sbi->ll_md_exp, &md);
         if (rc)
                 RETURN(rc);
 
@@ -2055,12 +2096,10 @@ struct ll_async_page *llite_pglist_next_llap(struct ll_sb_info *sbi,
 int ll_obd_statfs(struct inode *inode, void *arg)
 {
         struct ll_sb_info *sbi = NULL;
-        struct obd_device *client_obd = NULL, *lov_obd = NULL;
-        struct lov_obd *lov = NULL;
-        struct obd_statfs stat_buf = {0};
+        struct obd_export *exp;
         char *buf = NULL;
         struct obd_ioctl_data *data = NULL;
-        __u32 type, index;
+        __u32 type;
         int len = 0, rc;
 
         if (!inode || !(sbi = ll_i2sbi(inode)))
@@ -2076,42 +2115,16 @@ int ll_obd_statfs(struct inode *inode, void *arg)
                 GOTO(out_statfs, rc = -EINVAL);
 
         memcpy(&type, data->ioc_inlbuf1, sizeof(__u32));
-        memcpy(&index, data->ioc_inlbuf2, sizeof(__u32));
-
-        if (type == LL_STATFS_MDC) {
-                if (index > 0)
-                        GOTO(out_statfs, rc = -ENODEV);
-                client_obd = class_exp2obd(sbi->ll_md_exp);
-        } else if (type == LL_STATFS_LOV) {
-                lov_obd = class_exp2obd(sbi->ll_dt_exp);
-                lov = &lov_obd->u.lov;
-
-                if ((index >= lov->desc.ld_tgt_count))
-                        GOTO(out_statfs, rc = -ENODEV);
-                if (!lov->lov_tgts[index])
-                        /* Try again with the next index */
-                        GOTO(out_statfs, rc = -EAGAIN);
-
-                client_obd = class_exp2obd(lov->lov_tgts[index]->ltd_exp);
-                if (!lov->lov_tgts[index]->ltd_active)
-                        GOTO(out_uuid, rc = -ENODATA);
-        }
-
-        if (!client_obd)
-                GOTO(out_statfs, rc = -EINVAL);
-
-        rc = obd_statfs(client_obd, &stat_buf, cfs_time_current_64() - 1);
+        if (type == LL_STATFS_MDC)
+                exp = sbi->ll_md_exp;
+        else if (type == LL_STATFS_LOV)
+                exp = sbi->ll_dt_exp;
+        else 
+                GOTO(out_statfs, rc = -ENODEV);
+
+        rc = obd_iocontrol(IOC_OBD_STATFS, exp, len, buf, NULL);
         if (rc)
                 GOTO(out_statfs, rc);
-
-        if (copy_to_user(data->ioc_pbuf1, &stat_buf, data->ioc_plen1))
-                GOTO(out_statfs, rc = -EFAULT);
-
-out_uuid:
-        if (copy_to_user(data->ioc_pbuf2, obd2cli_tgt(client_obd),
-                         data->ioc_plen2))
-                rc = -EFAULT;
-
 out_statfs:
         if (buf)
                 obd_ioctl_freedata(buf, len);
@@ -2126,7 +2139,7 @@ int ll_process_config(struct lustre_cfg *lcfg)
         unsigned long x; 
         int rc = 0;
 
-        lprocfs_init_vars(llite, &lvars);
+        lprocfs_llite_init_vars(&lvars);
 
         /* The instance name contains the sb: lustre-client-aacfe000 */
         ptr = strrchr(lustre_cfg_string(lcfg, 0), '-');
@@ -2194,100 +2207,3 @@ void ll_finish_md_op_data(struct md_op_data *op_data)
         capa_put(op_data->op_capa2);
         OBD_FREE_PTR(op_data);
 }
-
-int ll_ioctl_getfacl(struct inode *inode, struct rmtacl_ioctl_data *ioc)
-{
-        struct ll_sb_info *sbi = ll_i2sbi(inode);
-        struct ptlrpc_request *req = NULL;
-        struct mdt_body *body;
-        char *cmd, *buf;
-        struct obd_capa *oc;
-        int rc, buflen;
-        ENTRY;
-
-        if (!(sbi->ll_flags & LL_SBI_RMT_CLIENT))
-                RETURN(-EBADE);
-
-        LASSERT(ioc->cmd && ioc->cmd_len && ioc->res && ioc->res_len);
-
-        OBD_ALLOC(cmd, ioc->cmd_len);
-        if (!cmd)
-                RETURN(-ENOMEM);
-        if (copy_from_user(cmd, ioc->cmd, ioc->cmd_len))
-                GOTO(out, rc = -EFAULT);
-
-        oc = ll_mdscapa_get(inode);
-        rc = md_getxattr(ll_i2sbi(inode)->ll_md_exp, ll_inode2fid(inode), oc,
-                         OBD_MD_FLXATTR, XATTR_NAME_LUSTRE_ACL, cmd,
-                         ioc->cmd_len, ioc->res_len, 0, &req);
-        capa_put(oc);
-        if (rc < 0) {
-                CERROR("mdc_getxattr %s [%s] failed: %d\n",
-                       XATTR_NAME_LUSTRE_ACL, cmd, rc);
-                GOTO(out, rc);
-        }
-
-        body = lustre_msg_buf(req->rq_repmsg, REPLY_REC_OFF, sizeof(*body));
-        LASSERT(body);
-
-        buflen = lustre_msg_buflen(req->rq_repmsg, REPLY_REC_OFF);
-        LASSERT(buflen <= ioc->res_len);
-        buf = lustre_msg_string(req->rq_repmsg, REPLY_REC_OFF + 1, ioc->res_len);
-        LASSERT(buf);
-        if (copy_to_user(ioc->res, buf, buflen))
-                GOTO(out, rc = -EFAULT);
-        EXIT;
-out:
-        if (req)
-                ptlrpc_req_finished(req);
-        OBD_FREE(cmd, ioc->cmd_len);
-        return rc;
-}
-
-int ll_ioctl_setfacl(struct inode *inode, struct rmtacl_ioctl_data *ioc)
-{
-        struct ll_sb_info *sbi = ll_i2sbi(inode);
-        struct ptlrpc_request *req = NULL;
-        char *cmd, *buf;
-        struct obd_capa *oc;
-        int buflen, rc;
-        ENTRY;
-
-        if (!(sbi->ll_flags & LL_SBI_RMT_CLIENT))
-                RETURN(-EBADE);
-
-        if (!(sbi->ll_flags & LL_SBI_ACL)) 
-                RETURN(-EOPNOTSUPP);
-
-        LASSERT(ioc->cmd && ioc->cmd_len && ioc->res && ioc->res_len);
-
-        OBD_ALLOC(cmd, ioc->cmd_len);
-        if (!cmd)
-                RETURN(-ENOMEM);
-        if (copy_from_user(cmd, ioc->cmd, ioc->cmd_len))
-                GOTO(out, rc = -EFAULT);
-
-        oc = ll_mdscapa_get(inode);
-        rc = md_setxattr(ll_i2sbi(inode)->ll_md_exp, ll_inode2fid(inode), oc,
-                         OBD_MD_FLXATTR, XATTR_NAME_LUSTRE_ACL, cmd,
-                         ioc->cmd_len, ioc->res_len, 0, &req);
-        capa_put(oc);
-        if (rc) {
-                CERROR("mdc_setxattr %s [%s] failed: %d\n",
-                       XATTR_NAME_LUSTRE_ACL, cmd, rc);
-                GOTO(out, rc);
-        }
-
-        buflen = lustre_msg_buflen(req->rq_repmsg, REPLY_REC_OFF);
-        LASSERT(buflen <= ioc->res_len);
-        buf = lustre_msg_string(req->rq_repmsg, REPLY_REC_OFF, ioc->res_len);
-        LASSERT(buf);
-        if (copy_to_user(ioc->res, buf, buflen))
-                GOTO(out, rc = -EFAULT);
-        EXIT;
-out:
-        if (req)
-                ptlrpc_req_finished(req);
-        OBD_FREE(cmd, ioc->cmd_len);
-        return rc;
-}