int rc = 0;
struct ptlrpc_request *request;
struct lustre_handle lockh;
+ struct mds_body *body;
struct lookup_intent it = {IT_READDIR};
ENTRY;
rc = mdc_readpage(&sbi->ll_mdc_conn, inode->i_ino,
S_IFDIR, offset, buf, &request);
kunmap(page);
+ body = lustre_msg_buf(request->rq_repmsg, 0);
+ if (!body)
+ rc = -EINVAL;
+ if (body)
+ inode->i_size = body->size;
ptlrpc_free_req(request);
EXIT;
ext2_dirent *de;
struct page *page = ext2_get_page(inode, n);
+ /* size might have been updated by mdc_readpage */
+ npages = dir_pages(inode);
+
if (IS_ERR(page))
continue;
kaddr = page_address(page);
struct vfsmount *mnt;
struct dentry *de;
struct file *file;
- struct mds_body *body;
+ struct mds_body *body, *repbody;
struct obd_run_ctxt saved;
int rc, size = sizeof(*body);
ENTRY;
/* note: in case of an error, dentry_open puts dentry */
if (IS_ERR(file))
GOTO(out_pop, rc = PTR_ERR(file));
+
+ repbody = lustre_msg_buf(req->rq_repmsg, 0);
+ repbody->size = file->f_dentry->d_inode->i_size;
+ repbody->valid = OBD_MD_FLSIZE;
/* to make this asynchronous make sure that the handling function
doesn't send a reply when this function completes. Instead a
callback function would send the reply */
+ /* note: in case of an error, dentry_open puts dentry */
rc = mds_sendpage(req, file, body->size);
filp_close(file, 0);