patch-2.3.1 linux/arch/sparc64/solaris/fs.c

Next file: linux/arch/sparc64/solaris/timod.c
Previous file: linux/arch/sparc64/mm/asyncd.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.0/linux/arch/sparc64/solaris/fs.c linux/arch/sparc64/solaris/fs.c
@@ -410,7 +410,11 @@
 	mm_segment_t old_fs = get_fs();
 	int error;
 	struct sol_statvfs *ss = (struct sol_statvfs *)A(buf);
-			
+
+	if (!inode->i_sb)
+		return -ENODEV;
+	if (!inode->i_sb->s_op->statfs)
+		return -ENOSYS;
 	set_fs (KERNEL_DS);
 	error = inode->i_sb->s_op->statfs(inode->i_sb, &s, sizeof(struct statfs));
 	set_fs (old_fs);
@@ -448,6 +452,10 @@
 	int error;
 	struct sol_statvfs64 *ss = (struct sol_statvfs64 *)A(buf);
 			
+	if (!inode->i_sb)
+		return -ENODEV;
+	if (!inode->i_sb->s_op->statfs)
+		return -ENOSYS;
 	set_fs (KERNEL_DS);
 	error = inode->i_sb->s_op->statfs(inode->i_sb, &s, sizeof(struct statfs));
 	set_fs (old_fs);
@@ -489,9 +497,7 @@
 	if (!IS_ERR(dentry)) {
 		struct inode * inode = dentry->d_inode;
 
-		error = -ENOSYS;
-		if (inode->i_sb->s_op->statfs)
-			error = report_statvfs(inode, buf);
+		error = report_statvfs(inode, buf);
 		dput(dentry);
 	}
 	unlock_kernel();
@@ -515,10 +521,6 @@
 		error = -ENOENT;
 	else if (!(inode = dentry->d_inode))
 		error = -ENOENT;
-	else if (!inode->i_sb)
-		error = -ENODEV;
-	else if (!inode->i_sb->s_op->statfs)
-		error = -ENOSYS;
 	else
 		error = report_statvfs(inode, buf);
 	fput(file);
@@ -538,9 +540,7 @@
 	if (!IS_ERR(dentry)) {
 		struct inode * inode = dentry->d_inode;
 
-		error = -ENOSYS;
-		if (inode->i_sb->s_op->statfs)
-			error = report_statvfs64(inode, buf);
+		error = report_statvfs64(inode, buf);
 		dput(dentry);
 	}
 	unlock_kernel();
@@ -564,10 +564,6 @@
 		error = -ENOENT;
 	else if (!(inode = dentry->d_inode))
 		error = -ENOENT;
-	else if (!inode->i_sb)
-		error = -ENODEV;
-	else if (!inode->i_sb->s_op->statfs)
-		error = -ENOSYS;
 	else
 		error = report_statvfs64(inode, buf);
 	fput(file);

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