summaryrefslogtreecommitdiffstats
path: root/fs/sysv
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-06-17 13:20:30 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-06-17 13:20:30 +0000
commit7acb77a6e7bddd4c4c5aa975bbf976927c013798 (patch)
tree4139829ec6edb85f73774bb95cdec376758bfc73 /fs/sysv
parent64d58d4c8cd6a89ee218301ec0dc0ebfec91a4db (diff)
Merge with 2.1.43.
Diffstat (limited to 'fs/sysv')
-rw-r--r--fs/sysv/dir.c1
-rw-r--r--fs/sysv/file.c1
-rw-r--r--fs/sysv/ialloc.c7
-rw-r--r--fs/sysv/inode.c6
-rw-r--r--fs/sysv/namei.c15
-rw-r--r--fs/sysv/symlink.c44
6 files changed, 13 insertions, 61 deletions
diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c
index 3dd0931cf..8b942a5b1 100644
--- a/fs/sysv/dir.c
+++ b/fs/sysv/dir.c
@@ -57,7 +57,6 @@ struct inode_operations sysv_dir_inode_operations = {
sysv_mknod, /* mknod */
sysv_rename, /* rename */
NULL, /* readlink */
- NULL, /* follow_link */
NULL, /* readpage */
NULL, /* writepage */
NULL, /* bmap */
diff --git a/fs/sysv/file.c b/fs/sysv/file.c
index f3aadb509..da07ef7a8 100644
--- a/fs/sysv/file.c
+++ b/fs/sysv/file.c
@@ -64,7 +64,6 @@ struct inode_operations sysv_file_inode_operations = {
NULL, /* mknod */
NULL, /* rename */
NULL, /* readlink */
- NULL, /* follow_link */
generic_readpage, /* readpage */
NULL, /* writepage */
sysv_bmap, /* bmap */
diff --git a/fs/sysv/ialloc.c b/fs/sysv/ialloc.c
index 85ba640d1..97bc7284f 100644
--- a/fs/sysv/ialloc.c
+++ b/fs/sysv/ialloc.c
@@ -62,8 +62,9 @@ void sysv_free_inode(struct inode * inode)
printk("sysv_free_inode: inode has no device\n");
return;
}
- if (inode->i_count != 1) {
- printk("sysv_free_inode: inode has count=%d\n", inode->i_count);
+ if (atomic_read(&inode->i_count) != 1) {
+ printk("sysv_free_inode: inode has count=%d\n",
+ atomic_read(&inode->i_count));
return;
}
if (inode->i_nlink) {
@@ -149,7 +150,7 @@ struct inode * sysv_new_inode(const struct inode * dir)
mark_buffer_dirty(sb->sv_bh1, 1); /* super-block has been modified */
if (sb->sv_bh1 != sb->sv_bh2) mark_buffer_dirty(sb->sv_bh2, 1);
sb->s_dirt = 1; /* and needs time stamp */
- inode->i_count = 1;
+ atomic_set(&inode->i_count, 1);
inode->i_nlink = 1;
inode->i_dev = sb->s_dev;
inode->i_uid = current->fsuid;
diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c
index ebbf0bb4f..f8c6a1b38 100644
--- a/fs/sysv/inode.c
+++ b/fs/sysv/inode.c
@@ -975,9 +975,9 @@ int sysv_sync_inode(struct inode * inode)
/* Every kernel module contains stuff like this. */
static struct file_system_type sysv_fs_type[3] = {
- {sysv_read_super, "xenix", 1, NULL},
- {sysv_read_super, "sysv", 1, NULL},
- {sysv_read_super, "coherent", 1, NULL}
+ {"xenix", FS_REQUIRES_DEV, sysv_read_super, NULL},
+ {"sysv", FS_REQUIRES_DEV, sysv_read_super, NULL},
+ {"coherent", FS_REQUIRES_DEV, sysv_read_super, NULL}
};
__initfunc(int init_sysv_fs(void))
diff --git a/fs/sysv/namei.c b/fs/sysv/namei.c
index 735d158d4..d1b67ab5f 100644
--- a/fs/sysv/namei.c
+++ b/fs/sysv/namei.c
@@ -454,7 +454,7 @@ int sysv_rmdir(struct inode * dir, const char * name, int len)
retval = -ENOENT;
goto end_rmdir;
}
- if (inode->i_count > 1) {
+ if (atomic_read(&inode->i_count) > 1) {
retval = -EBUSY;
goto end_rmdir;
}
@@ -635,7 +635,7 @@ static int subdir(struct inode * new_inode, struct inode * old_inode)
int ino;
int result;
- new_inode->i_count++;
+ atomic_inc(&new_inode->i_count);
result = 0;
for (;;) {
if (new_inode == old_inode) {
@@ -668,7 +668,7 @@ static int subdir(struct inode * new_inode, struct inode * old_inode)
* higher-level routines.
*/
static int do_sysv_rename(struct inode * old_dir, const char * old_name, int old_len,
- struct inode * new_dir, const char * new_name, int new_len, int must_be_dir)
+ struct inode * new_dir, const char * new_name, int new_len)
{
struct inode * old_inode, * new_inode;
struct buffer_head * old_bh, * new_bh, * dir_bh;
@@ -694,8 +694,6 @@ start_up:
old_inode = __iget(old_dir->i_sb, old_de->inode, 0); /* don't cross mnt-points */
if (!old_inode)
goto end_rename;
- if (must_be_dir && !S_ISDIR(old_inode->i_mode))
- goto end_rename;
retval = -EPERM;
if ((old_dir->i_mode & S_ISVTX) &&
current->fsuid != old_inode->i_uid &&
@@ -724,7 +722,7 @@ start_up:
if (!empty_dir(new_inode))
goto end_rename;
retval = -EBUSY;
- if (new_inode->i_count > 1)
+ if (atomic_read(&new_inode->i_count) > 1)
goto end_rename;
}
retval = -EPERM;
@@ -810,8 +808,7 @@ end_rename:
* as they are on different partitions.
*/
int sysv_rename(struct inode * old_dir, const char * old_name, int old_len,
- struct inode * new_dir, const char * new_name, int new_len,
- int must_be_dir)
+ struct inode * new_dir, const char * new_name, int new_len)
{
static struct wait_queue * wait = NULL;
static int lock = 0;
@@ -821,7 +818,7 @@ int sysv_rename(struct inode * old_dir, const char * old_name, int old_len,
sleep_on(&wait);
lock = 1;
result = do_sysv_rename(old_dir, old_name, old_len,
- new_dir, new_name, new_len, must_be_dir);
+ new_dir, new_name, new_len);
lock = 0;
wake_up(&wait);
return result;
diff --git a/fs/sysv/symlink.c b/fs/sysv/symlink.c
index 9a33d9fab..4e8a5e349 100644
--- a/fs/sysv/symlink.c
+++ b/fs/sysv/symlink.c
@@ -21,7 +21,6 @@
#include <asm/uaccess.h>
static int sysv_readlink(struct inode *, char *, int);
-static int sysv_follow_link(struct inode *, struct inode *, int, int, struct inode **);
/*
* symlinks can't do much...
@@ -38,7 +37,6 @@ struct inode_operations sysv_symlink_inode_operations = {
NULL, /* mknod */
NULL, /* rename */
sysv_readlink, /* readlink */
- sysv_follow_link, /* follow_link */
NULL, /* readpage */
NULL, /* writepage */
NULL, /* bmap */
@@ -46,44 +44,6 @@ struct inode_operations sysv_symlink_inode_operations = {
NULL /* permission */
};
-static int sysv_follow_link(struct inode * dir, struct inode * inode,
- int flag, int mode, struct inode ** res_inode)
-{
- int error;
- struct buffer_head * bh;
-
- *res_inode = NULL;
- if (!dir) {
- dir = current->fs->root;
- dir->i_count++;
- }
- if (!inode) {
- iput(dir);
- return -ENOENT;
- }
- if (!S_ISLNK(inode->i_mode)) {
- iput(dir);
- *res_inode = inode;
- return 0;
- }
- if (current->link_count > 5) {
- iput(inode);
- iput(dir);
- return -ELOOP;
- }
- if (!(bh = sysv_file_bread(inode, 0, 0))) { /* is reading 1 block enough ?? */
- iput(inode);
- iput(dir);
- return -EIO;
- }
- iput(inode);
- current->link_count++;
- error = open_namei(bh->b_data,flag,mode,res_inode,dir);
- current->link_count--;
- brelse(bh);
- return error;
-}
-
static int sysv_readlink(struct inode * inode, char * buffer, int buflen)
{
struct buffer_head * bh;
@@ -91,10 +51,6 @@ static int sysv_readlink(struct inode * inode, char * buffer, int buflen)
int i;
char c;
- if (!S_ISLNK(inode->i_mode)) {
- iput(inode);
- return -EINVAL;
- }
if (buflen > inode->i_sb->sv_block_size_1)
buflen = inode->i_sb->sv_block_size_1;
bh = sysv_file_bread(inode, 0, 0);