patch-2.4.0-test3 linux/fs/stat.c
Next file: linux/fs/super.c
Previous file: linux/fs/smbfs/inode.c
Back to the patch index
Back to the overall index
- Lines: 182
- Date:
Sun Jul 9 22:21:41 2000
- Orig file:
v2.4.0-test2/linux/fs/stat.c
- Orig date:
Thu May 11 15:30:08 2000
diff -u --recursive --new-file v2.4.0-test2/linux/fs/stat.c linux/fs/stat.c
@@ -36,10 +36,13 @@
static int warncount = 5;
struct __old_kernel_stat tmp;
- if (warncount) {
+ if (warncount > 0) {
warncount--;
printk("VFS: Warning: %s using old stat() call. Recompile your binary.\n",
current->comm);
+ } else if (warncount < 0) {
+ /* it's laughable, but... */
+ warncount = 0;
}
tmp.st_dev = kdev_t_to_nr(inode->i_dev);
@@ -125,7 +128,6 @@
struct nameidata nd;
int error;
- lock_kernel();
error = user_path_walk(filename, &nd);
if (!error) {
error = do_revalidate(nd.dentry);
@@ -133,7 +135,6 @@
error = cp_old_stat(nd.dentry->d_inode, statbuf);
path_release(&nd);
}
- unlock_kernel();
return error;
}
#endif
@@ -143,7 +144,6 @@
struct nameidata nd;
int error;
- lock_kernel();
error = user_path_walk(filename, &nd);
if (!error) {
error = do_revalidate(nd.dentry);
@@ -151,7 +151,6 @@
error = cp_new_stat(nd.dentry->d_inode, statbuf);
path_release(&nd);
}
- unlock_kernel();
return error;
}
@@ -166,7 +165,6 @@
struct nameidata nd;
int error;
- lock_kernel();
error = user_path_walk_link(filename, &nd);
if (!error) {
error = do_revalidate(nd.dentry);
@@ -174,7 +172,6 @@
error = cp_old_stat(nd.dentry->d_inode, statbuf);
path_release(&nd);
}
- unlock_kernel();
return error;
}
@@ -185,7 +182,6 @@
struct nameidata nd;
int error;
- lock_kernel();
error = user_path_walk_link(filename, &nd);
if (!error) {
error = do_revalidate(nd.dentry);
@@ -193,7 +189,6 @@
error = cp_new_stat(nd.dentry->d_inode, statbuf);
path_release(&nd);
}
- unlock_kernel();
return error;
}
@@ -208,7 +203,6 @@
struct file * f;
int err = -EBADF;
- lock_kernel();
f = fget(fd);
if (f) {
struct dentry * dentry = f->f_dentry;
@@ -218,7 +212,6 @@
err = cp_old_stat(dentry->d_inode, statbuf);
fput(f);
}
- unlock_kernel();
return err;
}
@@ -229,7 +222,6 @@
struct file * f;
int err = -EBADF;
- lock_kernel();
f = fget(fd);
if (f) {
struct dentry * dentry = f->f_dentry;
@@ -239,7 +231,6 @@
err = cp_new_stat(dentry->d_inode, statbuf);
fput(f);
}
- unlock_kernel();
return err;
}
@@ -251,7 +242,6 @@
if (bufsiz <= 0)
return -EINVAL;
- lock_kernel();
error = user_path_walk_link(path, &nd);
if (!error) {
struct inode * inode = nd.dentry->d_inode;
@@ -264,13 +254,12 @@
}
path_release(&nd);
}
- unlock_kernel();
return error;
}
/* ---------- LFS-64 ----------- */
-#if !defined(__alpha__) && !defined(__ia64__)
+#if !defined(__alpha__) && !defined (__ia64__) && !defined(__mips64)
static long cp_new_stat64(struct inode * inode, struct stat64 * statbuf)
{
@@ -333,7 +322,6 @@
struct nameidata nd;
int error;
- lock_kernel();
error = user_path_walk(filename, &nd);
if (!error) {
error = do_revalidate(nd.dentry);
@@ -341,7 +329,6 @@
error = cp_new_stat64(nd.dentry->d_inode, statbuf);
path_release(&nd);
}
- unlock_kernel();
return error;
}
@@ -350,7 +337,6 @@
struct nameidata nd;
int error;
- lock_kernel();
error = user_path_walk_link(filename, &nd);
if (!error) {
error = do_revalidate(nd.dentry);
@@ -358,7 +344,6 @@
error = cp_new_stat64(nd.dentry->d_inode, statbuf);
path_release(&nd);
}
- unlock_kernel();
return error;
}
@@ -367,7 +352,6 @@
struct file * f;
int err = -EBADF;
- lock_kernel();
f = fget(fd);
if (f) {
struct dentry * dentry = f->f_dentry;
@@ -377,7 +361,6 @@
err = cp_new_stat64(dentry->d_inode, statbuf);
fput(f);
}
- unlock_kernel();
return err;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)