aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ncpfs/inode.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2008-02-08 07:21:46 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:40 -0500
commit564cd138cb30658c12e80c33582bf50816ec7a41 (patch)
tree71e8c52e0c41210b3f9091e6dd6bfb828088b1e5 /fs/ncpfs/inode.c
parentd0132eea7a295623e34e26b0977638cc0f62a2c6 (diff)
mount options: fix ncpfs
Add a .show_options super operation to ncpfs. Small fix: add FS_BINARY_MOUNTDATA to the filesystem type flags, since it can take binary data, as well as text (similarly to NFS). Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ncpfs/inode.c')
-rw-r--r--fs/ncpfs/inode.c49
1 files changed, 45 insertions, 4 deletions
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index eff1f18d034f..fbbb9f7afa1a 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -28,6 +28,8 @@
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/smp_lock.h> 29#include <linux/smp_lock.h>
30#include <linux/vfs.h> 30#include <linux/vfs.h>
31#include <linux/mount.h>
32#include <linux/seq_file.h>
31 33
32#include <linux/ncp_fs.h> 34#include <linux/ncp_fs.h>
33 35
@@ -36,9 +38,15 @@
36#include "ncplib_kernel.h" 38#include "ncplib_kernel.h"
37#include "getopt.h" 39#include "getopt.h"
38 40
41#define NCP_DEFAULT_FILE_MODE 0600
42#define NCP_DEFAULT_DIR_MODE 0700
43#define NCP_DEFAULT_TIME_OUT 10
44#define NCP_DEFAULT_RETRY_COUNT 20
45
39static void ncp_delete_inode(struct inode *); 46static void ncp_delete_inode(struct inode *);
40static void ncp_put_super(struct super_block *); 47static void ncp_put_super(struct super_block *);
41static int ncp_statfs(struct dentry *, struct kstatfs *); 48static int ncp_statfs(struct dentry *, struct kstatfs *);
49static int ncp_show_options(struct seq_file *, struct vfsmount *);
42 50
43static struct kmem_cache * ncp_inode_cachep; 51static struct kmem_cache * ncp_inode_cachep;
44 52
@@ -96,6 +104,7 @@ static const struct super_operations ncp_sops =
96 .put_super = ncp_put_super, 104 .put_super = ncp_put_super,
97 .statfs = ncp_statfs, 105 .statfs = ncp_statfs,
98 .remount_fs = ncp_remount, 106 .remount_fs = ncp_remount,
107 .show_options = ncp_show_options,
99}; 108};
100 109
101extern struct dentry_operations ncp_root_dentry_operations; 110extern struct dentry_operations ncp_root_dentry_operations;
@@ -304,6 +313,37 @@ static void ncp_stop_tasks(struct ncp_server *server) {
304 flush_scheduled_work(); 313 flush_scheduled_work();
305} 314}
306 315
316static int ncp_show_options(struct seq_file *seq, struct vfsmount *mnt)
317{
318 struct ncp_server *server = NCP_SBP(mnt->mnt_sb);
319 unsigned int tmp;
320
321 if (server->m.uid != 0)
322 seq_printf(seq, ",uid=%u", server->m.uid);
323 if (server->m.gid != 0)
324 seq_printf(seq, ",gid=%u", server->m.gid);
325 if (server->m.mounted_uid != 0)
326 seq_printf(seq, ",owner=%u", server->m.mounted_uid);
327 tmp = server->m.file_mode & S_IALLUGO;
328 if (tmp != NCP_DEFAULT_FILE_MODE)
329 seq_printf(seq, ",mode=0%o", tmp);
330 tmp = server->m.dir_mode & S_IALLUGO;
331 if (tmp != NCP_DEFAULT_DIR_MODE)
332 seq_printf(seq, ",dirmode=0%o", tmp);
333 if (server->m.time_out != NCP_DEFAULT_TIME_OUT * HZ / 100) {
334 tmp = server->m.time_out * 100 / HZ;
335 seq_printf(seq, ",timeout=%u", tmp);
336 }
337 if (server->m.retry_count != NCP_DEFAULT_RETRY_COUNT)
338 seq_printf(seq, ",retry=%u", server->m.retry_count);
339 if (server->m.flags != 0)
340 seq_printf(seq, ",flags=%lu", server->m.flags);
341 if (server->m.wdog_pid != NULL)
342 seq_printf(seq, ",wdogpid=%u", pid_vnr(server->m.wdog_pid));
343
344 return 0;
345}
346
307static const struct ncp_option ncp_opts[] = { 347static const struct ncp_option ncp_opts[] = {
308 { "uid", OPT_INT, 'u' }, 348 { "uid", OPT_INT, 'u' },
309 { "gid", OPT_INT, 'g' }, 349 { "gid", OPT_INT, 'g' },
@@ -331,12 +371,12 @@ static int ncp_parse_options(struct ncp_mount_data_kernel *data, char *options)
331 data->mounted_uid = 0; 371 data->mounted_uid = 0;
332 data->wdog_pid = NULL; 372 data->wdog_pid = NULL;
333 data->ncp_fd = ~0; 373 data->ncp_fd = ~0;
334 data->time_out = 10; 374 data->time_out = NCP_DEFAULT_TIME_OUT;
335 data->retry_count = 20; 375 data->retry_count = NCP_DEFAULT_RETRY_COUNT;
336 data->uid = 0; 376 data->uid = 0;
337 data->gid = 0; 377 data->gid = 0;
338 data->file_mode = 0600; 378 data->file_mode = NCP_DEFAULT_FILE_MODE;
339 data->dir_mode = 0700; 379 data->dir_mode = NCP_DEFAULT_DIR_MODE;
340 data->info_fd = -1; 380 data->info_fd = -1;
341 data->mounted_vol[0] = 0; 381 data->mounted_vol[0] = 0;
342 382
@@ -982,6 +1022,7 @@ static struct file_system_type ncp_fs_type = {
982 .name = "ncpfs", 1022 .name = "ncpfs",
983 .get_sb = ncp_get_sb, 1023 .get_sb = ncp_get_sb,
984 .kill_sb = kill_anon_super, 1024 .kill_sb = kill_anon_super,
1025 .fs_flags = FS_BINARY_MOUNTDATA,
985}; 1026};
986 1027
987static int __init init_ncp_fs(void) 1028static int __init init_ncp_fs(void)