2 * linux/fs/isofs/symlink.c
4 * (C) 1992 Eric Youngdale Modified for ISO 9660 filesystem.
6 * Copyright (C) 1991, 1992 Linus Torvalds
8 * isofs symlink handling code. This is only used with the Rock Ridge
9 * extensions to iso9660
12 #include <linux/string.h>
13 #include <linux/errno.h>
14 #include <linux/sched.h>
16 #include <linux/iso_fs.h>
17 #include <linux/stat.h>
18 #include <linux/malloc.h>
20 #include <asm/uaccess.h>
22 static int isofs_readlink(struct dentry
*, char *, int);
23 static struct dentry
* isofs_follow_link(struct dentry
*, struct dentry
*, unsigned int);
26 * symlinks can't do much...
28 struct inode_operations isofs_symlink_inode_operations
= {
29 NULL
, /* no file-operations */
39 isofs_readlink
, /* readlink */
40 isofs_follow_link
, /* follow_link */
48 static int isofs_readlink(struct dentry
* dentry
, char * buffer
, int buflen
)
55 pnt
= get_rock_ridge_symlink(dentry
->d_inode
);
63 if (copy_to_user(buffer
, pnt
, i
))
69 static struct dentry
* isofs_follow_link(struct dentry
* dentry
,
75 pnt
= get_rock_ridge_symlink(dentry
->d_inode
);
78 return ERR_PTR(-ELOOP
);
81 base
= lookup_dentry(pnt
, base
, follow
);