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
2d864651
Commit
2d864651
authored
Sep 08, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce kern_path_mountpoint()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
197df04c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
11 deletions
+25
-11
fs/namei.c
fs/namei.c
+24
-11
include/linux/namei.h
include/linux/namei.h
+1
-0
No files found.
fs/namei.c
View file @
2d864651
...
...
@@ -2360,6 +2360,20 @@ path_mountpoint(int dfd, const char *name, struct path *path, unsigned int flags
return
err
;
}
static
int
filename_mountpoint
(
int
dfd
,
struct
filename
*
s
,
struct
path
*
path
,
unsigned
int
flags
)
{
int
error
=
path_mountpoint
(
dfd
,
s
->
name
,
path
,
flags
|
LOOKUP_RCU
);
if
(
unlikely
(
error
==
-
ECHILD
))
error
=
path_mountpoint
(
dfd
,
s
->
name
,
path
,
flags
);
if
(
unlikely
(
error
==
-
ESTALE
))
error
=
path_mountpoint
(
dfd
,
s
->
name
,
path
,
flags
|
LOOKUP_REVAL
);
if
(
likely
(
!
error
))
audit_inode
(
s
,
path
->
dentry
,
0
);
return
error
;
}
/**
* user_path_mountpoint_at - lookup a path from userland in order to umount it
* @dfd: directory file descriptor
...
...
@@ -2380,23 +2394,22 @@ user_path_mountpoint_at(int dfd, const char __user *name, unsigned int flags,
{
struct
filename
*
s
=
getname
(
name
);
int
error
;
if
(
IS_ERR
(
s
))
return
PTR_ERR
(
s
);
error
=
path_mountpoint
(
dfd
,
s
->
name
,
path
,
flags
|
LOOKUP_RCU
);
if
(
unlikely
(
error
==
-
ECHILD
))
error
=
path_mountpoint
(
dfd
,
s
->
name
,
path
,
flags
);
if
(
unlikely
(
error
==
-
ESTALE
))
error
=
path_mountpoint
(
dfd
,
s
->
name
,
path
,
flags
|
LOOKUP_REVAL
);
if
(
likely
(
!
error
))
audit_inode
(
s
,
path
->
dentry
,
0
);
error
=
filename_mountpoint
(
dfd
,
s
,
path
,
flags
);
putname
(
s
);
return
error
;
}
int
kern_path_mountpoint
(
int
dfd
,
const
char
*
name
,
struct
path
*
path
,
unsigned
int
flags
)
{
struct
filename
s
=
{.
name
=
name
};
return
filename_mountpoint
(
dfd
,
&
s
,
path
,
flags
);
}
EXPORT_SYMBOL
(
kern_path_mountpoint
);
/*
* It's inline, so penalty for filesystems that don't use sticky bit is
* minimal.
...
...
include/linux/namei.h
View file @
2d864651
...
...
@@ -70,6 +70,7 @@ extern struct dentry *kern_path_create(int, const char *, struct path *, unsigne
extern
struct
dentry
*
user_path_create
(
int
,
const
char
__user
*
,
struct
path
*
,
unsigned
int
);
extern
void
done_path_create
(
struct
path
*
,
struct
dentry
*
);
extern
struct
dentry
*
kern_path_locked
(
const
char
*
,
struct
path
*
);
extern
int
kern_path_mountpoint
(
int
,
const
char
*
,
struct
path
*
,
unsigned
int
);
extern
struct
dentry
*
lookup_one_len
(
const
char
*
,
struct
dentry
*
,
int
);
...
...
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