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
906fd2d2
Commit
906fd2d2
authored
Mar 10, 2005
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFS: mkdir() cleanup
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
4e593930
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
47 deletions
+38
-47
fs/nfs/dir.c
fs/nfs/dir.c
+1
-15
fs/nfs/nfs3proc.c
fs/nfs/nfs3proc.c
+11
-9
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+14
-13
fs/nfs/proc.c
fs/nfs/proc.c
+11
-8
include/linux/nfs_xdr.h
include/linux/nfs_xdr.h
+1
-2
No files found.
fs/nfs/dir.c
View file @
906fd2d2
...
...
@@ -1067,8 +1067,6 @@ nfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
static
int
nfs_mkdir
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
int
mode
)
{
struct
iattr
attr
;
struct
nfs_fattr
fattr
;
struct
nfs_fh
fhandle
;
int
error
;
dfprintk
(
VFS
,
"NFS: mkdir(%s/%ld, %s
\n
"
,
dir
->
i_sb
->
s_id
,
...
...
@@ -1078,21 +1076,9 @@ static int nfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
attr
.
ia_mode
=
mode
|
S_IFDIR
;
lock_kernel
();
#if 0
/*
* Always drop the dentry, we can't always depend on
* the fattr returned by the server (AIX seems to be
* broken). We're better off doing another lookup than
* depending on potentially bogus information.
*/
d_drop(dentry);
#endif
nfs_begin_data_update
(
dir
);
error
=
NFS_PROTO
(
dir
)
->
mkdir
(
dir
,
&
dentry
->
d_name
,
&
attr
,
&
fhandle
,
&
fattr
);
error
=
NFS_PROTO
(
dir
)
->
mkdir
(
dir
,
dentry
,
&
attr
);
nfs_end_data_update
(
dir
);
if
(
!
error
)
error
=
nfs_instantiate
(
dentry
,
&
fhandle
,
&
fattr
);
if
(
error
!=
0
)
goto
out_err
;
nfs_renew_times
(
dentry
);
...
...
fs/nfs/nfs3proc.c
View file @
906fd2d2
...
...
@@ -540,28 +540,30 @@ nfs3_proc_symlink(struct inode *dir, struct qstr *name, struct qstr *path,
}
static
int
nfs3_proc_mkdir
(
struct
inode
*
dir
,
struct
qstr
*
name
,
struct
iattr
*
sattr
,
struct
nfs_fh
*
fhandle
,
struct
nfs_fattr
*
fattr
)
nfs3_proc_mkdir
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
struct
iattr
*
sattr
)
{
struct
nfs_fattr
dir_attr
;
struct
nfs_fh
fhandle
;
struct
nfs_fattr
fattr
,
dir_attr
;
struct
nfs3_mkdirargs
arg
=
{
.
fh
=
NFS_FH
(
dir
),
.
name
=
name
->
name
,
.
len
=
name
->
len
,
.
name
=
dentry
->
d_name
.
name
,
.
len
=
dentry
->
d_name
.
len
,
.
sattr
=
sattr
};
struct
nfs3_diropres
res
=
{
.
dir_attr
=
&
dir_attr
,
.
fh
=
fhandle
,
.
fattr
=
fattr
.
fh
=
&
fhandle
,
.
fattr
=
&
fattr
};
int
status
;
dprintk
(
"NFS call mkdir %s
\n
"
,
name
->
name
);
dprintk
(
"NFS call mkdir %s
\n
"
,
dentry
->
d_name
.
name
);
dir_attr
.
valid
=
0
;
fattr
->
valid
=
0
;
fattr
.
valid
=
0
;
status
=
rpc_call
(
NFS_CLIENT
(
dir
),
NFS3PROC_MKDIR
,
&
arg
,
&
res
,
0
);
nfs_refresh_inode
(
dir
,
&
dir_attr
);
if
(
status
==
0
)
status
=
nfs_instantiate
(
dentry
,
&
fhandle
,
&
fattr
);
dprintk
(
"NFS reply mkdir: %d
\n
"
,
status
);
return
status
;
}
...
...
fs/nfs/nfs4proc.c
View file @
906fd2d2
...
...
@@ -1663,23 +1663,24 @@ static int nfs4_proc_symlink(struct inode *dir, struct qstr *name,
return
err
;
}
static
int
_nfs4_proc_mkdir
(
struct
inode
*
dir
,
struct
qstr
*
name
,
struct
iattr
*
sattr
,
struct
nfs_fh
*
fhandle
,
struct
nfs_fattr
*
fattr
)
static
int
_nfs4_proc_mkdir
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
struct
iattr
*
sattr
)
{
struct
nfs_server
*
server
=
NFS_SERVER
(
dir
);
struct
nfs_fh
fhandle
;
struct
nfs_fattr
fattr
;
struct
nfs4_create_arg
arg
=
{
.
dir_fh
=
NFS_FH
(
dir
),
.
server
=
server
,
.
name
=
name
,
.
name
=
&
dentry
->
d_
name
,
.
attrs
=
sattr
,
.
ftype
=
NF4DIR
,
.
bitmask
=
server
->
attr_bitmask
,
};
struct
nfs4_create_res
res
=
{
.
server
=
server
,
.
fh
=
fhandle
,
.
fattr
=
fattr
,
.
fh
=
&
fhandle
,
.
fattr
=
&
fattr
,
};
struct
rpc_message
msg
=
{
.
rpc_proc
=
&
nfs4_procedures
[
NFSPROC4_CLNT_CREATE
],
...
...
@@ -1688,24 +1689,24 @@ static int _nfs4_proc_mkdir(struct inode *dir, struct qstr *name,
};
int
status
;
fattr
->
valid
=
0
;
fattr
.
valid
=
0
;
status
=
rpc_call_sync
(
NFS_CLIENT
(
dir
),
&
msg
,
0
);
if
(
!
status
)
if
(
!
status
)
{
update_changeattr
(
dir
,
&
res
.
dir_cinfo
);
status
=
nfs_instantiate
(
dentry
,
&
fhandle
,
&
fattr
);
}
return
status
;
}
static
int
nfs4_proc_mkdir
(
struct
inode
*
dir
,
struct
qstr
*
name
,
struct
iattr
*
sattr
,
struct
nfs_fh
*
fhandle
,
struct
nfs_fattr
*
fattr
)
static
int
nfs4_proc_mkdir
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
struct
iattr
*
sattr
)
{
struct
nfs4_exception
exception
=
{
};
int
err
;
do
{
err
=
nfs4_handle_exception
(
NFS_SERVER
(
dir
),
_nfs4_proc_mkdir
(
dir
,
name
,
sattr
,
fhandle
,
fattr
),
_nfs4_proc_mkdir
(
dir
,
dentry
,
sattr
),
&
exception
);
}
while
(
exception
.
retry
);
return
err
;
...
...
fs/nfs/proc.c
View file @
906fd2d2
...
...
@@ -402,24 +402,27 @@ nfs_proc_symlink(struct inode *dir, struct qstr *name, struct qstr *path,
}
static
int
nfs_proc_mkdir
(
struct
inode
*
dir
,
struct
qstr
*
name
,
struct
iattr
*
sattr
,
struct
nfs_fh
*
fhandle
,
struct
nfs_fattr
*
fattr
)
nfs_proc_mkdir
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
struct
iattr
*
sattr
)
{
struct
nfs_fh
fhandle
;
struct
nfs_fattr
fattr
;
struct
nfs_createargs
arg
=
{
.
fh
=
NFS_FH
(
dir
),
.
name
=
name
->
name
,
.
len
=
name
->
len
,
.
name
=
dentry
->
d_name
.
name
,
.
len
=
dentry
->
d_name
.
len
,
.
sattr
=
sattr
};
struct
nfs_diropok
res
=
{
.
fh
=
fhandle
,
.
fattr
=
fattr
.
fh
=
&
fhandle
,
.
fattr
=
&
fattr
};
int
status
;
dprintk
(
"NFS call mkdir %s
\n
"
,
name
->
name
);
fattr
->
valid
=
0
;
dprintk
(
"NFS call mkdir %s
\n
"
,
dentry
->
d_name
.
name
);
fattr
.
valid
=
0
;
status
=
rpc_call
(
NFS_CLIENT
(
dir
),
NFSPROC_MKDIR
,
&
arg
,
&
res
,
0
);
if
(
status
==
0
)
status
=
nfs_instantiate
(
dentry
,
&
fhandle
,
&
fattr
);
dprintk
(
"NFS reply mkdir: %d
\n
"
,
status
);
return
status
;
}
...
...
include/linux/nfs_xdr.h
View file @
906fd2d2
...
...
@@ -694,8 +694,7 @@ struct nfs_rpc_ops {
int
(
*
symlink
)
(
struct
inode
*
,
struct
qstr
*
,
struct
qstr
*
,
struct
iattr
*
,
struct
nfs_fh
*
,
struct
nfs_fattr
*
);
int
(
*
mkdir
)
(
struct
inode
*
,
struct
qstr
*
,
struct
iattr
*
,
struct
nfs_fh
*
,
struct
nfs_fattr
*
);
int
(
*
mkdir
)
(
struct
inode
*
,
struct
dentry
*
,
struct
iattr
*
);
int
(
*
rmdir
)
(
struct
inode
*
,
struct
qstr
*
);
int
(
*
readdir
)
(
struct
dentry
*
,
struct
rpc_cred
*
,
u64
,
struct
page
*
,
unsigned
int
,
int
);
...
...
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