diff options
author | H. Peter Anvin <hpa@zytor.com> | 1997-10-06 21:27:09 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 1997-10-06 21:27:09 +0000 |
commit | 93aa1d55b4ffe513fb10d897dd52a09165484e4e (patch) | |
tree | b7c45bd4579a285261ab11c0557e99e4b3f8037d /kernel/symlink.c | |
parent | 6919185c2ea948793620b5acc57721a65c631710 (diff) | |
download | autofs3-93aa1d55b4ffe513fb10d897dd52a09165484e4e.tar.gz autofs3-93aa1d55b4ffe513fb10d897dd52a09165484e4e.tar.xz autofs3-93aa1d55b4ffe513fb10d897dd52a09165484e4e.zip |
Added kernel code to CVS repository
Diffstat (limited to 'kernel/symlink.c')
-rw-r--r-- | kernel/symlink.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/kernel/symlink.c b/kernel/symlink.c new file mode 100644 index 0000000..b42955f --- /dev/null +++ b/kernel/symlink.c @@ -0,0 +1,58 @@ +/* -*- linux-c -*- --------------------------------------------------------- * + * + * linux/fs/autofs/symlink.c + * + * Copyright 1997 Transmeta Corporation -- All Rights Reserved + * + * This file is part of the Linux kernel and is made available under + * the terms of the GNU General Public License, version 2, or at your + * option, any later version, incorporated herein by reference. + * + * ------------------------------------------------------------------------- */ + +#include <linux/string.h> +#include <linux/sched.h> +#include "autofs_i.h" + +static int autofs_readlink(struct inode *inode, char *buffer, int buflen) +{ + struct autofs_symlink *sl; + int len; + + sl = (struct autofs_symlink *)inode->u.generic_ip; + len = sl->len; + if (len > buflen) len = buflen; + copy_to_user(buffer,sl->data,len); + return len; +} + +static struct dentry * autofs_follow_link(struct inode *inode, struct dentry *base) +{ + struct autofs_symlink *sl; + + sl = (struct autofs_symlink *)inode->u.generic_ip; + return lookup_dentry(sl->data, base, 1); +} + +struct inode_operations autofs_symlink_inode_operations = { + NULL, /* file operations */ + NULL, /* create */ + NULL, /* lookup */ + NULL, /* link */ + NULL, /* unlink */ + NULL, /* symlink */ + NULL, /* mkdir */ + NULL, /* rmdir */ + NULL, /* mknod */ + NULL, /* rename */ + autofs_readlink, /* readlink */ + autofs_follow_link, /* follow_link */ + NULL, /* readpage */ + NULL, /* writepage */ + NULL, /* bmap */ + NULL, /* truncate */ + NULL, /* permission */ + NULL, /* smap */ + NULL, /* updatepage */ + NULL /* revalidate */ +}; |