Whamcloud - gitweb
Update b_bug974 from HEAD (20040210_1406) (b_smallfix landing)
authoradilger <adilger>
Tue, 10 Feb 2004 21:36:35 +0000 (21:36 +0000)
committeradilger <adilger>
Tue, 10 Feb 2004 21:36:35 +0000 (21:36 +0000)
lustre/kernel_patches/patches/ext3-truncate-buffer-head.patch
lustre/smfs/symlink.c

index f6be984..3741213 100644 (file)
@@ -4,7 +4,7 @@
                if (ext3_should_order_data(inode))
                        err = ext3_journal_dirty_data(handle, bh, 0);
                __mark_buffer_dirty(bh);
-+                buffer_insert_inode_data_queue(bh, inode);
++              buffer_insert_inode_data_queue(bh, inode);
        }
  
  unlock:
index 72c68f4..f590852 100644 (file)
 static int smfs_readlink(struct dentry * dentry, char * buffer, int buflen)
 {
        struct inode *cache_inode = I2CI(dentry->d_inode);
-       int rc = 0;
+       struct dentry cache_dentry;
+       int    rc = 0;
 
+       if (!cache_inode)
+               RETURN(-ENOENT);
+       
+       smfs_prepare_dentry(&cache_dentry, NULL, &dentry->d_name);
+       d_add(&cache_dentry, cache_inode);
+               
        if (cache_inode->i_op && cache_inode->i_op->readlink)   
-               rc = cache_inode->i_op->readlink(dentry, buffer, buflen);
+               rc = cache_inode->i_op->readlink(&cache_dentry, buffer, buflen);
        
+       smfs_clear_dentry(&cache_dentry);
        return rc;
 }
 
 static int smfs_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
        struct inode *cache_inode = I2CI(dentry->d_inode);
+       struct dentry cache_dentry;
        int rc = 0;
+       if (!cache_inode)
+               RETURN(-ENOENT);
+       
+       smfs_prepare_dentry(&cache_dentry, NULL, &dentry->d_name);
+       d_add(&cache_dentry, cache_inode);
 
        if (cache_inode->i_op && cache_inode->i_op->follow_link)        
-               rc = cache_inode->i_op->follow_link(dentry, nd);
+               rc = cache_inode->i_op->follow_link(&cache_dentry, nd);
        
+       smfs_clear_dentry(&cache_dentry);
        return rc;
 
 }
 struct inode_operations smfs_sym_iops = {
        readlink:       smfs_readlink,
        follow_link:    smfs_follow_link,
+       setxattr:       smfs_setxattr,          /* BKL held */
+        getxattr:       smfs_getxattr,          /* BKL held */
+        listxattr:      smfs_listxattr,         /* BKL held */
+        removexattr:    smfs_removexattr,       /* BKL held */
 };
 
 struct file_operations smfs_sym_fops = {