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
97dc1359
Commit
97dc1359
authored
Jun 16, 2010
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv41: Clean up the NFSv4.1 minor version specific operations
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
a2118c33
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
14 deletions
+39
-14
fs/nfs/client.c
fs/nfs/client.c
+6
-8
fs/nfs/nfs4_fs.h
fs/nfs/nfs4_fs.h
+11
-0
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+20
-1
include/linux/nfs_fs_sb.h
include/linux/nfs_fs_sb.h
+2
-5
No files found.
fs/nfs/client.c
View file @
97dc1359
...
@@ -150,6 +150,7 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_
...
@@ -150,6 +150,7 @@ static struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_
clp
->
cl_boot_time
=
CURRENT_TIME
;
clp
->
cl_boot_time
=
CURRENT_TIME
;
clp
->
cl_state
=
1
<<
NFS4CLNT_LEASE_EXPIRED
;
clp
->
cl_state
=
1
<<
NFS4CLNT_LEASE_EXPIRED
;
clp
->
cl_minorversion
=
cl_init
->
minorversion
;
clp
->
cl_minorversion
=
cl_init
->
minorversion
;
clp
->
cl_mvops
=
nfs_v4_minor_ops
[
cl_init
->
minorversion
];
#endif
#endif
cred
=
rpc_lookup_machine_cred
();
cred
=
rpc_lookup_machine_cred
();
if
(
!
IS_ERR
(
cred
))
if
(
!
IS_ERR
(
cred
))
...
@@ -178,7 +179,7 @@ static void nfs4_clear_client_minor_version(struct nfs_client *clp)
...
@@ -178,7 +179,7 @@ static void nfs4_clear_client_minor_version(struct nfs_client *clp)
clp
->
cl_session
=
NULL
;
clp
->
cl_session
=
NULL
;
}
}
clp
->
cl_
call_sync
=
_nfs4_call_sync
;
clp
->
cl_
mvops
=
nfs_v4_minor_ops
[
0
]
;
#endif
/* CONFIG_NFS_V4_1 */
#endif
/* CONFIG_NFS_V4_1 */
}
}
...
@@ -188,7 +189,7 @@ static void nfs4_clear_client_minor_version(struct nfs_client *clp)
...
@@ -188,7 +189,7 @@ static void nfs4_clear_client_minor_version(struct nfs_client *clp)
static
void
nfs4_destroy_callback
(
struct
nfs_client
*
clp
)
static
void
nfs4_destroy_callback
(
struct
nfs_client
*
clp
)
{
{
if
(
__test_and_clear_bit
(
NFS_CS_CALLBACK
,
&
clp
->
cl_res_state
))
if
(
__test_and_clear_bit
(
NFS_CS_CALLBACK
,
&
clp
->
cl_res_state
))
nfs_callback_down
(
clp
->
cl_m
inor
version
);
nfs_callback_down
(
clp
->
cl_m
vops
->
minor_
version
);
}
}
static
void
nfs4_shutdown_client
(
struct
nfs_client
*
clp
)
static
void
nfs4_shutdown_client
(
struct
nfs_client
*
clp
)
...
@@ -1126,7 +1127,7 @@ static int nfs4_init_callback(struct nfs_client *clp)
...
@@ -1126,7 +1127,7 @@ static int nfs4_init_callback(struct nfs_client *clp)
return
error
;
return
error
;
}
}
error
=
nfs_callback_up
(
clp
->
cl_m
inor
version
,
error
=
nfs_callback_up
(
clp
->
cl_m
vops
->
minor_
version
,
clp
->
cl_rpcclient
->
cl_xprt
);
clp
->
cl_rpcclient
->
cl_xprt
);
if
(
error
<
0
)
{
if
(
error
<
0
)
{
dprintk
(
"%s: failed to start callback. Error = %d
\n
"
,
dprintk
(
"%s: failed to start callback. Error = %d
\n
"
,
...
@@ -1143,10 +1144,8 @@ static int nfs4_init_callback(struct nfs_client *clp)
...
@@ -1143,10 +1144,8 @@ static int nfs4_init_callback(struct nfs_client *clp)
*/
*/
static
int
nfs4_init_client_minor_version
(
struct
nfs_client
*
clp
)
static
int
nfs4_init_client_minor_version
(
struct
nfs_client
*
clp
)
{
{
clp
->
cl_call_sync
=
_nfs4_call_sync
;
#if defined(CONFIG_NFS_V4_1)
#if defined(CONFIG_NFS_V4_1)
if
(
clp
->
cl_m
inor
version
)
{
if
(
clp
->
cl_m
vops
->
minor_
version
)
{
struct
nfs4_session
*
session
=
NULL
;
struct
nfs4_session
*
session
=
NULL
;
/*
/*
* Create the session and mark it expired.
* Create the session and mark it expired.
...
@@ -1158,7 +1157,6 @@ static int nfs4_init_client_minor_version(struct nfs_client *clp)
...
@@ -1158,7 +1157,6 @@ static int nfs4_init_client_minor_version(struct nfs_client *clp)
return
-
ENOMEM
;
return
-
ENOMEM
;
clp
->
cl_session
=
session
;
clp
->
cl_session
=
session
;
clp
->
cl_call_sync
=
_nfs4_call_sync_session
;
}
}
#endif
/* CONFIG_NFS_V4_1 */
#endif
/* CONFIG_NFS_V4_1 */
...
@@ -1454,7 +1452,7 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
...
@@ -1454,7 +1452,7 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
data
->
authflavor
,
data
->
authflavor
,
parent_server
->
client
->
cl_xprt
->
prot
,
parent_server
->
client
->
cl_xprt
->
prot
,
parent_server
->
client
->
cl_timeout
,
parent_server
->
client
->
cl_timeout
,
parent_client
->
cl_m
inor
version
);
parent_client
->
cl_m
vops
->
minor_
version
);
if
(
error
<
0
)
if
(
error
<
0
)
goto
error
;
goto
error
;
...
...
fs/nfs/nfs4_fs.h
View file @
97dc1359
...
@@ -52,6 +52,16 @@ enum nfs4_session_state {
...
@@ -52,6 +52,16 @@ enum nfs4_session_state {
NFS4_SESSION_DRAINING
,
NFS4_SESSION_DRAINING
,
};
};
struct
nfs4_minor_version_ops
{
u32
minor_version
;
int
(
*
call_sync
)(
struct
nfs_server
*
server
,
struct
rpc_message
*
msg
,
struct
nfs4_sequence_args
*
args
,
struct
nfs4_sequence_res
*
res
,
int
cache_reply
);
};
/*
/*
* struct rpc_sequence ensures that RPC calls are sent in the exact
* struct rpc_sequence ensures that RPC calls are sent in the exact
* order that they appear on the list.
* order that they appear on the list.
...
@@ -260,6 +270,7 @@ static inline int nfs4_init_session(struct nfs_server *server)
...
@@ -260,6 +270,7 @@ static inline int nfs4_init_session(struct nfs_server *server)
}
}
#endif
/* CONFIG_NFS_V4_1 */
#endif
/* CONFIG_NFS_V4_1 */
extern
const
struct
nfs4_minor_version_ops
*
nfs_v4_minor_ops
[];
extern
struct
nfs4_state_maintenance_ops
*
nfs4_state_renewal_ops
[];
extern
struct
nfs4_state_maintenance_ops
*
nfs4_state_renewal_ops
[];
extern
const
u32
nfs4_fattr_bitmap
[
2
];
extern
const
u32
nfs4_fattr_bitmap
[
2
];
...
...
fs/nfs/nfs4proc.c
View file @
97dc1359
...
@@ -667,7 +667,7 @@ int _nfs4_call_sync(struct nfs_server *server,
...
@@ -667,7 +667,7 @@ int _nfs4_call_sync(struct nfs_server *server,
}
}
#define nfs4_call_sync(server, msg, args, res, cache_reply) \
#define nfs4_call_sync(server, msg, args, res, cache_reply) \
(server)->nfs_client->cl_call_sync((server), (msg), &(args)->seq_args, \
(server)->nfs_client->cl_
mvops->
call_sync((server), (msg), &(args)->seq_args, \
&(res)->seq_res, (cache_reply))
&(res)->seq_res, (cache_reply))
static
void
update_changeattr
(
struct
inode
*
dir
,
struct
nfs4_change_info
*
cinfo
)
static
void
update_changeattr
(
struct
inode
*
dir
,
struct
nfs4_change_info
*
cinfo
)
...
@@ -5353,6 +5353,18 @@ struct nfs4_state_maintenance_ops nfs41_state_renewal_ops = {
...
@@ -5353,6 +5353,18 @@ struct nfs4_state_maintenance_ops nfs41_state_renewal_ops = {
};
};
#endif
#endif
static
const
struct
nfs4_minor_version_ops
nfs_v4_0_minor_ops
=
{
.
minor_version
=
0
,
.
call_sync
=
_nfs4_call_sync
,
};
#if defined(CONFIG_NFS_V4_1)
static
const
struct
nfs4_minor_version_ops
nfs_v4_1_minor_ops
=
{
.
minor_version
=
1
,
.
call_sync
=
_nfs4_call_sync_session
,
};
#endif
/*
/*
* Per minor version reboot and network partition recovery ops
* Per minor version reboot and network partition recovery ops
*/
*/
...
@@ -5378,6 +5390,13 @@ struct nfs4_state_maintenance_ops *nfs4_state_renewal_ops[] = {
...
@@ -5378,6 +5390,13 @@ struct nfs4_state_maintenance_ops *nfs4_state_renewal_ops[] = {
#endif
#endif
};
};
const
struct
nfs4_minor_version_ops
*
nfs_v4_minor_ops
[]
=
{
[
0
]
=
&
nfs_v4_0_minor_ops
,
#if defined(CONFIG_NFS_V4_1)
[
1
]
=
&
nfs_v4_1_minor_ops
,
#endif
};
static
const
struct
inode_operations
nfs4_file_inode_operations
=
{
static
const
struct
inode_operations
nfs4_file_inode_operations
=
{
.
permission
=
nfs_permission
,
.
permission
=
nfs_permission
,
.
getattr
=
nfs_getattr
,
.
getattr
=
nfs_getattr
,
...
...
include/linux/nfs_fs_sb.h
View file @
97dc1359
...
@@ -15,6 +15,7 @@ struct nlm_host;
...
@@ -15,6 +15,7 @@ struct nlm_host;
struct
nfs4_sequence_args
;
struct
nfs4_sequence_args
;
struct
nfs4_sequence_res
;
struct
nfs4_sequence_res
;
struct
nfs_server
;
struct
nfs_server
;
struct
nfs4_minor_version_ops
;
/*
/*
* The nfs_client identifies our client state to the server.
* The nfs_client identifies our client state to the server.
...
@@ -70,11 +71,7 @@ struct nfs_client {
...
@@ -70,11 +71,7 @@ struct nfs_client {
*/
*/
char
cl_ipaddr
[
48
];
char
cl_ipaddr
[
48
];
unsigned
char
cl_id_uniquifier
;
unsigned
char
cl_id_uniquifier
;
int
(
*
cl_call_sync
)(
struct
nfs_server
*
server
,
const
struct
nfs4_minor_version_ops
*
cl_mvops
;
struct
rpc_message
*
msg
,
struct
nfs4_sequence_args
*
args
,
struct
nfs4_sequence_res
*
res
,
int
cache_reply
);
#endif
/* CONFIG_NFS_V4 */
#endif
/* CONFIG_NFS_V4 */
#ifdef CONFIG_NFS_V4_1
#ifdef CONFIG_NFS_V4_1
...
...
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