V4L/DVB (7156): em28xx/em28xx-core.c: fix use of potentially uninitialized variable
[sfrench/cifs-2.6.git] / fs / stat.c
index bca07eb2003c395b8e40d33cfe3ce548065d9ff7..9cf41f719d50d18adf2fca7a6582b0ecfdc506aa 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -8,7 +8,6 @@
 #include <linux/mm.h>
 #include <linux/errno.h>
 #include <linux/file.h>
-#include <linux/smp_lock.h>
 #include <linux/highuid.h>
 #include <linux/fs.h>
 #include <linux/namei.h>
@@ -51,13 +50,6 @@ int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
                return inode->i_op->getattr(mnt, dentry, stat);
 
        generic_fillattr(inode, stat);
-       if (!stat->blksize) {
-               struct super_block *s = inode->i_sb;
-               unsigned blocks;
-               blocks = (stat->size+s->s_blocksize-1) >> s->s_blocksize_bits;
-               stat->blocks = (s->s_blocksize / 512) * blocks;
-               stat->blksize = s->s_blocksize;
-       }
        return 0;
 }
 
@@ -70,8 +62,8 @@ int vfs_stat_fd(int dfd, char __user *name, struct kstat *stat)
 
        error = __user_walk_fd(dfd, name, LOOKUP_FOLLOW, &nd);
        if (!error) {
-               error = vfs_getattr(nd.mnt, nd.dentry, stat);
-               path_release(&nd);
+               error = vfs_getattr(nd.path.mnt, nd.path.dentry, stat);
+               path_put(&nd.path);
        }
        return error;
 }
@@ -90,8 +82,8 @@ int vfs_lstat_fd(int dfd, char __user *name, struct kstat *stat)
 
        error = __user_walk_fd(dfd, name, 0, &nd);
        if (!error) {
-               error = vfs_getattr(nd.mnt, nd.dentry, stat);
-               path_release(&nd);
+               error = vfs_getattr(nd.path.mnt, nd.path.dentry, stat);
+               path_put(&nd.path);
        }
        return error;
 }
@@ -109,7 +101,7 @@ int vfs_fstat(unsigned int fd, struct kstat *stat)
        int error = -EBADF;
 
        if (f) {
-               error = vfs_getattr(f->f_vfsmnt, f->f_dentry, stat);
+               error = vfs_getattr(f->f_path.mnt, f->f_path.dentry, stat);
                fput(f);
        }
        return error;
@@ -310,17 +302,18 @@ asmlinkage long sys_readlinkat(int dfd, const char __user *path,
 
        error = __user_walk_fd(dfd, path, 0, &nd);
        if (!error) {
-               struct inode * inode = nd.dentry->d_inode;
+               struct inode *inode = nd.path.dentry->d_inode;
 
                error = -EINVAL;
                if (inode->i_op && inode->i_op->readlink) {
-                       error = security_inode_readlink(nd.dentry);
+                       error = security_inode_readlink(nd.path.dentry);
                        if (!error) {
-                               touch_atime(nd.mnt, nd.dentry);
-                               error = inode->i_op->readlink(nd.dentry, buf, bufsiz);
+                               touch_atime(nd.path.mnt, nd.path.dentry);
+                               error = inode->i_op->readlink(nd.path.dentry,
+                                                             buf, bufsiz);
                        }
                }
-               path_release(&nd);
+               path_put(&nd.path);
        }
        return error;
 }