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
nexedi
linux
Commits
77d5a6b7
Commit
77d5a6b7
authored
May 29, 2016
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
9p: new helper - v9fs_parent_fid()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
acc29fb8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
16 deletions
+14
-16
fs/9p/fid.h
fs/9p/fid.h
+4
-0
fs/9p/vfs_inode.c
fs/9p/vfs_inode.c
+5
-5
fs/9p/vfs_inode_dotl.c
fs/9p/vfs_inode_dotl.c
+5
-11
No files found.
fs/9p/fid.h
View file @
77d5a6b7
...
@@ -24,6 +24,10 @@
...
@@ -24,6 +24,10 @@
#include <linux/list.h>
#include <linux/list.h>
struct
p9_fid
*
v9fs_fid_lookup
(
struct
dentry
*
dentry
);
struct
p9_fid
*
v9fs_fid_lookup
(
struct
dentry
*
dentry
);
static
inline
struct
p9_fid
*
v9fs_parent_fid
(
struct
dentry
*
dentry
)
{
return
v9fs_fid_lookup
(
dentry
->
d_parent
);
}
struct
p9_fid
*
v9fs_fid_clone
(
struct
dentry
*
dentry
);
struct
p9_fid
*
v9fs_fid_clone
(
struct
dentry
*
dentry
);
void
v9fs_fid_add
(
struct
dentry
*
dentry
,
struct
p9_fid
*
fid
);
void
v9fs_fid_add
(
struct
dentry
*
dentry
,
struct
p9_fid
*
fid
);
struct
p9_fid
*
v9fs_writeback_fid
(
struct
dentry
*
dentry
);
struct
p9_fid
*
v9fs_writeback_fid
(
struct
dentry
*
dentry
);
...
...
fs/9p/vfs_inode.c
View file @
77d5a6b7
...
@@ -595,7 +595,7 @@ static int v9fs_remove(struct inode *dir, struct dentry *dentry, int flags)
...
@@ -595,7 +595,7 @@ static int v9fs_remove(struct inode *dir, struct dentry *dentry, int flags)
v9ses
=
v9fs_inode2v9ses
(
dir
);
v9ses
=
v9fs_inode2v9ses
(
dir
);
inode
=
d_inode
(
dentry
);
inode
=
d_inode
(
dentry
);
dfid
=
v9fs_
fid_lookup
(
dentry
->
d_parent
);
dfid
=
v9fs_
parent_fid
(
dentry
);
if
(
IS_ERR
(
dfid
))
{
if
(
IS_ERR
(
dfid
))
{
retval
=
PTR_ERR
(
dfid
);
retval
=
PTR_ERR
(
dfid
);
p9_debug
(
P9_DEBUG_VFS
,
"fid lookup failed %d
\n
"
,
retval
);
p9_debug
(
P9_DEBUG_VFS
,
"fid lookup failed %d
\n
"
,
retval
);
...
@@ -653,7 +653,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
...
@@ -653,7 +653,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
ofid
=
NULL
;
ofid
=
NULL
;
fid
=
NULL
;
fid
=
NULL
;
name
=
(
char
*
)
dentry
->
d_name
.
name
;
name
=
(
char
*
)
dentry
->
d_name
.
name
;
dfid
=
v9fs_
fid_lookup
(
dentry
->
d_parent
);
dfid
=
v9fs_
parent_fid
(
dentry
);
if
(
IS_ERR
(
dfid
))
{
if
(
IS_ERR
(
dfid
))
{
err
=
PTR_ERR
(
dfid
);
err
=
PTR_ERR
(
dfid
);
p9_debug
(
P9_DEBUG_VFS
,
"fid lookup failed %d
\n
"
,
err
);
p9_debug
(
P9_DEBUG_VFS
,
"fid lookup failed %d
\n
"
,
err
);
...
@@ -798,7 +798,7 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
...
@@ -798,7 +798,7 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
v9ses
=
v9fs_inode2v9ses
(
dir
);
v9ses
=
v9fs_inode2v9ses
(
dir
);
/* We can walk d_parent because we hold the dir->i_mutex */
/* We can walk d_parent because we hold the dir->i_mutex */
dfid
=
v9fs_
fid_lookup
(
dentry
->
d_parent
);
dfid
=
v9fs_
parent_fid
(
dentry
);
if
(
IS_ERR
(
dfid
))
if
(
IS_ERR
(
dfid
))
return
ERR_CAST
(
dfid
);
return
ERR_CAST
(
dfid
);
...
@@ -975,13 +975,13 @@ v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
...
@@ -975,13 +975,13 @@ v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
if
(
IS_ERR
(
oldfid
))
if
(
IS_ERR
(
oldfid
))
return
PTR_ERR
(
oldfid
);
return
PTR_ERR
(
oldfid
);
olddirfid
=
v9fs_
fid_clone
(
old_dentry
->
d_parent
);
olddirfid
=
v9fs_
parent_fid
(
old_dentry
);
if
(
IS_ERR
(
olddirfid
))
{
if
(
IS_ERR
(
olddirfid
))
{
retval
=
PTR_ERR
(
olddirfid
);
retval
=
PTR_ERR
(
olddirfid
);
goto
done
;
goto
done
;
}
}
newdirfid
=
v9fs_
fid_clone
(
new_dentry
->
d_parent
);
newdirfid
=
v9fs_
parent_fid
(
new_dentry
);
if
(
IS_ERR
(
newdirfid
))
{
if
(
IS_ERR
(
newdirfid
))
{
retval
=
PTR_ERR
(
newdirfid
);
retval
=
PTR_ERR
(
newdirfid
);
goto
clunk_olddir
;
goto
clunk_olddir
;
...
...
fs/9p/vfs_inode_dotl.c
View file @
77d5a6b7
...
@@ -273,7 +273,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
...
@@ -273,7 +273,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
p9_debug
(
P9_DEBUG_VFS
,
"name:%s flags:0x%x mode:0x%hx
\n
"
,
p9_debug
(
P9_DEBUG_VFS
,
"name:%s flags:0x%x mode:0x%hx
\n
"
,
name
,
flags
,
omode
);
name
,
flags
,
omode
);
dfid
=
v9fs_
fid_lookup
(
dentry
->
d_parent
);
dfid
=
v9fs_
parent_fid
(
dentry
);
if
(
IS_ERR
(
dfid
))
{
if
(
IS_ERR
(
dfid
))
{
err
=
PTR_ERR
(
dfid
);
err
=
PTR_ERR
(
dfid
);
p9_debug
(
P9_DEBUG_VFS
,
"fid lookup failed %d
\n
"
,
err
);
p9_debug
(
P9_DEBUG_VFS
,
"fid lookup failed %d
\n
"
,
err
);
...
@@ -389,7 +389,6 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
...
@@ -389,7 +389,6 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
umode_t
mode
;
umode_t
mode
;
struct
inode
*
inode
;
struct
inode
*
inode
;
struct
p9_qid
qid
;
struct
p9_qid
qid
;
struct
dentry
*
dir_dentry
;
struct
posix_acl
*
dacl
=
NULL
,
*
pacl
=
NULL
;
struct
posix_acl
*
dacl
=
NULL
,
*
pacl
=
NULL
;
p9_debug
(
P9_DEBUG_VFS
,
"name %pd
\n
"
,
dentry
);
p9_debug
(
P9_DEBUG_VFS
,
"name %pd
\n
"
,
dentry
);
...
@@ -400,8 +399,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
...
@@ -400,8 +399,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
if
(
dir
->
i_mode
&
S_ISGID
)
if
(
dir
->
i_mode
&
S_ISGID
)
omode
|=
S_ISGID
;
omode
|=
S_ISGID
;
dir_dentry
=
dentry
->
d_parent
;
dfid
=
v9fs_parent_fid
(
dentry
);
dfid
=
v9fs_fid_lookup
(
dir_dentry
);
if
(
IS_ERR
(
dfid
))
{
if
(
IS_ERR
(
dfid
))
{
err
=
PTR_ERR
(
dfid
);
err
=
PTR_ERR
(
dfid
);
p9_debug
(
P9_DEBUG_VFS
,
"fid lookup failed %d
\n
"
,
err
);
p9_debug
(
P9_DEBUG_VFS
,
"fid lookup failed %d
\n
"
,
err
);
...
@@ -691,7 +689,7 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
...
@@ -691,7 +689,7 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
p9_debug
(
P9_DEBUG_VFS
,
"%lu,%s,%s
\n
"
,
dir
->
i_ino
,
name
,
symname
);
p9_debug
(
P9_DEBUG_VFS
,
"%lu,%s,%s
\n
"
,
dir
->
i_ino
,
name
,
symname
);
v9ses
=
v9fs_inode2v9ses
(
dir
);
v9ses
=
v9fs_inode2v9ses
(
dir
);
dfid
=
v9fs_
fid_lookup
(
dentry
->
d_parent
);
dfid
=
v9fs_
parent_fid
(
dentry
);
if
(
IS_ERR
(
dfid
))
{
if
(
IS_ERR
(
dfid
))
{
err
=
PTR_ERR
(
dfid
);
err
=
PTR_ERR
(
dfid
);
p9_debug
(
P9_DEBUG_VFS
,
"fid lookup failed %d
\n
"
,
err
);
p9_debug
(
P9_DEBUG_VFS
,
"fid lookup failed %d
\n
"
,
err
);
...
@@ -762,7 +760,6 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,
...
@@ -762,7 +760,6 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,
struct
dentry
*
dentry
)
struct
dentry
*
dentry
)
{
{
int
err
;
int
err
;
struct
dentry
*
dir_dentry
;
struct
p9_fid
*
dfid
,
*
oldfid
;
struct
p9_fid
*
dfid
,
*
oldfid
;
struct
v9fs_session_info
*
v9ses
;
struct
v9fs_session_info
*
v9ses
;
...
@@ -770,8 +767,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,
...
@@ -770,8 +767,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,
dir
->
i_ino
,
old_dentry
,
dentry
);
dir
->
i_ino
,
old_dentry
,
dentry
);
v9ses
=
v9fs_inode2v9ses
(
dir
);
v9ses
=
v9fs_inode2v9ses
(
dir
);
dir_dentry
=
dentry
->
d_parent
;
dfid
=
v9fs_parent_fid
(
dentry
);
dfid
=
v9fs_fid_lookup
(
dir_dentry
);
if
(
IS_ERR
(
dfid
))
if
(
IS_ERR
(
dfid
))
return
PTR_ERR
(
dfid
);
return
PTR_ERR
(
dfid
);
...
@@ -822,7 +818,6 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
...
@@ -822,7 +818,6 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
struct
p9_fid
*
fid
=
NULL
,
*
dfid
=
NULL
;
struct
p9_fid
*
fid
=
NULL
,
*
dfid
=
NULL
;
struct
inode
*
inode
;
struct
inode
*
inode
;
struct
p9_qid
qid
;
struct
p9_qid
qid
;
struct
dentry
*
dir_dentry
;
struct
posix_acl
*
dacl
=
NULL
,
*
pacl
=
NULL
;
struct
posix_acl
*
dacl
=
NULL
,
*
pacl
=
NULL
;
p9_debug
(
P9_DEBUG_VFS
,
" %lu,%pd mode: %hx MAJOR: %u MINOR: %u
\n
"
,
p9_debug
(
P9_DEBUG_VFS
,
" %lu,%pd mode: %hx MAJOR: %u MINOR: %u
\n
"
,
...
@@ -830,8 +825,7 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
...
@@ -830,8 +825,7 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
MAJOR
(
rdev
),
MINOR
(
rdev
));
MAJOR
(
rdev
),
MINOR
(
rdev
));
v9ses
=
v9fs_inode2v9ses
(
dir
);
v9ses
=
v9fs_inode2v9ses
(
dir
);
dir_dentry
=
dentry
->
d_parent
;
dfid
=
v9fs_parent_fid
(
dentry
);
dfid
=
v9fs_fid_lookup
(
dir_dentry
);
if
(
IS_ERR
(
dfid
))
{
if
(
IS_ERR
(
dfid
))
{
err
=
PTR_ERR
(
dfid
);
err
=
PTR_ERR
(
dfid
);
p9_debug
(
P9_DEBUG_VFS
,
"fid lookup failed %d
\n
"
,
err
);
p9_debug
(
P9_DEBUG_VFS
,
"fid lookup failed %d
\n
"
,
err
);
...
...
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