Whamcloud - gitweb
Fix typo in patch.
[fs/lustre-release.git] / lustre / llite / dir.c
index 05dfb09..8fdffb4 100644 (file)
@@ -521,6 +521,49 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file,
                 obd_ioctl_freedata(buf, len);
                 return rc;
         }
+        case OBD_IOC_LLOG_CATINFO: {
+                struct ptlrpc_request *req = NULL;
+                char *buf = NULL;
+                int rc, len = 0;
+                char *bufs[2], *str;
+                int lens[2], size;
+                
+                rc = obd_ioctl_getdata(&buf, &len, (void *)arg);
+                if (rc)
+                        RETURN(rc);
+                data = (void *)buf;
+
+                if (!data->ioc_inlbuf1) {
+                        obd_ioctl_freedata(buf, len);
+                        RETURN(-EINVAL);
+                }
+                
+                lens[0] = data->ioc_inllen1;
+                bufs[0] = data->ioc_inlbuf1;
+                if (data->ioc_inllen2) {
+                        lens[1] = data->ioc_inllen2;
+                        bufs[1] = data->ioc_inlbuf2;
+                } else {
+                        lens[1] = 0;
+                        bufs[1] = NULL;
+                }
+                size = data->ioc_plen1;
+                req = ptlrpc_prep_req(sbi2mdc(sbi)->cl_import, LLOG_CATINFO, 
+                                      2, lens, bufs);
+                if (!req)
+                        GOTO(out_catinfo, rc = -ENOMEM);
+                req->rq_replen = lustre_msg_size(1, &size);
+               
+                rc = ptlrpc_queue_wait(req);
+                str = lustre_msg_string(req->rq_repmsg, 0, data->ioc_plen1);
+                if (!rc)
+                        rc = copy_to_user(data->ioc_pbuf1, str, 
+                                          data->ioc_plen1);
+                ptlrpc_req_finished(req);
+        out_catinfo:
+                obd_ioctl_freedata(buf, len);
+                RETURN(rc);
+        }                  
         default:
                 return obd_iocontrol(cmd, sbi->ll_osc_exp,0,NULL,(void *)arg);
         }