Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AndroidKernelMSM
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Werner Sembach
AndroidKernelMSM
Commits
69753a0f
Commit
69753a0f
authored
Jun 27, 2011
by
Al Viro
Browse files
Options
Downloads
Patches
Plain Diff
switch devtmpfs to kern_path_create()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
2780f1ff
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/base/devtmpfs.c
+36
-47
36 additions, 47 deletions
drivers/base/devtmpfs.c
with
36 additions
and
47 deletions
drivers/base/devtmpfs.c
+
36
−
47
View file @
69753a0f
...
...
@@ -144,27 +144,21 @@ int devtmpfs_delete_node(struct device *dev)
static
int
dev_mkdir
(
const
char
*
name
,
mode_t
mode
)
{
struct
nameidata
nd
;
struct
dentry
*
dentry
;
struct
path
path
;
int
err
;
err
=
kern_path_
parent
(
name
,
&
nd
);
if
(
err
)
return
err
;
dentry
=
kern_path_
create
(
AT_FDCWD
,
name
,
&
path
,
1
);
if
(
IS_ERR
(
dentry
)
)
return
PTR_ERR
(
dentry
)
;
dentry
=
lookup_create
(
&
nd
,
1
);
if
(
!
IS_ERR
(
dentry
))
{
err
=
vfs_mkdir
(
nd
.
path
.
dentry
->
d_inode
,
dentry
,
mode
);
err
=
vfs_mkdir
(
path
.
dentry
->
d_inode
,
dentry
,
mode
);
if
(
!
err
)
/* mark as kernel-created inode */
dentry
->
d_inode
->
i_private
=
&
thread
;
dput
(
dentry
);
}
else
{
err
=
PTR_ERR
(
dentry
);
}
mutex_unlock
(
&
nd
.
path
.
dentry
->
d_inode
->
i_mutex
);
path_put
(
&
nd
.
path
);
mutex_unlock
(
&
path
.
dentry
->
d_inode
->
i_mutex
);
path_put
(
&
path
);
return
err
;
}
...
...
@@ -203,21 +197,19 @@ out:
static
int
handle_create
(
const
char
*
nodename
,
mode_t
mode
,
struct
device
*
dev
)
{
struct
nameidata
nd
;
struct
dentry
*
dentry
;
struct
path
path
;
int
err
;
err
=
kern_path_
parent
(
nodename
,
&
nd
);
if
(
err
==
-
ENOENT
)
{
dentry
=
kern_path_
create
(
AT_FDCWD
,
nodename
,
&
path
,
0
);
if
(
dentry
==
ERR_PTR
(
-
ENOENT
)
)
{
create_path
(
nodename
);
err
=
kern_path_
parent
(
nodename
,
&
nd
);
dentry
=
kern_path_
create
(
AT_FDCWD
,
nodename
,
&
path
,
0
);
}
if
(
err
)
return
err
;
if
(
IS_ERR
(
dentry
)
)
return
PTR_ERR
(
dentry
)
;
dentry
=
lookup_create
(
&
nd
,
0
);
if
(
!
IS_ERR
(
dentry
))
{
err
=
vfs_mknod
(
nd
.
path
.
dentry
->
d_inode
,
err
=
vfs_mknod
(
path
.
dentry
->
d_inode
,
dentry
,
mode
,
dev
->
devt
);
if
(
!
err
)
{
struct
iattr
newattrs
;
...
...
@@ -233,12 +225,9 @@ static int handle_create(const char *nodename, mode_t mode, struct device *dev)
dentry
->
d_inode
->
i_private
=
&
thread
;
}
dput
(
dentry
);
}
else
{
err
=
PTR_ERR
(
dentry
);
}
mutex_unlock
(
&
nd
.
path
.
dentry
->
d_inode
->
i_mutex
);
path_put
(
&
nd
.
path
);
mutex_unlock
(
&
path
.
dentry
->
d_inode
->
i_mutex
);
path_put
(
&
path
);
return
err
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment