#include <linux/lustre_idl.h>
#include <linux/lustre_mds.h>
#include <linux/lustre_lite.h>
+#include <linux/lustre_dlm.h>
typedef struct ext2_dir_entry_2 ext2_dirent;
__u64 offset;
int rc = 0;
struct ptlrpc_request *request = NULL;
+ struct lustre_handle lockh;
+ struct lookup_intent it = {IT_READDIR };
ENTRY;
goto readpage_out;
}
+ rc = ll_lock(inode, NULL, &it, &lockh);
+ if (rc != ELDLM_OK)
+ CERROR("lock enqueue: err: %d\n", rc);
+ ldlm_lock_dump((void *)(unsigned long)lockh.addr);
+
if (Page_Uptodate(page)) {
CERROR("Explain this please?\n");
EXIT;
offset = page->index << PAGE_SHIFT;
buf = kmap(page);
- rc = mdc_readpage(&sbi->ll_mds_client, sbi->ll_mds_conn, inode->i_ino,
+ rc = mdc_readpage(&sbi->ll_mdc_conn, inode->i_ino,
S_IFDIR, offset, buf, &request);
kunmap(page);
ptlrpc_free_req(request);
SetPageUptodate(page);
UnlockPage(page);
+ rc = ll_unlock(LCK_PR, &lockh);
+ if (rc != ELDLM_OK)
+ CERROR("ll_unlock: err: %d\n", rc);
return rc;
} /* ll_dir_readpage */
}
int
-new_ll_readdir (struct file * filp, void * dirent, filldir_t filldir)
+ll_readdir (struct file * filp, void * dirent, filldir_t filldir)
{
loff_t pos = filp->f_pos;
struct inode *inode = filp->f_dentry->d_inode;
if (!page)
return -ENOMEM;
+ base = kmap(page);
+ if (!base)
+ return -ENOMEM;
+
err = mapping->a_ops->prepare_write(NULL, page, 0, chunk_size);
if (err)
goto fail;
- base = page_address(page);
-
de = (struct ext2_dir_entry_2 *) base;
de->name_len = 1;
de->rec_len = cpu_to_le16(EXT2_DIR_REC_LEN(1));
err = ext2_commit_chunk(page, 0, chunk_size);
fail:
+ kunmap(page);
UnlockPage(page);
page_cache_release(page);
ENTRY;
struct file_operations ll_dir_operations = {
read: generic_read_dir,
- readdir: new_ll_readdir
+ readdir: ll_readdir
};