patch-2.1.43 linux/fs/sysv/symlink.c
Next file: linux/fs/ufs/ufs_dir.c
Previous file: linux/fs/sysv/namei.c
Back to the patch index
Back to the overall index
- Lines: 72
- Date:
Thu Jun 12 16:22:09 1997
- Orig file:
v2.1.42/linux/fs/sysv/symlink.c
- Orig date:
Mon Oct 28 04:29:27 1996
diff -u --recursive --new-file v2.1.42/linux/fs/sysv/symlink.c linux/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 @@
NULL, /* mknod */
NULL, /* rename */
sysv_readlink, /* readlink */
- sysv_follow_link, /* follow_link */
NULL, /* readpage */
NULL, /* writepage */
NULL, /* bmap */
@@ -46,44 +44,6 @@
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 @@
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);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov