From: braam Date: Tue, 30 Nov 1999 19:06:01 +0000 (+0000) Subject: fixes for 2.3.25 and higher X-Git-Tag: v1_7_100~6178 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=d359f034cae55fcbb974283e41bd8a8c596651d6;ds=sidebyside fixes for 2.3.25 and higher --- diff --git a/lustre/include/linux/obd_support.h b/lustre/include/linux/obd_support.h index 6a835a3..ba262a3 100644 --- a/lustre/include/linux/obd_support.h +++ b/lustre/include/linux/obd_support.h @@ -73,11 +73,11 @@ extern int obd_print_entry; char *uptodate = (Page_Uptodate(page)) ? "yes" : "no";\ char *locked = (PageLocked(page)) ? "yes" : "no";\ int count = page->count.counter;\ - long offset = page->offset;\ + long index = page->index;\ \ CDEBUG(D_IOCTL, " ** %s, cmd: %s, off %ld, uptodate: %s, "\ "locked: %s, cnt %d page %p pages %ld** \n", __FUNCTION__,\ - cmd, offset, uptodate, locked, count, page, (!page->mapping) ? -1 : page->mapping->nrpages);\ + cmd, index, uptodate, locked, count, page, (!page->mapping) ? -1 : page->mapping->nrpages);\ } else { CDEBUG(D_IOCTL, "** %s, no page\n", __FUNCTION__); }} diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 06992c1..5c75ca5 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -202,19 +202,19 @@ void lck_page(struct page *page) int gen_copy_data(struct obd_conn *conn, obdattr *src, obdattr *tgt) { struct page *page; - unsigned long offset = 0; + unsigned long index = 0; int rc; - page = __get_pages(GFP_USER, 0); + page = alloc_page(GFP_USER); if ( !page ) return -ENOMEM; lck_page(page); - while (offset < src->i_size) { + while (index < src->i_size / PAGE_SIZE) { - page->offset = offset; + page->index = index; rc = OBP(conn->oc_dev, brw)(READ, conn, src, page, 0); if ( rc != PAGE_SIZE ) @@ -224,7 +224,7 @@ int gen_copy_data(struct obd_conn *conn, obdattr *src, obdattr *tgt) if ( rc != PAGE_SIZE) break; - offset += rc; + index ++; } tgt->i_size = src->i_size; tgt->i_blocks = src->i_blocks; diff --git a/lustre/obdclass/setup.sh b/lustre/obdclass/setup.sh index fcd1dec..64fe579 100755 --- a/lustre/obdclass/setup.sh +++ b/lustre/obdclass/setup.sh @@ -1,6 +1,9 @@ #! /bin/bash insmod loop losetup /dev/loop0 /tmp/fs + +mke2fs /dev/loop0 + insmod ../class/obdclass.o insmod ../ext2obd/obdext2.o insmod ../obdfs/obdfs.o diff --git a/lustre/obdfs/namei.c b/lustre/obdfs/namei.c index 01d5066..6624e7b 100644 --- a/lustre/obdfs/namei.c +++ b/lustre/obdfs/namei.c @@ -86,7 +86,7 @@ struct page * obdfs_find_entry (struct inode * dir, if (namelen > EXT2_NAME_LEN) return NULL; - CDEBUG(D_INODE, "dirsize is %ld\n", dir->i_size); + CDEBUG(D_INODE, "dirsize is %Ld\n", dir->i_size); page = 0; offset = 0; @@ -1068,11 +1068,11 @@ int obdfs_rename (struct inode * old_dir, struct dentry *old_dentry, } } if ( old_page != new_page ) { - unsigned long offset = old_page->offset; + unsigned long index = old_page->index; /* lock the old_page and release unlocked copy */ CDEBUG(D_INODE, "old_page at %p\n", old_page); page_cache_release(old_page); - old_page = obdfs_getpage(old_dir, offset, 0, LOCKED); + old_page = obdfs_getpage(old_dir, index >> PAGE_SHIFT, 0, LOCKED); CDEBUG(D_INODE, "old_page at %p\n", old_page); iops(old_dir)->o_brw(WRITE, iid(old_dir), old_dir, old_page,0); }