diff options
Diffstat (limited to 'fs/hostfs')
-rw-r--r-- | fs/hostfs/hostfs.h | 10 | ||||
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 10 | ||||
-rw-r--r-- | fs/hostfs/hostfs_user.c | 14 |
3 files changed, 11 insertions, 23 deletions
diff --git a/fs/hostfs/hostfs.h b/fs/hostfs/hostfs.h index 6bbd75c5589b..bf15a43016b9 100644 --- a/fs/hostfs/hostfs.h +++ b/fs/hostfs/hostfs.h | |||
@@ -28,12 +28,7 @@ | |||
28 | * #define ATTR_KILL_SUID 2048 | 28 | * #define ATTR_KILL_SUID 2048 |
29 | * #define ATTR_KILL_SGID 4096 | 29 | * #define ATTR_KILL_SGID 4096 |
30 | * | 30 | * |
31 | * and this is because they were added in 2.5 development in this patch: | 31 | * and this is because they were added in 2.5 development. |
32 | * | ||
33 | * http://linux.bkbits.net:8080/linux-2.5/ | ||
34 | * cset@3caf4a12k4XgDzK7wyK-TGpSZ9u2Ww?nav=index.html | ||
35 | * |src/.|src/include|src/include/linux|related/include/linux/fs.h | ||
36 | * | ||
37 | * Actually, they are not needed by most ->setattr() methods - they are set by | 32 | * Actually, they are not needed by most ->setattr() methods - they are set by |
38 | * callers of notify_change() to notify that the setuid/setgid bits must be | 33 | * callers of notify_change() to notify that the setuid/setgid bits must be |
39 | * dropped. | 34 | * dropped. |
@@ -96,7 +91,6 @@ extern int rename_file(char *from, char *to); | |||
96 | extern int do_statfs(char *root, long *bsize_out, long long *blocks_out, | 91 | extern int do_statfs(char *root, long *bsize_out, long long *blocks_out, |
97 | long long *bfree_out, long long *bavail_out, | 92 | long long *bfree_out, long long *bavail_out, |
98 | long long *files_out, long long *ffree_out, | 93 | long long *files_out, long long *ffree_out, |
99 | void *fsid_out, int fsid_size, long *namelen_out, | 94 | void *fsid_out, int fsid_size, long *namelen_out); |
100 | long *spare_out); | ||
101 | 95 | ||
102 | #endif | 96 | #endif |
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index f7dc9b5f9ef8..2c0f148a49e6 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -217,7 +217,7 @@ int hostfs_statfs(struct dentry *dentry, struct kstatfs *sf) | |||
217 | err = do_statfs(dentry->d_sb->s_fs_info, | 217 | err = do_statfs(dentry->d_sb->s_fs_info, |
218 | &sf->f_bsize, &f_blocks, &f_bfree, &f_bavail, &f_files, | 218 | &sf->f_bsize, &f_blocks, &f_bfree, &f_bavail, &f_files, |
219 | &f_ffree, &sf->f_fsid, sizeof(sf->f_fsid), | 219 | &f_ffree, &sf->f_fsid, sizeof(sf->f_fsid), |
220 | &sf->f_namelen, sf->f_spare); | 220 | &sf->f_namelen); |
221 | if (err) | 221 | if (err) |
222 | return err; | 222 | return err; |
223 | sf->f_blocks = f_blocks; | 223 | sf->f_blocks = f_blocks; |
@@ -962,11 +962,11 @@ out: | |||
962 | return err; | 962 | return err; |
963 | } | 963 | } |
964 | 964 | ||
965 | static int hostfs_read_sb(struct file_system_type *type, | 965 | static struct dentry *hostfs_read_sb(struct file_system_type *type, |
966 | int flags, const char *dev_name, | 966 | int flags, const char *dev_name, |
967 | void *data, struct vfsmount *mnt) | 967 | void *data) |
968 | { | 968 | { |
969 | return get_sb_nodev(type, flags, data, hostfs_fill_sb_common, mnt); | 969 | return mount_nodev(type, flags, data, hostfs_fill_sb_common); |
970 | } | 970 | } |
971 | 971 | ||
972 | static void hostfs_kill_sb(struct super_block *s) | 972 | static void hostfs_kill_sb(struct super_block *s) |
@@ -978,7 +978,7 @@ static void hostfs_kill_sb(struct super_block *s) | |||
978 | static struct file_system_type hostfs_type = { | 978 | static struct file_system_type hostfs_type = { |
979 | .owner = THIS_MODULE, | 979 | .owner = THIS_MODULE, |
980 | .name = "hostfs", | 980 | .name = "hostfs", |
981 | .get_sb = hostfs_read_sb, | 981 | .mount = hostfs_read_sb, |
982 | .kill_sb = hostfs_kill_sb, | 982 | .kill_sb = hostfs_kill_sb, |
983 | .fs_flags = 0, | 983 | .fs_flags = 0, |
984 | }; | 984 | }; |
diff --git a/fs/hostfs/hostfs_user.c b/fs/hostfs/hostfs_user.c index 6777aa06ce2c..d51a98384bc0 100644 --- a/fs/hostfs/hostfs_user.c +++ b/fs/hostfs/hostfs_user.c | |||
@@ -94,8 +94,7 @@ void *open_dir(char *path, int *err_out) | |||
94 | 94 | ||
95 | dir = opendir(path); | 95 | dir = opendir(path); |
96 | *err_out = errno; | 96 | *err_out = errno; |
97 | if (dir == NULL) | 97 | |
98 | return NULL; | ||
99 | return dir; | 98 | return dir; |
100 | } | 99 | } |
101 | 100 | ||
@@ -205,7 +204,7 @@ int set_attr(const char *file, struct hostfs_iattr *attrs, int fd) | |||
205 | if (attrs->ia_valid & HOSTFS_ATTR_MODE) { | 204 | if (attrs->ia_valid & HOSTFS_ATTR_MODE) { |
206 | if (fd >= 0) { | 205 | if (fd >= 0) { |
207 | if (fchmod(fd, attrs->ia_mode) != 0) | 206 | if (fchmod(fd, attrs->ia_mode) != 0) |
208 | return (-errno); | 207 | return -errno; |
209 | } else if (chmod(file, attrs->ia_mode) != 0) { | 208 | } else if (chmod(file, attrs->ia_mode) != 0) { |
210 | return -errno; | 209 | return -errno; |
211 | } | 210 | } |
@@ -364,8 +363,7 @@ int rename_file(char *from, char *to) | |||
364 | int do_statfs(char *root, long *bsize_out, long long *blocks_out, | 363 | int do_statfs(char *root, long *bsize_out, long long *blocks_out, |
365 | long long *bfree_out, long long *bavail_out, | 364 | long long *bfree_out, long long *bavail_out, |
366 | long long *files_out, long long *ffree_out, | 365 | long long *files_out, long long *ffree_out, |
367 | void *fsid_out, int fsid_size, long *namelen_out, | 366 | void *fsid_out, int fsid_size, long *namelen_out) |
368 | long *spare_out) | ||
369 | { | 367 | { |
370 | struct statfs64 buf; | 368 | struct statfs64 buf; |
371 | int err; | 369 | int err; |
@@ -384,10 +382,6 @@ int do_statfs(char *root, long *bsize_out, long long *blocks_out, | |||
384 | sizeof(buf.f_fsid) > fsid_size ? fsid_size : | 382 | sizeof(buf.f_fsid) > fsid_size ? fsid_size : |
385 | sizeof(buf.f_fsid)); | 383 | sizeof(buf.f_fsid)); |
386 | *namelen_out = buf.f_namelen; | 384 | *namelen_out = buf.f_namelen; |
387 | spare_out[0] = buf.f_spare[0]; | 385 | |
388 | spare_out[1] = buf.f_spare[1]; | ||
389 | spare_out[2] = buf.f_spare[2]; | ||
390 | spare_out[3] = buf.f_spare[3]; | ||
391 | spare_out[4] = buf.f_spare[4]; | ||
392 | return 0; | 386 | return 0; |
393 | } | 387 | } |