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
7880b43b
Commit
7880b43b
authored
Jan 12, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
9p: constify ->d_name handling
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
7ce7d89f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
42 deletions
+42
-42
fs/9p/fid.c
fs/9p/fid.c
+5
-5
fs/9p/vfs_inode.c
fs/9p/vfs_inode.c
+5
-5
fs/9p/vfs_inode_dotl.c
fs/9p/vfs_inode_dotl.c
+10
-10
include/net/9p/9p.h
include/net/9p/9p.h
+4
-4
include/net/9p/client.h
include/net/9p/client.h
+9
-9
net/9p/client.c
net/9p/client.c
+9
-9
No files found.
fs/9p/fid.c
View file @
7880b43b
...
...
@@ -91,10 +91,10 @@ static struct p9_fid *v9fs_fid_find(struct dentry *dentry, kuid_t uid, int any)
* dentry names.
*/
static
int
build_path_from_dentry
(
struct
v9fs_session_info
*
v9ses
,
struct
dentry
*
dentry
,
char
***
names
)
struct
dentry
*
dentry
,
c
onst
unsigned
c
har
***
names
)
{
int
n
=
0
,
i
;
char
**
wnames
;
c
onst
unsigned
c
har
**
wnames
;
struct
dentry
*
ds
;
for
(
ds
=
dentry
;
!
IS_ROOT
(
ds
);
ds
=
ds
->
d_parent
)
...
...
@@ -105,7 +105,7 @@ static int build_path_from_dentry(struct v9fs_session_info *v9ses,
goto
err_out
;
for
(
ds
=
dentry
,
i
=
(
n
-
1
);
i
>=
0
;
i
--
,
ds
=
ds
->
d_parent
)
wnames
[
i
]
=
(
char
*
)
ds
->
d_name
.
name
;
wnames
[
i
]
=
ds
->
d_name
.
name
;
*
names
=
wnames
;
return
n
;
...
...
@@ -117,7 +117,7 @@ static struct p9_fid *v9fs_fid_lookup_with_uid(struct dentry *dentry,
kuid_t
uid
,
int
any
)
{
struct
dentry
*
ds
;
char
**
wnames
,
*
uname
;
c
onst
unsigned
c
har
**
wnames
,
*
uname
;
int
i
,
n
,
l
,
clone
,
access
;
struct
v9fs_session_info
*
v9ses
;
struct
p9_fid
*
fid
,
*
old_fid
=
NULL
;
...
...
@@ -137,7 +137,7 @@ static struct p9_fid *v9fs_fid_lookup_with_uid(struct dentry *dentry,
fid
=
v9fs_fid_find
(
ds
,
uid
,
any
);
if
(
fid
)
{
/* Found the parent fid do a lookup with that */
fid
=
p9_client_walk
(
fid
,
1
,
(
char
**
)
&
dentry
->
d_name
.
name
,
1
);
fid
=
p9_client_walk
(
fid
,
1
,
&
dentry
->
d_name
.
name
,
1
);
goto
fid_out
;
}
up_read
(
&
v9ses
->
rename_sem
);
...
...
fs/9p/vfs_inode.c
View file @
7880b43b
...
...
@@ -643,7 +643,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
struct
dentry
*
dentry
,
char
*
extension
,
u32
perm
,
u8
mode
)
{
int
err
;
char
*
name
;
c
onst
unsigned
c
har
*
name
;
struct
p9_fid
*
dfid
,
*
ofid
,
*
fid
;
struct
inode
*
inode
;
...
...
@@ -652,7 +652,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
err
=
0
;
ofid
=
NULL
;
fid
=
NULL
;
name
=
(
char
*
)
dentry
->
d_name
.
name
;
name
=
dentry
->
d_name
.
name
;
dfid
=
v9fs_parent_fid
(
dentry
);
if
(
IS_ERR
(
dfid
))
{
err
=
PTR_ERR
(
dfid
);
...
...
@@ -788,7 +788,7 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
struct
v9fs_session_info
*
v9ses
;
struct
p9_fid
*
dfid
,
*
fid
;
struct
inode
*
inode
;
char
*
name
;
c
onst
unsigned
c
har
*
name
;
p9_debug
(
P9_DEBUG_VFS
,
"dir: %p dentry: (%pd) %p flags: %x
\n
"
,
dir
,
dentry
,
dentry
,
flags
);
...
...
@@ -802,7 +802,7 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
if
(
IS_ERR
(
dfid
))
return
ERR_CAST
(
dfid
);
name
=
(
char
*
)
dentry
->
d_name
.
name
;
name
=
dentry
->
d_name
.
name
;
fid
=
p9_client_walk
(
dfid
,
1
,
&
name
,
1
);
if
(
IS_ERR
(
fid
))
{
if
(
fid
==
ERR_PTR
(
-
ENOENT
))
{
...
...
@@ -1012,7 +1012,7 @@ v9fs_vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
}
v9fs_blank_wstat
(
&
wstat
);
wstat
.
muid
=
v9ses
->
uname
;
wstat
.
name
=
(
char
*
)
new_dentry
->
d_name
.
name
;
wstat
.
name
=
new_dentry
->
d_name
.
name
;
retval
=
p9_client_wstat
(
oldfid
,
&
wstat
);
clunk_newdir:
...
...
fs/9p/vfs_inode_dotl.c
View file @
7880b43b
...
...
@@ -244,7 +244,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
int
err
=
0
;
kgid_t
gid
;
umode_t
mode
;
char
*
name
=
NULL
;
c
onst
unsigned
c
har
*
name
=
NULL
;
struct
p9_qid
qid
;
struct
inode
*
inode
;
struct
p9_fid
*
fid
=
NULL
;
...
...
@@ -269,7 +269,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
v9ses
=
v9fs_inode2v9ses
(
dir
);
name
=
(
char
*
)
dentry
->
d_name
.
name
;
name
=
dentry
->
d_name
.
name
;
p9_debug
(
P9_DEBUG_VFS
,
"name:%s flags:0x%x mode:0x%hx
\n
"
,
name
,
flags
,
omode
);
...
...
@@ -385,7 +385,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
struct
v9fs_session_info
*
v9ses
;
struct
p9_fid
*
fid
=
NULL
,
*
dfid
=
NULL
;
kgid_t
gid
;
char
*
name
;
c
onst
unsigned
c
har
*
name
;
umode_t
mode
;
struct
inode
*
inode
;
struct
p9_qid
qid
;
...
...
@@ -416,7 +416,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
err
);
goto
error
;
}
name
=
(
char
*
)
dentry
->
d_name
.
name
;
name
=
dentry
->
d_name
.
name
;
err
=
p9_client_mkdir_dotl
(
dfid
,
name
,
mode
,
gid
,
&
qid
);
if
(
err
<
0
)
goto
error
;
...
...
@@ -678,14 +678,14 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
{
int
err
;
kgid_t
gid
;
char
*
name
;
c
onst
unsigned
c
har
*
name
;
struct
p9_qid
qid
;
struct
inode
*
inode
;
struct
p9_fid
*
dfid
;
struct
p9_fid
*
fid
=
NULL
;
struct
v9fs_session_info
*
v9ses
;
name
=
(
char
*
)
dentry
->
d_name
.
name
;
name
=
dentry
->
d_name
.
name
;
p9_debug
(
P9_DEBUG_VFS
,
"%lu,%s,%s
\n
"
,
dir
->
i_ino
,
name
,
symname
);
v9ses
=
v9fs_inode2v9ses
(
dir
);
...
...
@@ -699,7 +699,7 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
gid
=
v9fs_get_fsgid_for_create
(
dir
);
/* Server doesn't alter fid on TSYMLINK. Hence no need to clone it. */
err
=
p9_client_symlink
(
dfid
,
name
,
(
char
*
)
symname
,
gid
,
&
qid
);
err
=
p9_client_symlink
(
dfid
,
name
,
symname
,
gid
,
&
qid
);
if
(
err
<
0
)
{
p9_debug
(
P9_DEBUG_VFS
,
"p9_client_symlink failed %d
\n
"
,
err
);
...
...
@@ -775,7 +775,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,
if
(
IS_ERR
(
oldfid
))
return
PTR_ERR
(
oldfid
);
err
=
p9_client_link
(
dfid
,
oldfid
,
(
char
*
)
dentry
->
d_name
.
name
);
err
=
p9_client_link
(
dfid
,
oldfid
,
dentry
->
d_name
.
name
);
if
(
err
<
0
)
{
p9_debug
(
P9_DEBUG_VFS
,
"p9_client_link failed %d
\n
"
,
err
);
...
...
@@ -812,7 +812,7 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
{
int
err
;
kgid_t
gid
;
char
*
name
;
c
onst
unsigned
c
har
*
name
;
umode_t
mode
;
struct
v9fs_session_info
*
v9ses
;
struct
p9_fid
*
fid
=
NULL
,
*
dfid
=
NULL
;
...
...
@@ -842,7 +842,7 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
err
);
goto
error
;
}
name
=
(
char
*
)
dentry
->
d_name
.
name
;
name
=
dentry
->
d_name
.
name
;
err
=
p9_client_mknod_dotl
(
dfid
,
name
,
mode
,
rdev
,
gid
,
&
qid
);
if
(
err
<
0
)
...
...
include/net/9p/9p.h
View file @
7880b43b
...
...
@@ -402,10 +402,10 @@ struct p9_wstat {
u32
atime
;
u32
mtime
;
u64
length
;
char
*
name
;
char
*
uid
;
char
*
gid
;
char
*
muid
;
c
onst
c
har
*
name
;
c
onst
c
har
*
uid
;
c
onst
c
har
*
gid
;
c
onst
c
har
*
muid
;
char
*
extension
;
/* 9p2000.u extensions */
kuid_t
n_uid
;
/* 9p2000.u extensions */
kgid_t
n_gid
;
/* 9p2000.u extensions */
...
...
include/net/9p/client.h
View file @
7880b43b
...
...
@@ -223,16 +223,16 @@ void p9_client_destroy(struct p9_client *clnt);
void
p9_client_disconnect
(
struct
p9_client
*
clnt
);
void
p9_client_begin_disconnect
(
struct
p9_client
*
clnt
);
struct
p9_fid
*
p9_client_attach
(
struct
p9_client
*
clnt
,
struct
p9_fid
*
afid
,
c
har
*
uname
,
kuid_t
n_uname
,
char
*
aname
);
c
onst
char
*
uname
,
kuid_t
n_uname
,
const
char
*
aname
);
struct
p9_fid
*
p9_client_walk
(
struct
p9_fid
*
oldfid
,
uint16_t
nwname
,
c
har
*
*
wnames
,
int
clone
);
c
onst
unsigned
char
*
const
*
wnames
,
int
clone
);
int
p9_client_open
(
struct
p9_fid
*
fid
,
int
mode
);
int
p9_client_fcreate
(
struct
p9_fid
*
fid
,
char
*
name
,
u32
perm
,
int
mode
,
int
p9_client_fcreate
(
struct
p9_fid
*
fid
,
c
onst
c
har
*
name
,
u32
perm
,
int
mode
,
char
*
extension
);
int
p9_client_link
(
struct
p9_fid
*
fid
,
struct
p9_fid
*
oldfid
,
char
*
newname
);
int
p9_client_symlink
(
struct
p9_fid
*
fid
,
c
har
*
name
,
char
*
symname
,
kgid_t
gid
,
struct
p9_qid
*
qid
);
int
p9_client_create_dotl
(
struct
p9_fid
*
ofid
,
char
*
name
,
u32
flags
,
u32
mode
,
int
p9_client_link
(
struct
p9_fid
*
fid
,
struct
p9_fid
*
oldfid
,
c
onst
c
har
*
newname
);
int
p9_client_symlink
(
struct
p9_fid
*
fid
,
c
onst
char
*
name
,
const
char
*
symname
,
kgid_t
gid
,
struct
p9_qid
*
qid
);
int
p9_client_create_dotl
(
struct
p9_fid
*
ofid
,
c
onst
c
har
*
name
,
u32
flags
,
u32
mode
,
kgid_t
gid
,
struct
p9_qid
*
qid
);
int
p9_client_clunk
(
struct
p9_fid
*
fid
);
int
p9_client_fsync
(
struct
p9_fid
*
fid
,
int
datasync
);
...
...
@@ -250,9 +250,9 @@ int p9_client_setattr(struct p9_fid *fid, struct p9_iattr_dotl *attr);
struct
p9_stat_dotl
*
p9_client_getattr_dotl
(
struct
p9_fid
*
fid
,
u64
request_mask
);
int
p9_client_mknod_dotl
(
struct
p9_fid
*
oldfid
,
char
*
name
,
int
mode
,
int
p9_client_mknod_dotl
(
struct
p9_fid
*
oldfid
,
c
onst
c
har
*
name
,
int
mode
,
dev_t
rdev
,
kgid_t
gid
,
struct
p9_qid
*
);
int
p9_client_mkdir_dotl
(
struct
p9_fid
*
fid
,
char
*
name
,
int
mode
,
int
p9_client_mkdir_dotl
(
struct
p9_fid
*
fid
,
c
onst
c
har
*
name
,
int
mode
,
kgid_t
gid
,
struct
p9_qid
*
);
int
p9_client_lock_dotl
(
struct
p9_fid
*
fid
,
struct
p9_flock
*
flock
,
u8
*
status
);
int
p9_client_getlock_dotl
(
struct
p9_fid
*
fid
,
struct
p9_getlock
*
fl
);
...
...
net/9p/client.c
View file @
7880b43b
...
...
@@ -1101,7 +1101,7 @@ void p9_client_begin_disconnect(struct p9_client *clnt)
EXPORT_SYMBOL
(
p9_client_begin_disconnect
);
struct
p9_fid
*
p9_client_attach
(
struct
p9_client
*
clnt
,
struct
p9_fid
*
afid
,
c
har
*
uname
,
kuid_t
n_uname
,
char
*
aname
)
c
onst
char
*
uname
,
kuid_t
n_uname
,
const
char
*
aname
)
{
int
err
=
0
;
struct
p9_req_t
*
req
;
...
...
@@ -1149,7 +1149,7 @@ struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
EXPORT_SYMBOL
(
p9_client_attach
);
struct
p9_fid
*
p9_client_walk
(
struct
p9_fid
*
oldfid
,
uint16_t
nwname
,
c
har
*
*
wnames
,
int
clone
)
c
onst
unsigned
char
*
const
*
wnames
,
int
clone
)
{
int
err
;
struct
p9_client
*
clnt
;
...
...
@@ -1271,7 +1271,7 @@ int p9_client_open(struct p9_fid *fid, int mode)
}
EXPORT_SYMBOL
(
p9_client_open
);
int
p9_client_create_dotl
(
struct
p9_fid
*
ofid
,
char
*
name
,
u32
flags
,
u32
mode
,
int
p9_client_create_dotl
(
struct
p9_fid
*
ofid
,
c
onst
c
har
*
name
,
u32
flags
,
u32
mode
,
kgid_t
gid
,
struct
p9_qid
*
qid
)
{
int
err
=
0
;
...
...
@@ -1316,7 +1316,7 @@ int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode,
}
EXPORT_SYMBOL
(
p9_client_create_dotl
);
int
p9_client_fcreate
(
struct
p9_fid
*
fid
,
char
*
name
,
u32
perm
,
int
mode
,
int
p9_client_fcreate
(
struct
p9_fid
*
fid
,
c
onst
c
har
*
name
,
u32
perm
,
int
mode
,
char
*
extension
)
{
int
err
;
...
...
@@ -1361,8 +1361,8 @@ int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode,
}
EXPORT_SYMBOL
(
p9_client_fcreate
);
int
p9_client_symlink
(
struct
p9_fid
*
dfid
,
c
har
*
name
,
char
*
symtgt
,
kgid_t
gid
,
struct
p9_qid
*
qid
)
int
p9_client_symlink
(
struct
p9_fid
*
dfid
,
c
onst
char
*
name
,
const
char
*
symtgt
,
kgid_t
gid
,
struct
p9_qid
*
qid
)
{
int
err
=
0
;
struct
p9_client
*
clnt
;
...
...
@@ -1395,7 +1395,7 @@ int p9_client_symlink(struct p9_fid *dfid, char *name, char *symtgt, kgid_t gid,
}
EXPORT_SYMBOL
(
p9_client_symlink
);
int
p9_client_link
(
struct
p9_fid
*
dfid
,
struct
p9_fid
*
oldfid
,
char
*
newname
)
int
p9_client_link
(
struct
p9_fid
*
dfid
,
struct
p9_fid
*
oldfid
,
c
onst
c
har
*
newname
)
{
struct
p9_client
*
clnt
;
struct
p9_req_t
*
req
;
...
...
@@ -2117,7 +2117,7 @@ int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset)
}
EXPORT_SYMBOL
(
p9_client_readdir
);
int
p9_client_mknod_dotl
(
struct
p9_fid
*
fid
,
char
*
name
,
int
mode
,
int
p9_client_mknod_dotl
(
struct
p9_fid
*
fid
,
c
onst
c
har
*
name
,
int
mode
,
dev_t
rdev
,
kgid_t
gid
,
struct
p9_qid
*
qid
)
{
int
err
;
...
...
@@ -2148,7 +2148,7 @@ int p9_client_mknod_dotl(struct p9_fid *fid, char *name, int mode,
}
EXPORT_SYMBOL
(
p9_client_mknod_dotl
);
int
p9_client_mkdir_dotl
(
struct
p9_fid
*
fid
,
char
*
name
,
int
mode
,
int
p9_client_mkdir_dotl
(
struct
p9_fid
*
fid
,
c
onst
c
har
*
name
,
int
mode
,
kgid_t
gid
,
struct
p9_qid
*
qid
)
{
int
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