patch-2.3.51 linux/arch/mips/kernel/sysirix.c

Next file: linux/arch/mips64/config.in
Previous file: linux/arch/mips/defconfig-ip22
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.50/linux/arch/mips/kernel/sysirix.c linux/arch/mips/kernel/sysirix.c
@@ -725,8 +725,6 @@
 			   int len, int fs_type)
 {
 	struct dentry *dentry;
-	struct inode *inode;
-	mm_segment_t old_fs;
 	struct statfs kbuf;
 	int error, i;
 
@@ -745,11 +743,7 @@
 	if (IS_ERR(dentry))
 		goto out;
 
-	inode = dentry->d_inode;
-	old_fs = get_fs(); set_fs(get_ds());
-	error = inode->i_sb->s_op->statfs(inode->i_sb, &kbuf,
-	                                  sizeof(struct statfs));
-	set_fs(old_fs);
+	error = vfs_statfs(dentry->d_inode->i_sb, &kbuf);
 	if (error)
 		goto dput_and_out;
 
@@ -775,9 +769,7 @@
 
 asmlinkage int irix_fstatfs(unsigned int fd, struct irix_statfs *buf)
 {
-	struct inode *inode;
 	struct statfs kbuf;
-	mm_segment_t old_fs;
 	struct file *file;
 	int error, i;
 
@@ -790,23 +782,7 @@
 		goto out;
 	}
 
-	if (!(inode = file->f_dentry->d_inode)) {
-		error = -ENOENT;
-		goto out_f;
-	}
-	if (!inode->i_sb) {
-		error = -ENODEV;
-		goto out_f;
-	}
-	if (!inode->i_sb->s_op->statfs) {
-		error = -ENOSYS;
-		goto out_f;
-	}
-
-	old_fs = get_fs(); set_fs(get_ds());
-	error = inode->i_sb->s_op->statfs(inode->i_sb, &kbuf,
-	                                  sizeof(struct statfs));
-	set_fs(old_fs);
+	error = vfs_statfs(file->f_dentry->d_inode->i_sb, &kbuf);
 	if (error)
 		goto out_f;
 
@@ -1509,8 +1485,6 @@
 asmlinkage int irix_statvfs(char *fname, struct irix_statvfs *buf)
 {
 	struct dentry *dentry;
-	struct inode *inode;
-	mm_segment_t old_fs;
 	struct statfs kbuf;
 	int error, i;
 
@@ -1524,16 +1498,7 @@
 	error = PTR_ERR(dentry);
 	if(!IS_ERR(dentry))
 		goto out;
-	inode = dentry->d_inode;
-
-	error = -ENOSYS;
-	if(!inode->i_sb->s_op->statfs)
-		goto dput_and_out;
-
-	old_fs = get_fs(); set_fs(get_ds());
-	error = inode->i_sb->s_op->statfs(inode->i_sb, &kbuf,
-	                                  sizeof(struct statfs));
-	set_fs(old_fs);
+	error = vfs_statfs(dentry->d_inode->i_sb, &kbuf);
 	if (error)
 		goto dput_and_out;
 
@@ -1568,8 +1533,6 @@
 
 asmlinkage int irix_fstatvfs(int fd, struct irix_statvfs *buf)
 {
-	struct inode *inode;
-	mm_segment_t old_fs;
 	struct statfs kbuf;
 	struct file *file;
 	int error, i;
@@ -1585,23 +1548,7 @@
 		error = -EBADF;
 		goto out;
 	}
-	if (!(inode = file->f_dentry->d_inode)) {
-		error = -ENOENT;
-		goto out_f;
-	}
-	if (!inode->i_sb) {
-		error = -ENODEV;
-		goto out_f;
-	}
-	if (!inode->i_sb->s_op->statfs) {
-		error = -ENOSYS;
-		goto out_f;
-	}
-
-	old_fs = get_fs(); set_fs(get_ds());
-	error = inode->i_sb->s_op->statfs(inode->i_sb, &kbuf,
-	                                  sizeof(struct statfs));
-	set_fs(old_fs);
+	error = vfs_statfs(file->f_dentry->d_inode->i_sb, &kbuf);
 	if (error)
 		goto out_f;
 
@@ -1813,8 +1760,6 @@
 asmlinkage int irix_statvfs64(char *fname, struct irix_statvfs64 *buf)
 {
 	struct dentry *dentry;
-	struct inode *inode;
-	mm_segment_t old_fs;
 	struct statfs kbuf;
 	int error, i;
 
@@ -1828,15 +1773,7 @@
 	error = PTR_ERR(dentry);
 	if(IS_ERR(dentry))
 		goto out;
-	error = -ENOSYS;
-	inode = dentry->d_inode;
-	if(!inode->i_sb->s_op->statfs)
-		goto dput_and_out;
-
-	old_fs = get_fs(); set_fs(get_ds());
-	error = inode->i_sb->s_op->statfs(inode->i_sb, &kbuf,
-	                                  sizeof(struct statfs));
-	set_fs(old_fs);
+	error = vfs_statfs(dentry->d_inode->i_sb, &kbuf);
 	if (error)
 		goto dput_and_out;
 
@@ -1871,8 +1808,6 @@
 
 asmlinkage int irix_fstatvfs64(int fd, struct irix_statvfs *buf)
 {
-	struct inode *inode;
-	mm_segment_t old_fs;
 	struct statfs kbuf;
 	struct file *file;
 	int error, i;
@@ -1888,23 +1823,7 @@
 		error = -EBADF;
 		goto out;
 	}
-	if (!(inode = file->f_dentry->d_inode)) {
-		error = -ENOENT;
-		goto out_f;
-	}
-	if (!inode->i_sb) {
-		error = -ENODEV;
-		goto out_f;
-	}
-	if (!inode->i_sb->s_op->statfs) {
-		error = -ENOSYS;
-		goto out_f;
-	}
-
-	old_fs = get_fs(); set_fs(get_ds());
-	error = inode->i_sb->s_op->statfs(inode->i_sb, &kbuf,
-	                                  sizeof(struct statfs));
-	set_fs(old_fs);
+	error = vfs_statfs(file->f_dentry->d_inode->i_sb, &kbuf);
 	if (error)
 		goto out_f;
 

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