#define DEBUG_SUBSYSTEM S_LLIGHT
#include <linux/obd_support.h>
+#include <linux/obd_class.h>
#include <linux/lustre_lib.h>
#include <linux/lustre_idl.h>
#include <linux/lustre_mds.h>
char *buf;
__u64 offset;
int rc = 0;
- struct ptlrep_hdr *hdr;
+ struct ptlrpc_request *request;
ENTRY;
- if ( ((inode->i_size + PAGE_CACHE_SIZE -1)>>PAGE_SHIFT)
- <= page->index) {
+ if ( ((inode->i_size + PAGE_CACHE_SIZE -1)>>PAGE_SHIFT)
+ <= page->index) {
memset(kmap(page), 0, PAGE_CACHE_SIZE);
kunmap(page);
+ EXIT;
goto readpage_out;
}
if (Page_Uptodate(page)) {
+ CERROR("Explain this please?\n");
EXIT;
goto readpage_out;
}
offset = page->index << PAGE_SHIFT;
buf = kmap(page);
- rc = mdc_readpage(sbi->ll_peer_ptr, inode->i_ino, S_IFDIR, offset, buf,
- NULL, &hdr);
+ rc = mdc_readpage(&sbi->ll_mds_client, inode->i_ino, S_IFDIR, offset,
+ buf, &request);
kunmap(page);
- if ( rc ) {
- EXIT;
- goto readpage_out;
- }
-
- if ((rc = hdr->status)) {
- EXIT;
- goto readpage_out;
- }
-
- /* PDEBUG(page, "READ"); */
+ ptlrpc_free_req(request);
+ EXIT;
- SetPageUptodate(page);
readpage_out:
- obd_unlock_page(page);
- EXIT;
+ if ( !rc )
+ SetPageUptodate(page);
+
+ UnlockPage(page);
return rc;
} /* ll_dir_readpage */
if ((dir->i_size >> PAGE_CACHE_SHIFT) == page->index) {
limit = dir->i_size & ~PAGE_CACHE_MASK;
- if (limit & (chunk_size - 1))
+ if (limit & (chunk_size - 1)) {
+ CERROR("limit %d dir size %lld index %ld\n",
+ limit, dir->i_size, page->index);
goto Ebadsize;
+ }
for (offs = limit; offs<PAGE_CACHE_SIZE; offs += chunk_size) {
ext2_dirent *p = (ext2_dirent*)(kaddr + offs);
p->rec_len = cpu_to_le16(chunk_size);
/* Too bad, we had an error */
Ebadsize:
- printk("ext2_check_page"
- "size of directory #%lu is not a multiple of chunk size",
+ CERROR("ext2_check_page"
+ "size of directory #%lu is not a multiple of chunk size\n",
dir->i_ino
);
goto fail;
//Einumber:
// error = "inode out of bounds";
bad_entry:
- printk("ext2_check_page: bad entry in directory #%lu: %s - "
+ CERROR("ext2_check_page: bad entry in directory #%lu: %s - "
"offset=%lu, inode=%lu, rec_len=%d, name_len=%d",
dir->i_ino, error, (page->index<<PAGE_CACHE_SHIFT)+offs,
(unsigned long) le32_to_cpu(p->inode),
goto fail;
Eend:
p = (ext2_dirent *)(kaddr + offs);
- printk("ext2_check_page"
+ CERROR("ext2_check_page"
"entry in directory #%lu spans the page boundary"
"offset=%lu, inode=%lu",
dir->i_ino, (page->index<<PAGE_CACHE_SHIFT)+offs,
fail:
SetPageChecked(page);
SetPageError(page);
+ BUG();
}
static struct page * ext2_get_page(struct inode *dir, unsigned long n)
name_len = EXT2_DIR_REC_LEN(de->name_len);
rec_len = le16_to_cpu(de->rec_len);
if ( n==npages && rec_len == 0) {
- printk("Fatal dir behaviour\n");
+ CERROR("Fatal dir behaviour\n");
goto out_page;
}
if (!de->inode && rec_len >= reclen)