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
6a96ba54
Commit
6a96ba54
authored
Mar 07, 2011
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kill __lookup_one_len()
only one caller left Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
fe2d35ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
26 deletions
+15
-26
fs/namei.c
fs/namei.c
+15
-26
No files found.
fs/namei.c
View file @
6a96ba54
...
@@ -1759,28 +1759,6 @@ static struct dentry *lookup_hash(struct nameidata *nd)
...
@@ -1759,28 +1759,6 @@ static struct dentry *lookup_hash(struct nameidata *nd)
return
__lookup_hash
(
&
nd
->
last
,
nd
->
path
.
dentry
,
nd
);
return
__lookup_hash
(
&
nd
->
last
,
nd
->
path
.
dentry
,
nd
);
}
}
static
int
__lookup_one_len
(
const
char
*
name
,
struct
qstr
*
this
,
struct
dentry
*
base
,
int
len
)
{
unsigned
long
hash
;
unsigned
int
c
;
this
->
name
=
name
;
this
->
len
=
len
;
if
(
!
len
)
return
-
EACCES
;
hash
=
init_name_hash
();
while
(
len
--
)
{
c
=
*
(
const
unsigned
char
*
)
name
++
;
if
(
c
==
'/'
||
c
==
'\0'
)
return
-
EACCES
;
hash
=
partial_name_hash
(
c
,
hash
);
}
this
->
hash
=
end_name_hash
(
hash
);
return
0
;
}
/**
/**
* lookup_one_len - filesystem helper to lookup single pathname component
* lookup_one_len - filesystem helper to lookup single pathname component
* @name: pathname component to lookup
* @name: pathname component to lookup
...
@@ -1794,14 +1772,25 @@ static int __lookup_one_len(const char *name, struct qstr *this,
...
@@ -1794,14 +1772,25 @@ static int __lookup_one_len(const char *name, struct qstr *this,
*/
*/
struct
dentry
*
lookup_one_len
(
const
char
*
name
,
struct
dentry
*
base
,
int
len
)
struct
dentry
*
lookup_one_len
(
const
char
*
name
,
struct
dentry
*
base
,
int
len
)
{
{
int
err
;
struct
qstr
this
;
struct
qstr
this
;
unsigned
long
hash
;
unsigned
int
c
;
WARN_ON_ONCE
(
!
mutex_is_locked
(
&
base
->
d_inode
->
i_mutex
));
WARN_ON_ONCE
(
!
mutex_is_locked
(
&
base
->
d_inode
->
i_mutex
));
err
=
__lookup_one_len
(
name
,
&
this
,
base
,
len
);
this
.
name
=
name
;
if
(
err
)
this
.
len
=
len
;
return
ERR_PTR
(
err
);
if
(
!
len
)
return
ERR_PTR
(
-
EACCES
);
hash
=
init_name_hash
();
while
(
len
--
)
{
c
=
*
(
const
unsigned
char
*
)
name
++
;
if
(
c
==
'/'
||
c
==
'\0'
)
return
ERR_PTR
(
-
EACCES
);
hash
=
partial_name_hash
(
c
,
hash
);
}
this
.
hash
=
end_name_hash
(
hash
);
return
__lookup_hash
(
&
this
,
base
,
NULL
);
return
__lookup_hash
(
&
this
,
base
,
NULL
);
}
}
...
...
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