forked from Ninals-GitHub/Learning-Ext2-Filesystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathme2fs_symlink.c
111 lines (87 loc) · 2.81 KB
/
me2fs_symlink.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/********************************************************************************
File : me2fs_symlink.c
Description : symbolic link operations for my ext2 file system
*********************************************************************************/
#include "linux/namei.h"
#include "me2fs.h"
#include "me2fs_util.h"
#include "me2fs_inode.h"
/*
==================================================================================
Prototype Statement
==================================================================================
*/
static void*
me2fsFollowLink( struct dentry *dentry, struct nameidata *nd );
/*
==================================================================================
DEFINES
==================================================================================
*/
/*
==================================================================================
Management
==================================================================================
*/
const struct inode_operations me2fs_symlink_inode_operations =
{
.readlink = generic_readlink,
.follow_link = page_follow_link_light,
.put_link = page_put_link,
.setattr = me2fsSetAttr,
};
const struct inode_operations me2fs_fast_symlink_inode_operations =
{
.readlink = generic_readlink,
.follow_link = me2fsFollowLink,
.setattr = me2fsSetAttr,
};
/*
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
< Open Functions >
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
/*
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Function :void
Input :void
Output :void
Return :void
Description :void
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
*/
/*
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
< Local Functions >
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
*/
/*
==================================================================================
Function :me2fsFollowLink
Input :struct dentry *dentry
< symlink file >
struct nameidata *nd
< data of name resolver >
Output :void
Return :void*
< return address except for PTR_ERR >
Description :follo symbolic link
==================================================================================
*/
static void*
me2fsFollowLink( struct dentry *dentry, struct nameidata *nd )
{
struct me2fs_inode_info *mi;
mi = ME2FS_I( dentry->d_inode );
nd_set_link( nd, ( char* )mi->i_data );
return( NULL );
}
/*
==================================================================================
Function :void
Input :void
Output :void
Return :void
Description :void
==================================================================================
*/