symlink.c 1.3 KB
Newer Older
1
/*
2
 *  linux/fs/ext4/symlink.c
3 4 5 6 7 8 9 10 11 12 13 14 15 16
 *
 * Only fast symlinks left here - the rest is done by generic code. AV, 1999
 *
 * Copyright (C) 1992, 1993, 1994, 1995
 * Remy Card (card@masi.ibp.fr)
 * Laboratoire MASI - Institut Blaise Pascal
 * Universite Pierre et Marie Curie (Paris VI)
 *
 *  from
 *
 *  linux/fs/minix/symlink.c
 *
 *  Copyright (C) 1991, 1992  Linus Torvalds
 *
17
 *  ext4 symlink handling code
18 19 20 21
 */

#include <linux/fs.h>
#include <linux/namei.h>
22
#include "ext4.h"
23 24
#include "xattr.h"

25
static void *ext4_follow_link(struct dentry *dentry, struct nameidata *nd)
26
{
27
	struct ext4_inode_info *ei = EXT4_I(dentry->d_inode);
28
	nd_set_link(nd, (char *) ei->i_data);
29 30 31
	return NULL;
}

32
const struct inode_operations ext4_symlink_inode_operations = {
33 34 35
	.readlink	= generic_readlink,
	.follow_link	= page_follow_link_light,
	.put_link	= page_put_link,
36
	.setattr	= ext4_setattr,
37 38
	.setxattr	= generic_setxattr,
	.getxattr	= generic_getxattr,
39
	.listxattr	= ext4_listxattr,
40 41 42
	.removexattr	= generic_removexattr,
};

43
const struct inode_operations ext4_fast_symlink_inode_operations = {
44
	.readlink	= generic_readlink,
45
	.follow_link	= ext4_follow_link,
46
	.setattr	= ext4_setattr,
47 48
	.setxattr	= generic_setxattr,
	.getxattr	= generic_getxattr,
49
	.listxattr	= ext4_listxattr,
50 51
	.removexattr	= generic_removexattr,
};