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

Next file: linux/fs/minix/truncate.c
Previous file: linux/fs/minix/bitmap.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.12/linux/fs/minix/namei.c linux/fs/minix/namei.c
@@ -11,6 +11,7 @@
 #include <linux/stat.h>
 #include <linux/fcntl.h>
 #include <linux/errno.h>
+#include <linux/quotaops.h>
 
 #include <asm/uaccess.h>
 
@@ -212,7 +213,9 @@
 	struct buffer_head * bh;
 	struct minix_dir_entry * de;
 
-	inode = minix_new_inode(dir);
+	inode = minix_new_inode(dir, &error);
+	if (error)
+		return error;
 	if (!inode)
 		return -ENOSPC;
 	inode->i_op = &minix_file_inode_operations;
@@ -240,7 +243,9 @@
 	struct buffer_head * bh;
 	struct minix_dir_entry * de;
 
-	inode = minix_new_inode(dir);
+	inode = minix_new_inode(dir, &error);
+	if (error)
+		return error;
 	if (!inode)
 		return -ENOSPC;
 	inode->i_uid = current->fsuid;
@@ -271,7 +276,9 @@
 	info = &dir->i_sb->u.minix_sb;
 	if (dir->i_nlink >= info->s_link_max)
 		return -EMLINK;
-	inode = minix_new_inode(dir);
+	inode = minix_new_inode(dir, &error);
+	if (error)
+		return error;
 	if (!inode)
 		return -ENOSPC;
 	inode->i_op = &minix_dir_inode_operations;
@@ -383,6 +390,7 @@
 	if (!bh)
 		goto end_rmdir;
 	inode = dentry->d_inode;
+	DQUOT_INIT(inode);
 
 	if (!empty_dir(inode)) {
 		retval = -ENOTEMPTY;
@@ -422,6 +430,7 @@
 
 	retval = -ENOENT;
 	inode = dentry->d_inode;
+	DQUOT_INIT(inode);
 	bh = minix_find_entry(dir, dentry->d_name.name,
 			      dentry->d_name.len, &de);
 	if (!bh || de->inode != inode->i_ino)
@@ -456,7 +465,10 @@
 	int i;
 	char c;
 
-	if (!(inode = minix_new_inode(dir)))
+	inode = minix_new_inode(dir, &i);
+	if (i)
+		return i;
+	if (!inode)
 		return -ENOSPC;
 
 	inode->i_mode = S_IFLNK | 0777;
@@ -554,6 +566,8 @@
 		if (!new_inode) {
 			brelse(new_bh);
 			new_bh = NULL;
+		} else {
+			DQUOT_INIT(new_inode);
 		}
 	}
 	if (S_ISDIR(old_inode->i_mode)) {

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