summaryrefslogtreecommitdiffstats
path: root/fs/minix
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-03-02 02:36:47 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-03-02 02:36:47 +0000
commit8624512aa908741ba2795200133eae0d7f4557ea (patch)
treed5d3036fccf2604f4c98dedc11e8adb929d6b52e /fs/minix
parent7b8f5d6f1d45d9f9de1d26e7d3c32aa5af11b488 (diff)
Merge with 2.3.48.
Diffstat (limited to 'fs/minix')
-rw-r--r--fs/minix/bitmap.c1
-rw-r--r--fs/minix/dir.c28
-rw-r--r--fs/minix/file.c15
-rw-r--r--fs/minix/inode.c30
-rw-r--r--fs/minix/namei.c35
5 files changed, 44 insertions, 65 deletions
diff --git a/fs/minix/bitmap.c b/fs/minix/bitmap.c
index 21057e7dc..0a504e59d 100644
--- a/fs/minix/bitmap.c
+++ b/fs/minix/bitmap.c
@@ -289,7 +289,6 @@ struct inode * minix_new_inode(const struct inode * dir, int * error)
inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->fsgid;
inode->i_ino = j;
inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
- inode->i_op = NULL;
inode->i_blocks = inode->i_blksize = 0;
insert_inode_hash(inode);
mark_inode_dirty(inode);
diff --git a/fs/minix/dir.c b/fs/minix/dir.c
index 02bde162d..6443f05ed 100644
--- a/fs/minix/dir.c
+++ b/fs/minix/dir.c
@@ -12,38 +12,14 @@
#include <linux/minix_fs.h>
#include <linux/stat.h>
-#include <asm/uaccess.h>
-
-static ssize_t minix_dir_read(struct file * filp, char * buf,
- size_t count, loff_t *ppos)
-{
- return -EISDIR;
-}
-
static int minix_readdir(struct file *, void *, filldir_t);
-static struct file_operations minix_dir_operations = {
- read: minix_dir_read,
+struct file_operations minix_dir_operations = {
+ read: generic_read_dir,
readdir: minix_readdir,
fsync: file_fsync,
};
-/*
- * directories can handle most operations...
- */
-struct inode_operations minix_dir_inode_operations = {
- &minix_dir_operations, /* default directory file-ops */
- minix_create, /* create */
- minix_lookup, /* lookup */
- minix_link, /* link */
- minix_unlink, /* unlink */
- minix_symlink, /* symlink */
- minix_mkdir, /* mkdir */
- minix_rmdir, /* rmdir */
- minix_mknod, /* mknod */
- minix_rename, /* rename */
-};
-
static int minix_readdir(struct file * filp,
void * dirent, filldir_t filldir)
{
diff --git a/fs/minix/file.c b/fs/minix/file.c
index 61d0e3f02..c0b5ad89f 100644
--- a/fs/minix/file.c
+++ b/fs/minix/file.c
@@ -6,18 +6,6 @@
* minix regular file handling primitives
*/
-#include <linux/sched.h>
-#include <linux/kernel.h>
-#include <linux/errno.h>
-#include <linux/fcntl.h>
-#include <linux/stat.h>
-#include <linux/locks.h>
-#include <linux/mm.h>
-#include <linux/pagemap.h>
-
-#include <asm/uaccess.h>
-#include <asm/system.h>
-
#include <linux/fs.h>
#include <linux/minix_fs.h>
@@ -25,7 +13,7 @@
* We have mostly NULLs here: the current defaults are OK for
* the minix filesystem.
*/
-static struct file_operations minix_file_operations = {
+struct file_operations minix_file_operations = {
read: generic_file_read,
write: generic_file_write,
mmap: generic_file_mmap,
@@ -33,6 +21,5 @@ static struct file_operations minix_file_operations = {
};
struct inode_operations minix_file_inode_operations = {
- &minix_file_operations,
truncate: minix_truncate,
};
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index 9620870ad..1d9ebb062 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -85,15 +85,13 @@ static void minix_put_super(struct super_block *sb)
}
static struct super_operations minix_sops = {
- minix_read_inode,
- minix_write_inode,
- NULL, /* put_inode */
- minix_delete_inode,
- NULL, /* notify_change */
- minix_put_super,
- minix_write_super,
- minix_statfs,
- minix_remount
+ read_inode: minix_read_inode,
+ write_inode: minix_write_inode,
+ delete_inode: minix_delete_inode,
+ put_super: minix_put_super,
+ write_super: minix_write_super,
+ statfs: minix_statfs,
+ remount_fs: minix_remount,
};
static int minix_remount (struct super_block * sb, int * flags, char * data)
@@ -1054,7 +1052,6 @@ static void V1_minix_read_inode(struct inode * inode)
int block, ino;
ino = inode->i_ino;
- inode->i_op = NULL;
inode->i_mode = 0;
if (!ino || ino > inode->i_sb->u.minix_sb.s_ninodes) {
printk("Bad inode number on dev %s"
@@ -1083,10 +1080,12 @@ static void V1_minix_read_inode(struct inode * inode)
inode->u.minix_i.u.i1_data[block] = raw_inode->i_zone[block];
if (S_ISREG(inode->i_mode)) {
inode->i_op = &minix_file_inode_operations;
+ inode->i_fop = &minix_file_operations;
inode->i_mapping->a_ops = &minix_aops;
- } else if (S_ISDIR(inode->i_mode))
+ } else if (S_ISDIR(inode->i_mode)) {
inode->i_op = &minix_dir_inode_operations;
- else if (S_ISLNK(inode->i_mode)) {
+ inode->i_fop = &minix_dir_operations;
+ } else if (S_ISLNK(inode->i_mode)) {
inode->i_op = &page_symlink_inode_operations;
inode->i_mapping->a_ops = &minix_aops;
} else
@@ -1104,7 +1103,6 @@ static void V2_minix_read_inode(struct inode * inode)
int block, ino;
ino = inode->i_ino;
- inode->i_op = NULL;
inode->i_mode = 0;
if (!ino || ino > inode->i_sb->u.minix_sb.s_ninodes) {
printk("Bad inode number on dev %s"
@@ -1135,10 +1133,12 @@ static void V2_minix_read_inode(struct inode * inode)
inode->u.minix_i.u.i2_data[block] = raw_inode->i_zone[block];
if (S_ISREG(inode->i_mode)) {
inode->i_op = &minix_file_inode_operations;
+ inode->i_fop = &minix_file_operations;
inode->i_mapping->a_ops = &minix_aops;
- } else if (S_ISDIR(inode->i_mode))
+ } else if (S_ISDIR(inode->i_mode)) {
inode->i_op = &minix_dir_inode_operations;
- else if (S_ISLNK(inode->i_mode)) {
+ inode->i_fop = &minix_dir_operations;
+ } else if (S_ISLNK(inode->i_mode)) {
inode->i_op = &page_symlink_inode_operations;
inode->i_mapping->a_ops = &minix_aops;
} else
diff --git a/fs/minix/namei.c b/fs/minix/namei.c
index de2d0f279..baef110d2 100644
--- a/fs/minix/namei.c
+++ b/fs/minix/namei.c
@@ -115,7 +115,7 @@ struct dentry_operations minix_dentry_operations = {
0 /* compare */
};
-struct dentry *minix_lookup(struct inode * dir, struct dentry *dentry)
+static struct dentry *minix_lookup(struct inode * dir, struct dentry *dentry)
{
struct inode * inode = NULL;
struct minix_dir_entry * de;
@@ -206,7 +206,7 @@ static int minix_add_entry(struct inode * dir,
return 0;
}
-int minix_create(struct inode * dir, struct dentry *dentry, int mode)
+static int minix_create(struct inode * dir, struct dentry *dentry, int mode)
{
int error;
struct inode * inode;
@@ -219,6 +219,7 @@ int minix_create(struct inode * dir, struct dentry *dentry, int mode)
if (!inode)
return -ENOSPC;
inode->i_op = &minix_file_inode_operations;
+ inode->i_fop = &minix_file_operations;
inode->i_mapping->a_ops = &minix_aops;
inode->i_mode = mode;
mark_inode_dirty(inode);
@@ -237,7 +238,7 @@ int minix_create(struct inode * dir, struct dentry *dentry, int mode)
return 0;
}
-int minix_mknod(struct inode * dir, struct dentry *dentry, int mode, int rdev)
+static int minix_mknod(struct inode * dir, struct dentry *dentry, int mode, int rdev)
{
int error;
struct inode * inode;
@@ -266,7 +267,7 @@ int minix_mknod(struct inode * dir, struct dentry *dentry, int mode, int rdev)
return 0;
}
-int minix_mkdir(struct inode * dir, struct dentry *dentry, int mode)
+static int minix_mkdir(struct inode * dir, struct dentry *dentry, int mode)
{
int error;
struct inode * inode;
@@ -283,6 +284,7 @@ int minix_mkdir(struct inode * dir, struct dentry *dentry, int mode)
if (!inode)
return -ENOSPC;
inode->i_op = &minix_dir_inode_operations;
+ inode->i_fop = &minix_dir_operations;
inode->i_size = 2 * info->s_dirsize;
dir_block = minix_bread(inode,0,1);
if (!dir_block) {
@@ -377,7 +379,7 @@ bad_dir:
return 1;
}
-int minix_rmdir(struct inode * dir, struct dentry *dentry)
+static int minix_rmdir(struct inode * dir, struct dentry *dentry)
{
int retval;
struct inode * inode;
@@ -422,7 +424,7 @@ end_rmdir:
return retval;
}
-int minix_unlink(struct inode * dir, struct dentry *dentry)
+static int minix_unlink(struct inode * dir, struct dentry *dentry)
{
int retval;
struct inode * inode;
@@ -457,7 +459,7 @@ end_unlink:
return retval;
}
-int minix_symlink(struct inode * dir, struct dentry *dentry,
+static int minix_symlink(struct inode * dir, struct dentry *dentry,
const char * symname)
{
struct minix_dir_entry * de;
@@ -502,7 +504,7 @@ fail:
goto out;
}
-int minix_link(struct dentry * old_dentry, struct inode * dir,
+static int minix_link(struct dentry * old_dentry, struct inode * dir,
struct dentry *dentry)
{
int error;
@@ -540,7 +542,7 @@ int minix_link(struct dentry * old_dentry, struct inode * dir,
* Anybody can rename anything with this: the permission checks are left to the
* higher-level routines.
*/
-int minix_rename(struct inode * old_dir, struct dentry *old_dentry,
+static int minix_rename(struct inode * old_dir, struct dentry *old_dentry,
struct inode * new_dir, struct dentry *new_dentry)
{
struct inode * old_inode, * new_inode;
@@ -630,3 +632,18 @@ end_rename:
brelse(new_bh);
return retval;
}
+
+/*
+ * directories can handle most operations...
+ */
+struct inode_operations minix_dir_inode_operations = {
+ create: minix_create,
+ lookup: minix_lookup,
+ link: minix_link,
+ unlink: minix_unlink,
+ symlink: minix_symlink,
+ mkdir: minix_mkdir,
+ rmdir: minix_rmdir,
+ mknod: minix_mknod,
+ rename: minix_rename,
+};