patch-2.1.90 linux/fs/hfs/dir_nat.c

Next file: linux/fs/hfs/file.c
Previous file: linux/fs/hfs/dir_dbl.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.89/linux/fs/hfs/dir_nat.c linux/fs/hfs/dir_nat.c
@@ -142,9 +142,10 @@
 	struct inode *inode = NULL;
 
 	if (!dir || !S_ISDIR(dir->i_mode)) {
-		goto done;
+		return -ENOENT;
 	}
 
+	dentry->d_op = &hfs_dentry_operations;
 	entry = HFS_I(dir)->entry;
 	dtype = HFS_ITYPE(dir->i_ino);
 
@@ -200,12 +201,11 @@
 	if (inode && (dtype == HFS_NAT_HDIR) &&
 	    (HFS_I(inode)->entry != entry) &&
 	    (HFS_I(inode)->entry->type == HFS_CDR_DIR)) {
-	        iput(inode);
+	        iput(inode); /* this does an hfs_cat_put */
 		inode = NULL;
 	}
 
 done:
-	dentry->d_op = &hfs_dentry_operations;
 	d_add(dentry, inode);
 	return 0;
 }
@@ -241,7 +241,7 @@
 		return -EBADF;
 	}
 
-        entry = HFS_I(dir)->entry;
+	entry = HFS_I(dir)->entry;
 	type = HFS_ITYPE(dir->i_ino);
 	skip_dirs = (type == HFS_NAT_HDIR);
 
@@ -329,7 +329,7 @@
  * related calls (create, rename, and mknod). the directory calls
  * should be immune. the relevant calls in dir.c call drop_dentry 
  * upon successful completion. */
-void hfs_nat_drop_dentry(const ino_t type, struct dentry *dentry)
+void hfs_nat_drop_dentry(struct dentry *dentry, const ino_t type)
 {
   struct dentry *de;
   

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov