78 #include <linux/slab.h>
79 #include <asm/uaccess.h>
85 #define IBMASMFS_MAGIC 0x66726f67
97 return mount_single(fst, flags, data, ibmasmfs_fill_super);
110 .mount = ibmasmfs_mount,
121 sb->
s_op = &ibmasmfs_s_ops;
124 root = ibmasmfs_make_inode (sb,
S_IFDIR | 0500);
129 root->
i_fop = ibmasmfs_dir_ops;
135 ibmasmfs_create_files(sb);
165 inode = ibmasmfs_make_inode(sb,
S_IFREG | mode);
174 d_add(dentry, inode);
178 static struct dentry *ibmasmfs_create_dir (
struct super_block *sb,
179 struct dentry *parent,
182 struct dentry *dentry;
189 inode = ibmasmfs_make_inode(sb,
S_IFDIR | 0500);
196 inode->
i_fop = ibmasmfs_dir_ops;
198 d_add(dentry, inode);
214 list_add(&sp->
node, &service_processors);
237 static int command_file_open(
struct inode *inode,
struct file *
file)
254 static int command_file_close(
struct inode *inode,
struct file *
file)
259 command_put(command_data->
command);
282 spin_unlock_irqrestore(&command_data->
sp->lock, flags);
286 spin_unlock_irqrestore(&command_data->
sp->lock, flags);
302 static ssize_t command_file_write(
struct file *file,
const char __user *ubuff,
size_t count, loff_t *offset)
330 spin_unlock_irqrestore(&command_data->
sp->lock, flags);
335 spin_unlock_irqrestore(&command_data->
sp->lock, flags);
343 static int event_file_open(
struct inode *inode,
struct file *file)
365 static int event_file_close(
struct inode *inode,
struct file *file)
374 static ssize_t event_file_read(
struct file *file,
char __user *buf,
size_t count, loff_t *offset)
391 spin_unlock_irqrestore(&sp->
lock, flags);
395 spin_unlock_irqrestore(&sp->
lock, flags);
417 static ssize_t event_file_write(
struct file *file,
const char __user *buf,
size_t count, loff_t *offset)
432 static int r_heartbeat_file_open(
struct inode *inode,
struct file *file)
450 static int r_heartbeat_file_close(
struct inode *inode,
struct file *file)
458 static ssize_t r_heartbeat_file_read(
struct file *file,
char __user *buf,
size_t count, loff_t *offset)
466 if (count == 0 || count > 1024)
474 spin_unlock_irqrestore(&rhbeat->
sp->lock, flags);
478 spin_unlock_irqrestore(&rhbeat->
sp->lock, flags);
486 static ssize_t r_heartbeat_file_write(
struct file *file,
const char __user *buf,
size_t count, loff_t *offset)
503 static int remote_settings_file_close(
struct inode *inode,
struct file *file)
508 static ssize_t remote_settings_file_read(
struct file *file,
char __user *buf,
size_t count, loff_t *offset)
518 if (count == 0 || count > 1024)
542 static ssize_t remote_settings_file_write(
struct file *file,
const char __user *ubuff,
size_t count, loff_t *offset)
550 if (count == 0 || count > 1024)
573 .open = command_file_open,
574 .release = command_file_close,
575 .read = command_file_read,
576 .write = command_file_write,
581 .open = event_file_open,
582 .release = event_file_close,
583 .read = event_file_read,
584 .write = event_file_write,
589 .open = r_heartbeat_file_open,
590 .release = r_heartbeat_file_close,
591 .read = r_heartbeat_file_read,
592 .write = r_heartbeat_file_write,
598 .release = remote_settings_file_close,
599 .read = remote_settings_file_read,
600 .write = remote_settings_file_write,
605 static void ibmasmfs_create_files (
struct super_block *sb)
612 struct dentry *remote_dir;
618 ibmasmfs_create_file(sb, dir,
"command", &command_fops, sp,
S_IRUSR|
S_IWUSR);
619 ibmasmfs_create_file(sb, dir,
"event", &event_fops, sp,
S_IRUSR|
S_IWUSR);
620 ibmasmfs_create_file(sb, dir,
"reverse_heartbeat", &r_heartbeat_fops, sp,
S_IRUSR|
S_IWUSR);
622 remote_dir = ibmasmfs_create_dir(sb, dir,
"remote_video");