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
80e5d1ff
Commit
80e5d1ff
authored
Apr 15, 2021
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
useful constants: struct qstr for ".."
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
d692d397
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
11 additions
and
17 deletions
+11
-17
fs/dcache.c
fs/dcache.c
+2
-0
fs/ext2/namei.c
fs/ext2/namei.c
+1
-2
fs/ext4/namei.c
fs/ext4/namei.c
+1
-2
fs/f2fs/dir.c
fs/f2fs/dir.c
+1
-3
fs/f2fs/namei.c
fs/f2fs/namei.c
+1
-2
fs/fuse/inode.c
fs/fuse/inode.c
+1
-2
fs/nilfs2/namei.c
fs/nilfs2/namei.c
+1
-2
fs/udf/namei.c
fs/udf/namei.c
+1
-2
fs/ufs/super.c
fs/ufs/super.c
+1
-2
include/linux/dcache.h
include/linux/dcache.h
+1
-0
No files found.
fs/dcache.c
View file @
80e5d1ff
...
@@ -84,6 +84,8 @@ const struct qstr empty_name = QSTR_INIT("", 0);
...
@@ -84,6 +84,8 @@ const struct qstr empty_name = QSTR_INIT("", 0);
EXPORT_SYMBOL
(
empty_name
);
EXPORT_SYMBOL
(
empty_name
);
const
struct
qstr
slash_name
=
QSTR_INIT
(
"/"
,
1
);
const
struct
qstr
slash_name
=
QSTR_INIT
(
"/"
,
1
);
EXPORT_SYMBOL
(
slash_name
);
EXPORT_SYMBOL
(
slash_name
);
const
struct
qstr
dotdot_name
=
QSTR_INIT
(
".."
,
2
);
EXPORT_SYMBOL
(
dotdot_name
);
/*
/*
* This is the single most critical data structure when it comes
* This is the single most critical data structure when it comes
...
...
fs/ext2/namei.c
View file @
80e5d1ff
...
@@ -81,11 +81,10 @@ static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, uns
...
@@ -81,11 +81,10 @@ static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, uns
struct
dentry
*
ext2_get_parent
(
struct
dentry
*
child
)
struct
dentry
*
ext2_get_parent
(
struct
dentry
*
child
)
{
{
struct
qstr
dotdot
=
QSTR_INIT
(
".."
,
2
);
ino_t
ino
;
ino_t
ino
;
int
res
;
int
res
;
res
=
ext2_inode_by_name
(
d_inode
(
child
),
&
dotdot
,
&
ino
);
res
=
ext2_inode_by_name
(
d_inode
(
child
),
&
dotdot
_name
,
&
ino
);
if
(
res
)
if
(
res
)
return
ERR_PTR
(
res
);
return
ERR_PTR
(
res
);
...
...
fs/ext4/namei.c
View file @
80e5d1ff
...
@@ -1739,11 +1739,10 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsi
...
@@ -1739,11 +1739,10 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsi
struct
dentry
*
ext4_get_parent
(
struct
dentry
*
child
)
struct
dentry
*
ext4_get_parent
(
struct
dentry
*
child
)
{
{
__u32
ino
;
__u32
ino
;
static
const
struct
qstr
dotdot
=
QSTR_INIT
(
".."
,
2
);
struct
ext4_dir_entry_2
*
de
;
struct
ext4_dir_entry_2
*
de
;
struct
buffer_head
*
bh
;
struct
buffer_head
*
bh
;
bh
=
ext4_find_entry
(
d_inode
(
child
),
&
dotdot
,
&
de
,
NULL
);
bh
=
ext4_find_entry
(
d_inode
(
child
),
&
dotdot
_name
,
&
de
,
NULL
);
if
(
IS_ERR
(
bh
))
if
(
IS_ERR
(
bh
))
return
ERR_CAST
(
bh
);
return
ERR_CAST
(
bh
);
if
(
!
bh
)
if
(
!
bh
)
...
...
fs/f2fs/dir.c
View file @
80e5d1ff
...
@@ -449,9 +449,7 @@ struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir,
...
@@ -449,9 +449,7 @@ struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir,
struct
f2fs_dir_entry
*
f2fs_parent_dir
(
struct
inode
*
dir
,
struct
page
**
p
)
struct
f2fs_dir_entry
*
f2fs_parent_dir
(
struct
inode
*
dir
,
struct
page
**
p
)
{
{
struct
qstr
dotdot
=
QSTR_INIT
(
".."
,
2
);
return
f2fs_find_entry
(
dir
,
&
dotdot_name
,
p
);
return
f2fs_find_entry
(
dir
,
&
dotdot
,
p
);
}
}
ino_t
f2fs_inode_by_name
(
struct
inode
*
dir
,
const
struct
qstr
*
qstr
,
ino_t
f2fs_inode_by_name
(
struct
inode
*
dir
,
const
struct
qstr
*
qstr
,
...
...
fs/f2fs/namei.c
View file @
80e5d1ff
...
@@ -416,9 +416,8 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir,
...
@@ -416,9 +416,8 @@ static int f2fs_link(struct dentry *old_dentry, struct inode *dir,
struct
dentry
*
f2fs_get_parent
(
struct
dentry
*
child
)
struct
dentry
*
f2fs_get_parent
(
struct
dentry
*
child
)
{
{
struct
qstr
dotdot
=
QSTR_INIT
(
".."
,
2
);
struct
page
*
page
;
struct
page
*
page
;
unsigned
long
ino
=
f2fs_inode_by_name
(
d_inode
(
child
),
&
dotdot
,
&
page
);
unsigned
long
ino
=
f2fs_inode_by_name
(
d_inode
(
child
),
&
dotdot
_name
,
&
page
);
if
(
!
ino
)
{
if
(
!
ino
)
{
if
(
IS_ERR
(
page
))
if
(
IS_ERR
(
page
))
return
ERR_CAST
(
page
);
return
ERR_CAST
(
page
);
...
...
fs/fuse/inode.c
View file @
80e5d1ff
...
@@ -872,14 +872,13 @@ static struct dentry *fuse_get_parent(struct dentry *child)
...
@@ -872,14 +872,13 @@ static struct dentry *fuse_get_parent(struct dentry *child)
struct
inode
*
inode
;
struct
inode
*
inode
;
struct
dentry
*
parent
;
struct
dentry
*
parent
;
struct
fuse_entry_out
outarg
;
struct
fuse_entry_out
outarg
;
const
struct
qstr
name
=
QSTR_INIT
(
".."
,
2
);
int
err
;
int
err
;
if
(
!
fc
->
export_support
)
if
(
!
fc
->
export_support
)
return
ERR_PTR
(
-
ESTALE
);
return
ERR_PTR
(
-
ESTALE
);
err
=
fuse_lookup_name
(
child_inode
->
i_sb
,
get_node_id
(
child_inode
),
err
=
fuse_lookup_name
(
child_inode
->
i_sb
,
get_node_id
(
child_inode
),
&
name
,
&
outarg
,
&
inode
);
&
dotdot_
name
,
&
outarg
,
&
inode
);
if
(
err
)
{
if
(
err
)
{
if
(
err
==
-
ENOENT
)
if
(
err
==
-
ENOENT
)
return
ERR_PTR
(
-
ESTALE
);
return
ERR_PTR
(
-
ESTALE
);
...
...
fs/nilfs2/namei.c
View file @
80e5d1ff
...
@@ -440,10 +440,9 @@ static struct dentry *nilfs_get_parent(struct dentry *child)
...
@@ -440,10 +440,9 @@ static struct dentry *nilfs_get_parent(struct dentry *child)
{
{
unsigned
long
ino
;
unsigned
long
ino
;
struct
inode
*
inode
;
struct
inode
*
inode
;
struct
qstr
dotdot
=
QSTR_INIT
(
".."
,
2
);
struct
nilfs_root
*
root
;
struct
nilfs_root
*
root
;
ino
=
nilfs_inode_by_name
(
d_inode
(
child
),
&
dotdot
);
ino
=
nilfs_inode_by_name
(
d_inode
(
child
),
&
dotdot
_name
);
if
(
!
ino
)
if
(
!
ino
)
return
ERR_PTR
(
-
ENOENT
);
return
ERR_PTR
(
-
ENOENT
);
...
...
fs/udf/namei.c
View file @
80e5d1ff
...
@@ -1215,11 +1215,10 @@ static struct dentry *udf_get_parent(struct dentry *child)
...
@@ -1215,11 +1215,10 @@ static struct dentry *udf_get_parent(struct dentry *child)
{
{
struct
kernel_lb_addr
tloc
;
struct
kernel_lb_addr
tloc
;
struct
inode
*
inode
=
NULL
;
struct
inode
*
inode
=
NULL
;
struct
qstr
dotdot
=
QSTR_INIT
(
".."
,
2
);
struct
fileIdentDesc
cfi
;
struct
fileIdentDesc
cfi
;
struct
udf_fileident_bh
fibh
;
struct
udf_fileident_bh
fibh
;
if
(
!
udf_find_entry
(
d_inode
(
child
),
&
dotdot
,
&
fibh
,
&
cfi
))
if
(
!
udf_find_entry
(
d_inode
(
child
),
&
dotdot
_name
,
&
fibh
,
&
cfi
))
return
ERR_PTR
(
-
EACCES
);
return
ERR_PTR
(
-
EACCES
);
if
(
fibh
.
sbh
!=
fibh
.
ebh
)
if
(
fibh
.
sbh
!=
fibh
.
ebh
)
...
...
fs/ufs/super.c
View file @
80e5d1ff
...
@@ -128,10 +128,9 @@ static struct dentry *ufs_fh_to_parent(struct super_block *sb, struct fid *fid,
...
@@ -128,10 +128,9 @@ static struct dentry *ufs_fh_to_parent(struct super_block *sb, struct fid *fid,
static
struct
dentry
*
ufs_get_parent
(
struct
dentry
*
child
)
static
struct
dentry
*
ufs_get_parent
(
struct
dentry
*
child
)
{
{
struct
qstr
dot_dot
=
QSTR_INIT
(
".."
,
2
);
ino_t
ino
;
ino_t
ino
;
ino
=
ufs_inode_by_name
(
d_inode
(
child
),
&
dot
_dot
);
ino
=
ufs_inode_by_name
(
d_inode
(
child
),
&
dot
dot_name
);
if
(
!
ino
)
if
(
!
ino
)
return
ERR_PTR
(
-
ENOENT
);
return
ERR_PTR
(
-
ENOENT
);
return
d_obtain_alias
(
ufs_iget
(
child
->
d_sb
,
ino
));
return
d_obtain_alias
(
ufs_iget
(
child
->
d_sb
,
ino
));
...
...
include/linux/dcache.h
View file @
80e5d1ff
...
@@ -59,6 +59,7 @@ struct qstr {
...
@@ -59,6 +59,7 @@ struct qstr {
extern
const
struct
qstr
empty_name
;
extern
const
struct
qstr
empty_name
;
extern
const
struct
qstr
slash_name
;
extern
const
struct
qstr
slash_name
;
extern
const
struct
qstr
dotdot_name
;
struct
dentry_stat_t
{
struct
dentry_stat_t
{
long
nr_dentry
;
long
nr_dentry
;
...
...
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