Whamcloud - gitweb
fix setattr bug; check in symlink changes
authorbraam <braam>
Fri, 19 Oct 2001 04:13:53 +0000 (04:13 +0000)
committerbraam <braam>
Fri, 19 Oct 2001 04:13:53 +0000 (04:13 +0000)
lustre/demos/config.sh
lustre/obdfs/namei.c
lustre/obdfs/rw.c
lustre/obdfs/super.c

index 4d19a29..5a5140d 100644 (file)
@@ -25,8 +25,8 @@ OBDMAJ=186
 
 # If LOOPDEV is empty, then it is assumed that BASEDEV is a real block device
 # that doesn't mind being overwritten - don't use a partition with data on it!!
-LOOPDEV="/dev/loop0"
-BASEDEV="/dev/loop0"
+LOOPDEV=""
+BASEDEV="/dev/hda5"
 
 # The following are mount points for the filesystems during the test.
 MNTOBD="/mnt/obd"
index 219967c..64d6035 100644 (file)
@@ -201,48 +201,6 @@ static int obdfs_mknod (struct inode * dir, struct dentry *dentry, int mode, int
        return err;
 }
 
-
-/* XXX sort this out -- why is our readpage re-reading the page? */
-static int obdfs_page_symlink(struct inode *inode, const char *symname, int len)
-{
-       struct address_space *mapping = inode->i_mapping;
-       struct page *page = grab_cache_page(mapping, 0);
-       int err = -ENOMEM;
-       char *kaddr;
-
-       if (!page)
-               goto fail;
-       err = mapping->a_ops->prepare_write(NULL, page, 0, len-1);
-       if (err)
-               goto fail_map;
-       kaddr = page_address(page);
-       memcpy(kaddr, symname, len-1);
-       mapping->a_ops->commit_write(NULL, page, 0, len-1);
-#if 0
-       /*
-        * Notice that we are _not_ going to block here - end of page is
-        * unmapped, so this will only try to map the rest of page, see
-        * that it is unmapped (typically even will not look into inode -
-        * ->i_size will be enough for everything) and zero it out.
-        * OTOH it's obviously correct and should make the page up-to-date.
-        */
-       err = mapping->a_ops->readpage(NULL, page);
-       wait_on_page(page);
-#endif
-       obd_unlock_page(page);
-       page_cache_release(page);
-       if (err < 0)
-               goto fail;
-       mark_inode_dirty(inode);
-       return 0;
-fail_map:
-       UnlockPage(page);
-       page_cache_release(page);
-fail:
-       return err;
-}
-
-
 static int obdfs_symlink (struct inode * dir, struct dentry * dentry,
        const char * symname)
 {
@@ -265,9 +223,7 @@ static int obdfs_symlink (struct inode * dir, struct dentry * dentry,
                /* slow symlink */
                inode->i_op = &page_symlink_inode_operations;
                inode->i_mapping->a_ops = &obdfs_aops;
-               printk("-----> calling block symlink len %d\n", l); 
-               err = obdfs_page_symlink(inode, symname, l);
-               printk("-----> calling block err %d\n", err); 
+               err = block_symlink(inode, symname, l);
                if (err)
                        goto out_fail;
        } else {
index 05e74ba..218e366 100644 (file)
@@ -81,15 +81,24 @@ int obdfs_readpage(struct file *file, struct page *page)
         int rc;
 
         ENTRY;
-        /* PDEBUG(page, "READ"); */
+       
+       if (Page_Uptodate(page)) {
+               EXIT;
+               goto readpage_out;
+       }
+
         rc = obdfs_brw(READ, inode, page, 0);
-        if ( !rc ) {
-                SetPageUptodate(page);
-                obd_unlock_page(page);
+        if ( rc ) {
+               EXIT; 
+               return rc;
         } 
         /* PDEBUG(page, "READ"); */
+
+ readpage_out:
+       SetPageUptodate(page);
+       obd_unlock_page(page);
         EXIT;
-        return rc;
+        return 0;
 } /* obdfs_readpage */
 
 int obdfs_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to)
index 5f97dcc..6332866 100644 (file)
@@ -442,6 +442,7 @@ int obdfs_notify_change(struct dentry *de, struct iattr *attr)
                 return -ENOMEM;
         }
 
+       inode_setattr(inode, attr);
         oa->o_id = inode->i_ino;
         obdo_from_iattr(oa, attr);
         err = IOPS(inode, setattr)(IID(inode), oa);