patch-2.2.8 linux/fs/minix/namei.c

Next file: linux/fs/namei.c
Previous file: linux/fs/locks.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.7/linux/fs/minix/namei.c linux/fs/minix/namei.c
@@ -45,7 +45,7 @@
 	struct minix_dir_entry *de;
 
 	*res_dir = NULL;
-	if (!dir || !dir->i_sb)
+	if (!dir->i_sb)
 		return NULL;
 	info = &dir->i_sb->u.minix_sb;
 	if (namelen > info->s_namelen) {
@@ -249,12 +249,6 @@
 	struct buffer_head * bh;
 	struct minix_dir_entry * de;
 
-	bh = minix_find_entry(dir, dentry->d_name.name,
-			      dentry->d_name.len, &de);
-	if (bh) {
-		brelse(bh);
-		return -EEXIST;
-	}
 	inode = minix_new_inode(dir);
 	if (!inode)
 		return -ENOSPC;
@@ -295,12 +289,6 @@
 	struct minix_sb_info * info;
 
 	info = &dir->i_sb->u.minix_sb;
-	bh = minix_find_entry(dir, dentry->d_name.name,
-			      dentry->d_name.len, &de);
-	if (bh) {
-		brelse(bh);
-		return -EEXIST;
-	}
 	if (dir->i_nlink >= info->s_link_max)
 		return -EMLINK;
 	inode = minix_new_inode(dir);
@@ -524,15 +512,6 @@
 	brelse(name_block);
 	inode->i_size = i;
 	mark_inode_dirty(inode);
-	bh = minix_find_entry(dir, dentry->d_name.name,
-			      dentry->d_name.len, &de);
-	if (bh) {
-		inode->i_nlink--;
-		mark_inode_dirty(inode);
-		iput(inode);
-		brelse(bh);
-		return -EEXIST;
-	}
 	i = minix_add_entry(dir, dentry->d_name.name,
 			    dentry->d_name.len, &bh, &de);
 	if (i) {
@@ -562,12 +541,6 @@
 	if (inode->i_nlink >= inode->i_sb->u.minix_sb.s_link_max)
 		return -EMLINK;
 
-	bh = minix_find_entry(dir, dentry->d_name.name,
-			      dentry->d_name.len, &de);
-	if (bh) {
-		brelse(bh);
-		return -EEXIST;
-	}
 	error = minix_add_entry(dir, dentry->d_name.name,
 				dentry->d_name.len, &bh, &de);
 	if (error) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)