xref: /openbmc/linux/fs/ext4/symlink.c (revision 754661f143e70d66eae6c48532ca245aa05dec0e)
1ac27a0ecSDave Kleikamp /*
2617ba13bSMingming Cao  *  linux/fs/ext4/symlink.c
3ac27a0ecSDave Kleikamp  *
4ac27a0ecSDave Kleikamp  * Only fast symlinks left here - the rest is done by generic code. AV, 1999
5ac27a0ecSDave Kleikamp  *
6ac27a0ecSDave Kleikamp  * Copyright (C) 1992, 1993, 1994, 1995
7ac27a0ecSDave Kleikamp  * Remy Card (card@masi.ibp.fr)
8ac27a0ecSDave Kleikamp  * Laboratoire MASI - Institut Blaise Pascal
9ac27a0ecSDave Kleikamp  * Universite Pierre et Marie Curie (Paris VI)
10ac27a0ecSDave Kleikamp  *
11ac27a0ecSDave Kleikamp  *  from
12ac27a0ecSDave Kleikamp  *
13ac27a0ecSDave Kleikamp  *  linux/fs/minix/symlink.c
14ac27a0ecSDave Kleikamp  *
15ac27a0ecSDave Kleikamp  *  Copyright (C) 1991, 1992  Linus Torvalds
16ac27a0ecSDave Kleikamp  *
17617ba13bSMingming Cao  *  ext4 symlink handling code
18ac27a0ecSDave Kleikamp  */
19ac27a0ecSDave Kleikamp 
20ac27a0ecSDave Kleikamp #include <linux/fs.h>
21dab291afSMingming Cao #include <linux/jbd2.h>
22617ba13bSMingming Cao #include <linux/ext4_fs.h>
23ac27a0ecSDave Kleikamp #include <linux/namei.h>
24ac27a0ecSDave Kleikamp #include "xattr.h"
25ac27a0ecSDave Kleikamp 
26617ba13bSMingming Cao static void * ext4_follow_link(struct dentry *dentry, struct nameidata *nd)
27ac27a0ecSDave Kleikamp {
28617ba13bSMingming Cao 	struct ext4_inode_info *ei = EXT4_I(dentry->d_inode);
29ac27a0ecSDave Kleikamp 	nd_set_link(nd, (char*)ei->i_data);
30ac27a0ecSDave Kleikamp 	return NULL;
31ac27a0ecSDave Kleikamp }
32ac27a0ecSDave Kleikamp 
33*754661f1SArjan van de Ven const struct inode_operations ext4_symlink_inode_operations = {
34ac27a0ecSDave Kleikamp 	.readlink	= generic_readlink,
35ac27a0ecSDave Kleikamp 	.follow_link	= page_follow_link_light,
36ac27a0ecSDave Kleikamp 	.put_link	= page_put_link,
37617ba13bSMingming Cao #ifdef CONFIG_EXT4DEV_FS_XATTR
38ac27a0ecSDave Kleikamp 	.setxattr	= generic_setxattr,
39ac27a0ecSDave Kleikamp 	.getxattr	= generic_getxattr,
40617ba13bSMingming Cao 	.listxattr	= ext4_listxattr,
41ac27a0ecSDave Kleikamp 	.removexattr	= generic_removexattr,
42ac27a0ecSDave Kleikamp #endif
43ac27a0ecSDave Kleikamp };
44ac27a0ecSDave Kleikamp 
45*754661f1SArjan van de Ven const struct inode_operations ext4_fast_symlink_inode_operations = {
46ac27a0ecSDave Kleikamp 	.readlink	= generic_readlink,
47617ba13bSMingming Cao 	.follow_link	= ext4_follow_link,
48617ba13bSMingming Cao #ifdef CONFIG_EXT4DEV_FS_XATTR
49ac27a0ecSDave Kleikamp 	.setxattr	= generic_setxattr,
50ac27a0ecSDave Kleikamp 	.getxattr	= generic_getxattr,
51617ba13bSMingming Cao 	.listxattr	= ext4_listxattr,
52ac27a0ecSDave Kleikamp 	.removexattr	= generic_removexattr,
53ac27a0ecSDave Kleikamp #endif
54ac27a0ecSDave Kleikamp };
55