summaryrefslogtreecommitdiffstats
path: root/fs/efs/symlink.c
diff options
context:
space:
mode:
authorAl Smith <Al.Smith@aeschi.ch.eu.org>1999-03-31 11:28:49 +0000
committerAl Smith <Al.Smith@aeschi.ch.eu.org>1999-03-31 11:28:49 +0000
commit4cd9a486c8091de019dadee71cb80d4b53d8bd6d (patch)
treeb32d3745ed7b46cc861cd607a33426581c7bb26c /fs/efs/symlink.c
parent04a4c145e0293e7cd55c5c844eda08b1611e78a6 (diff)
Updated efs support to revision 0.97.
Diffstat (limited to 'fs/efs/symlink.c')
-rw-r--r--fs/efs/symlink.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/efs/symlink.c b/fs/efs/symlink.c
index f5c11792b..c2783100b 100644
--- a/fs/efs/symlink.c
+++ b/fs/efs/symlink.c
@@ -6,7 +6,7 @@
* Portions derived from work (c) 1995,1996 Christian Vogelgsang.
*/
-#include <linux/efs.h>
+#include <linux/efs_fs.h>
static int
efs_readlink(struct dentry *, char *, int);
@@ -33,7 +33,7 @@ struct inode_operations efs_symlink_inode_operations = {
NULL /* permission */
};
-static char *efs_linktarget(struct inode *in) {
+static char *efs_linktarget(struct inode *in, int *len) {
char *name;
struct buffer_head * bh;
efs_block_t size = in->i_size;
@@ -69,6 +69,7 @@ static char *efs_linktarget(struct inode *in) {
}
name[size] = (char) 0;
+ if (len) *len = size;
return name;
}
@@ -77,7 +78,7 @@ static struct dentry *efs_follow_link(struct dentry *dentry, struct dentry *base
char *name;
struct inode *inode = dentry->d_inode;
- name = efs_linktarget(inode);
+ name = efs_linktarget(inode, NULL);
base = lookup_dentry(name, base, follow);
kfree(name);
@@ -89,11 +90,8 @@ static int efs_readlink(struct dentry * dir, char * buf, int bufsiz) {
char *name;
struct inode *inode = dir->d_inode;
- if (bufsiz > 1023) bufsiz = 1023;
-
- if (!(name = efs_linktarget(inode))) return 0;
-
- rc = copy_to_user(buf, name, bufsiz) ? -EFAULT : 0;
+ if (!(name = efs_linktarget(inode, &bufsiz))) return 0;
+ rc = copy_to_user(buf, name, bufsiz) ? -EFAULT : bufsiz;
kfree(name);
return rc;