diff options
Diffstat (limited to 'fs/stat.c')
-rw-r--r-- | fs/stat.c | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -51,13 +51,6 @@ int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | |||
51 | return inode->i_op->getattr(mnt, dentry, stat); | 51 | return inode->i_op->getattr(mnt, dentry, stat); |
52 | 52 | ||
53 | generic_fillattr(inode, stat); | 53 | generic_fillattr(inode, stat); |
54 | if (!stat->blksize) { | ||
55 | struct super_block *s = inode->i_sb; | ||
56 | unsigned blocks; | ||
57 | blocks = (stat->size+s->s_blocksize-1) >> s->s_blocksize_bits; | ||
58 | stat->blocks = (s->s_blocksize / 512) * blocks; | ||
59 | stat->blksize = s->s_blocksize; | ||
60 | } | ||
61 | return 0; | 54 | return 0; |
62 | } | 55 | } |
63 | 56 | ||
@@ -109,7 +102,7 @@ int vfs_fstat(unsigned int fd, struct kstat *stat) | |||
109 | int error = -EBADF; | 102 | int error = -EBADF; |
110 | 103 | ||
111 | if (f) { | 104 | if (f) { |
112 | error = vfs_getattr(f->f_vfsmnt, f->f_dentry, stat); | 105 | error = vfs_getattr(f->f_path.mnt, f->f_path.dentry, stat); |
113 | fput(f); | 106 | fput(f); |
114 | } | 107 | } |
115 | return error; | 108 | return error; |