patch-2.3.51 linux/fs/devpts/inode.c
Next file: linux/fs/efs/super.c
Previous file: linux/fs/devfs/base.c
Back to the patch index
Back to the overall index
- Lines: 137
- Date:
Fri Mar 10 13:41:50 2000
- Orig file:
v2.3.50/linux/fs/devpts/inode.c
- Orig date:
Sat Feb 26 22:31:52 2000
diff -u --recursive --new-file v2.3.50/linux/fs/devpts/inode.c linux/fs/devpts/inode.c
@@ -51,19 +51,13 @@
kfree(sbi->inodes);
kfree(sbi);
-
-#ifdef MODULE
- MOD_DEC_USE_COUNT;
-#endif
}
-static int devpts_statfs(struct super_block *sb, struct statfs *buf, int bufsiz);
+static int devpts_statfs(struct super_block *sb, struct statfs *buf);
static void devpts_read_inode(struct inode *inode);
-static void devpts_write_inode(struct inode *inode);
static struct super_operations devpts_sops = {
read_inode: devpts_read_inode,
- write_inode: devpts_write_inode,
put_super: devpts_put_super,
statfs: devpts_statfs,
};
@@ -125,9 +119,6 @@
struct dentry * root;
struct devpts_sb_info *sbi;
- MOD_INC_USE_COUNT;
-
- lock_super(s);
/* Super block already completed? */
if (s->s_root)
goto out_unlock;
@@ -151,7 +142,6 @@
s->s_magic = DEVPTS_SUPER_MAGIC;
s->s_op = &devpts_sops;
s->s_root = NULL;
- unlock_super(s); /* shouldn't we keep it locked a while longer? */
/*
* Get the root inode and dentry, but defer checking for errors.
@@ -183,7 +173,6 @@
/*
* Success! Install the root dentry now to indicate completion.
*/
- lock_super(s);
s->s_root = root;
sbi->next = mounts;
@@ -192,14 +181,12 @@
sbi->back = &mounts;
mounts = s;
- unlock_super(s);
return s;
/*
* Success ... somebody else completed the super block for us.
*/
out_unlock:
- unlock_super(s);
goto out_dec;
out_dput:
if (root)
@@ -207,7 +194,6 @@
else
iput(root_inode);
out_dec:
- MOD_DEC_USE_COUNT;
return s;
/*
@@ -217,7 +203,6 @@
/*
* dput() can block, so we clear the super block first.
*/
- s->s_dev = 0;
dput(root);
goto fail_free;
fail_iput:
@@ -225,32 +210,22 @@
/*
* iput() can block, so we clear the super block first.
*/
- s->s_dev = 0;
iput(root_inode);
fail_free:
kfree(sbi);
- goto fail_dec;
fail_unlock:
- unlock_super(s);
-fail_dec:
- s->s_dev = 0;
- MOD_DEC_USE_COUNT;
return NULL;
}
-static int devpts_statfs(struct super_block *sb, struct statfs *buf, int bufsiz)
+static int devpts_statfs(struct super_block *sb, struct statfs *buf)
{
- struct statfs tmp;
-
- tmp.f_type = DEVPTS_SUPER_MAGIC;
- tmp.f_bsize = 1024;
- tmp.f_blocks = 0;
- tmp.f_bfree = 0;
- tmp.f_bavail = 0;
- tmp.f_files = 0;
- tmp.f_ffree = 0;
- tmp.f_namelen = NAME_MAX;
- return copy_to_user(buf, &tmp, bufsiz) ? -EFAULT : 0;
+ buf->f_type = DEVPTS_SUPER_MAGIC;
+ buf->f_bsize = 1024;
+ buf->f_bfree = 0;
+ buf->f_bavail = 0;
+ buf->f_ffree = 0;
+ buf->f_namelen = NAME_MAX;
+ return 0;
}
static void devpts_read_inode(struct inode *inode)
@@ -284,16 +259,7 @@
return;
}
-static void devpts_write_inode(struct inode *inode)
-{
-}
-
-static struct file_system_type devpts_fs_type = {
- "devpts",
- 0,
- devpts_read_super,
- NULL
-};
+static DECLARE_FSTYPE(devpts_fs_type, "devpts", devpts_read_super, 0);
void devpts_pty_new(int number, kdev_t device)
{
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)