Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
1f55a6ec
Commit
1f55a6ec
authored
Nov 01, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make nameidata completely opaque outside of fs/namei.c
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
707c5960
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
22 deletions
+27
-22
fs/namei.c
fs/namei.c
+24
-0
include/linux/namei.h
include/linux/namei.h
+3
-22
No files found.
fs/namei.c
View file @
1f55a6ec
...
...
@@ -487,6 +487,18 @@ void path_put(const struct path *path)
}
EXPORT_SYMBOL
(
path_put
);
struct
nameidata
{
struct
path
path
;
struct
qstr
last
;
struct
path
root
;
struct
inode
*
inode
;
/* path.dentry.d_inode */
unsigned
int
flags
;
unsigned
seq
,
m_seq
;
int
last_type
;
unsigned
depth
;
char
*
saved_names
[
MAX_NESTED_LINKS
+
1
];
};
/*
* Path walking has 2 modes, rcu-walk and ref-walk (see
* Documentation/filesystems/path-lookup.txt). In situations when we can't
...
...
@@ -695,6 +707,18 @@ void nd_jump_link(struct nameidata *nd, struct path *path)
nd
->
flags
|=
LOOKUP_JUMPED
;
}
void
nd_set_link
(
struct
nameidata
*
nd
,
char
*
path
)
{
nd
->
saved_names
[
nd
->
depth
]
=
path
;
}
EXPORT_SYMBOL
(
nd_set_link
);
char
*
nd_get_link
(
struct
nameidata
*
nd
)
{
return
nd
->
saved_names
[
nd
->
depth
];
}
EXPORT_SYMBOL
(
nd_get_link
);
static
inline
void
put_link
(
struct
nameidata
*
nd
,
struct
path
*
link
,
void
*
cookie
)
{
struct
inode
*
inode
=
link
->
dentry
->
d_inode
;
...
...
include/linux/namei.h
View file @
1f55a6ec
...
...
@@ -7,21 +7,10 @@
#include <linux/path.h>
struct
vfsmount
;
struct
nameidata
;
enum
{
MAX_NESTED_LINKS
=
8
};
struct
nameidata
{
struct
path
path
;
struct
qstr
last
;
struct
path
root
;
struct
inode
*
inode
;
/* path.dentry.d_inode */
unsigned
int
flags
;
unsigned
seq
,
m_seq
;
int
last_type
;
unsigned
depth
;
char
*
saved_names
[
MAX_NESTED_LINKS
+
1
];
};
/*
* Type of the last component on LOOKUP_PARENT
*/
...
...
@@ -82,16 +71,8 @@ extern struct dentry *lock_rename(struct dentry *, struct dentry *);
extern
void
unlock_rename
(
struct
dentry
*
,
struct
dentry
*
);
extern
void
nd_jump_link
(
struct
nameidata
*
nd
,
struct
path
*
path
);
static
inline
void
nd_set_link
(
struct
nameidata
*
nd
,
char
*
path
)
{
nd
->
saved_names
[
nd
->
depth
]
=
path
;
}
static
inline
char
*
nd_get_link
(
struct
nameidata
*
nd
)
{
return
nd
->
saved_names
[
nd
->
depth
];
}
extern
void
nd_set_link
(
struct
nameidata
*
nd
,
char
*
path
);
extern
char
*
nd_get_link
(
struct
nameidata
*
nd
);
static
inline
void
nd_terminate_link
(
void
*
name
,
size_t
len
,
size_t
maxlen
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment