Blame view
fs/nfs/nfs4_fs.h
22.5 KB
b24413180 License cleanup: ... |
1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
4ce79717c [PATCH] NFS: Head... |
2 3 4 5 6 7 8 9 10 11 |
/* * linux/fs/nfs/nfs4_fs.h * * Copyright (C) 2005 Trond Myklebust * * NFSv4-specific filesystem definitions and declarations */ #ifndef __LINUX_FS_NFS_NFS4_FS_H #define __LINUX_FS_NFS_NFS4_FS_H |
694e096fd NFS: Enabling v4.... |
12 13 14 15 16 17 18 |
#if defined(CONFIG_NFS_V4_2) #define NFS4_MAX_MINOR_VERSION 2 #elif defined(CONFIG_NFS_V4_1) #define NFS4_MAX_MINOR_VERSION 1 #else #define NFS4_MAX_MINOR_VERSION 0 #endif |
89d77c8fa NFS: Convert v4 i... |
19 |
#if IS_ENABLED(CONFIG_NFS_V4) |
4ce79717c [PATCH] NFS: Head... |
20 |
|
330212796 NFSv4: Move nfs4_... |
21 |
#define NFS4_MAX_LOOP_ON_RECOVER (10) |
c137afabe NFSv4: Allow the ... |
22 |
#include <linux/seqlock.h> |
4ce79717c [PATCH] NFS: Head... |
23 |
struct idmap; |
4ce79717c [PATCH] NFS: Head... |
24 |
enum nfs4_client_state { |
e005e8041 NFSv4: Rename the... |
25 |
NFS4CLNT_MANAGER_RUNNING = 0, |
e598d843c NFSv4: Remove red... |
26 |
NFS4CLNT_CHECK_LEASE, |
58d9714a4 NFSv4: Send RENEW... |
27 |
NFS4CLNT_LEASE_EXPIRED, |
b79a4a1b4 NFSv4: Fix state ... |
28 29 |
NFS4CLNT_RECLAIM_REBOOT, NFS4CLNT_RECLAIM_NOGRACE, |
707fb4b32 NFSv4: Clean up N... |
30 |
NFS4CLNT_DELEGRETURN, |
6df08189f nfs41: rename cl_... |
31 |
NFS4CLNT_SESSION_RESET, |
fd954ae12 NFSv4.1: Don't lo... |
32 |
NFS4CLNT_LEASE_CONFIRM, |
78fe0f41d NFS: use scope fr... |
33 |
NFS4CLNT_SERVER_SCOPE_MISMATCH, |
2c820d9a9 NFS: Force server... |
34 |
NFS4CLNT_PURGE_STATE, |
a9e64442f nfs41: Use BIND_C... |
35 |
NFS4CLNT_BIND_CONN_TO_SESSION, |
c9fdeb280 NFS: Add basic mi... |
36 |
NFS4CLNT_MOVED, |
b7f7a66e4 NFS: Support NFS4... |
37 |
NFS4CLNT_LEASE_MOVED, |
45870d690 NFSv4.1: Test del... |
38 |
NFS4CLNT_DELEGATION_EXPIRED, |
aeabb3c96 NFSv4: Fix a NFSv... |
39 |
NFS4CLNT_RUN_MANAGER, |
b5fdf8418 NFSv4: Add suppor... |
40 41 42 |
NFS4CLNT_RECALL_RUNNING, NFS4CLNT_RECALL_ANY_LAYOUT_READ, NFS4CLNT_RECALL_ANY_LAYOUT_RW, |
4ce79717c [PATCH] NFS: Head... |
43 |
}; |
2f60ea6b8 NFSv4: The NFSv4.... |
44 45 |
#define NFS4_RENEW_TIMEOUT 0x01 #define NFS4_RENEW_DELEGATION_CB 0x02 |
63f5f796a NFSv4.1: Allow pa... |
46 |
struct nfs_seqid_counter; |
97dc13594 NFSv41: Clean up ... |
47 48 |
struct nfs4_minor_version_ops { u32 minor_version; |
39c6daae7 NFSv4: Prepare fo... |
49 |
unsigned init_caps; |
97dc13594 NFSv41: Clean up ... |
50 |
|
abf79bb34 NFS: Add a slot t... |
51 52 |
int (*init_client)(struct nfs_client *); void (*shutdown_client)(struct nfs_client *); |
36281caa8 NFSv4: Further cl... |
53 |
bool (*match_stateid)(const nfs4_stateid *, |
e047a10c1 NFSv41: Fix nfs_a... |
54 |
const nfs4_stateid *); |
fca78d6d2 NFS: Add SECINFO_... |
55 56 |
int (*find_root_sec)(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *); |
f1cdae87f nfs4: turn free_l... |
57 |
void (*free_lock_state)(struct nfs_server *, |
c8b2d0bfd NFSv4.1: Ensure t... |
58 |
struct nfs4_lock_state *); |
45870d690 NFSv4.1: Test del... |
59 |
int (*test_and_free_expired)(struct nfs_server *, |
a52458b48 NFS/NFSD/SUNRPC: ... |
60 |
nfs4_stateid *, const struct cred *); |
63f5f796a NFSv4.1: Allow pa... |
61 62 |
struct nfs_seqid * (*alloc_seqid)(struct nfs_seqid_counter *, gfp_t); |
10e037d1e sunrpc: Add xprt ... |
63 64 |
void (*session_trunk)(struct rpc_clnt *clnt, struct rpc_xprt *xprt, void *data); |
9915ea7e0 NFS: Add RPC call... |
65 |
const struct rpc_call_ops *call_sync_ops; |
c48f4f354 NFSv41: Convert t... |
66 67 68 |
const struct nfs4_state_recovery_ops *reboot_recovery_ops; const struct nfs4_state_recovery_ops *nograce_recovery_ops; const struct nfs4_state_maintenance_ops *state_renewal_ops; |
ec011fe84 NFS: Introduce a ... |
69 |
const struct nfs4_mig_recovery_ops *mig_recovery_ops; |
97dc13594 NFSv41: Clean up ... |
70 |
}; |
cee54fc94 NFSv4: Add functi... |
71 72 |
#define NFS_SEQID_CONFIRMED 1 struct nfs_seqid_counter { |
95b72eb0b NFSv4: Ensure we ... |
73 |
ktime_t create_time; |
48c22eb21 NFS: Move struct ... |
74 |
int owner_id; |
cee54fc94 NFSv4: Add functi... |
75 76 |
int flags; u32 counter; |
7ba127ab9 NFSv4: Move conte... |
77 78 79 |
spinlock_t lock; /* Protects the list */ struct list_head list; /* Defines sequence of RPC calls */ struct rpc_wait_queue wait; /* RPC call delay queue */ |
cee54fc94 NFSv4: Add functi... |
80 81 82 |
}; struct nfs_seqid { |
cee54fc94 NFSv4: Add functi... |
83 |
struct nfs_seqid_counter *sequence; |
4e51336a0 NFSv4: Final twea... |
84 |
struct list_head list; |
4601df20f NFSv4: Avoid thun... |
85 |
struct rpc_task *task; |
cee54fc94 NFSv4: Add functi... |
86 87 88 89 90 91 92 93 94 |
}; static inline void nfs_confirm_seqid(struct nfs_seqid_counter *seqid, int status) { if (seqid_mutating_err(-status)) seqid->flags |= NFS_SEQID_CONFIRMED; } /* |
4ce79717c [PATCH] NFS: Head... |
95 96 97 |
* NFS4 state_owners and lock_owners are simply labels for ordered * sequences of RPC calls. Their sole purpose is to provide once-only * semantics by allowing the server to identify replayed requests. |
4ce79717c [PATCH] NFS: Head... |
98 99 |
*/ struct nfs4_state_owner { |
6f2e64d3e NFSv4: Make the N... |
100 |
struct nfs_server *so_server; |
0aaaf5c42 NFS: Cache state ... |
101 102 |
struct list_head so_lru; unsigned long so_expires; |
24d292b89 NFS: Move cl_stat... |
103 |
struct rb_node so_server_node; |
4ce79717c [PATCH] NFS: Head... |
104 |
|
a52458b48 NFS/NFSD/SUNRPC: ... |
105 |
const struct cred *so_cred; /* Associated cred */ |
9f958ab88 NFSv4: Reduce the... |
106 107 108 |
spinlock_t so_lock; atomic_t so_count; |
7eff03aec NFSv4: Add a reco... |
109 |
unsigned long so_flags; |
4ce79717c [PATCH] NFS: Head... |
110 |
struct list_head so_states; |
cee54fc94 NFSv4: Add functi... |
111 |
struct nfs_seqid_counter so_seqid; |
76246c921 NFSv4: Use sequen... |
112 |
seqcount_spinlock_t so_reclaim_seqcount; |
65b62a29f NFSv4: Ensure del... |
113 |
struct mutex so_delegreturn_mutex; |
4ce79717c [PATCH] NFS: Head... |
114 |
}; |
7eff03aec NFSv4: Add a reco... |
115 116 117 118 |
enum { NFS_OWNER_RECLAIM_REBOOT, NFS_OWNER_RECLAIM_NOGRACE }; |
afe6c27cc nfs: change nfs4_... |
119 120 121 |
#define NFS_LOCK_NEW 0 #define NFS_LOCK_RECLAIM 1 #define NFS_LOCK_EXPIRED 2 |
4ce79717c [PATCH] NFS: Head... |
122 123 124 125 126 127 128 129 130 131 132 133 134 |
/* * struct nfs4_state maintains the client-side state for a given * (state_owner,inode) tuple (OPEN) or state_owner (LOCK). * * OPEN: * In order to know when to OPEN_DOWNGRADE or CLOSE the state on the server, * we need to know how many files are open for reading or writing on a * given inode. This information too is stored here. * * LOCK: one nfs4_state (LOCK) to hold the lock stateid nfs4_state(OPEN) */ struct nfs4_lock_state { |
0c0e0d3c0 nfs: revert "nfs4... |
135 136 |
struct list_head ls_locks; /* Other lock stateids */ struct nfs4_state * ls_state; /* Pointer to open state */ |
795a88c96 NFSv4: Convert th... |
137 |
#define NFS_LOCK_INITIALIZED 0 |
ef1820f9b NFSv4: Don't try ... |
138 |
#define NFS_LOCK_LOST 1 |
0c0e0d3c0 nfs: revert "nfs4... |
139 |
unsigned long ls_flags; |
cee54fc94 NFSv4: Add functi... |
140 |
struct nfs_seqid_counter ls_seqid; |
0c0e0d3c0 nfs: revert "nfs4... |
141 |
nfs4_stateid ls_stateid; |
194bc1f48 fs, nfs: convert ... |
142 |
refcount_t ls_count; |
0c0e0d3c0 nfs: revert "nfs4... |
143 |
fl_owner_t ls_owner; |
4ce79717c [PATCH] NFS: Head... |
144 145 146 147 148 |
}; /* bits for nfs4_state->flags */ enum { LK_STATE_IN_USE, |
003707c72 NFSv4: Always use... |
149 |
NFS_DELEGATED_STATE, /* Current stateid is delegation */ |
92b40e938 NFSv4: Use the op... |
150 |
NFS_OPEN_STATE, /* OPEN stateid is set */ |
003707c72 NFSv4: Always use... |
151 152 153 |
NFS_O_RDONLY_STATE, /* OPEN stateid has read-only state */ NFS_O_WRONLY_STATE, /* OPEN stateid has write-only state */ NFS_O_RDWR_STATE, /* OPEN stateid has read/write state */ |
b79a4a1b4 NFSv4: Fix state ... |
154 155 |
NFS_STATE_RECLAIM_REBOOT, /* OPEN stateid server rebooted */ NFS_STATE_RECLAIM_NOGRACE, /* OPEN stateid needs to recover state */ |
8e469ebd6 NFSv4: Don't allo... |
156 |
NFS_STATE_POSIX_LOCKS, /* Posix locks are supported */ |
5d422301f NFSv4: Fail I/O i... |
157 |
NFS_STATE_RECOVERY_FAILED, /* OPEN stateid state recovery failed */ |
a8ce377a5 nfs: track whethe... |
158 |
NFS_STATE_MAY_NOTIFY_LOCK, /* server may CB_NOTIFY_LOCK */ |
c9399f21c NFSv4: Fix OPEN /... |
159 |
NFS_STATE_CHANGE_WAIT, /* A state changing operation is outstanding */ |
e4648aa4f NFS recover from ... |
160 |
NFS_CLNT_DST_SSC_COPY_STATE, /* dst server open state on client*/ |
0e65a32c8 NFS: handle sourc... |
161 |
NFS_CLNT_SRC_SSC_COPY_STATE, /* src server open state on client*/ |
0b9018b9c NFS: skip recover... |
162 |
NFS_SRV_SSC_COPY_STATE, /* ssc state on the dst server */ |
4ce79717c [PATCH] NFS: Head... |
163 164 165 166 167 168 169 170 171 172 173 |
}; struct nfs4_state { struct list_head open_states; /* List of states for the same state_owner */ struct list_head inode_states; /* List of states for the same inode */ struct list_head lock_states; /* List of subservient lock stateids */ struct nfs4_state_owner *owner; /* Pointer to the open owner */ struct inode *inode; /* Pointer to the inode */ unsigned long flags; /* Do we hold any locks? */ |
8d0a8a9d0 [PATCH] NFSv4: Cl... |
174 |
spinlock_t state_lock; /* Protects the lock_states list */ |
4ce79717c [PATCH] NFS: Head... |
175 |
|
8bda4e4c9 NFSv4: Fix up sta... |
176 |
seqlock_t seqlock; /* Protects the stateid/open_stateid */ |
003707c72 NFSv4: Always use... |
177 178 |
nfs4_stateid stateid; /* Current stateid: may be delegation */ nfs4_stateid open_stateid; /* OPEN stateid */ |
4ce79717c [PATCH] NFS: Head... |
179 |
|
8bda4e4c9 NFSv4: Fix up sta... |
180 |
/* The following 3 fields are protected by owner->so_lock */ |
003707c72 NFSv4: Always use... |
181 182 183 |
unsigned int n_rdonly; /* Number of read-only references */ unsigned int n_wronly; /* Number of write-only references */ unsigned int n_rdwr; /* Number of read/write references */ |
dc0b027df NFSv4: Convert th... |
184 |
fmode_t state; /* State on the server (R,W, or RW) */ |
ace9fad43 NFSv4: Convert st... |
185 |
refcount_t count; |
c9399f21c NFSv4: Fix OPEN /... |
186 187 |
wait_queue_head_t waitq; |
9ae075fdd NFSv4: Convert op... |
188 |
struct rcu_head rcu_head; |
4ce79717c [PATCH] NFS: Head... |
189 190 191 192 |
}; struct nfs4_exception { |
9e33bed55 NFSv4: Add recove... |
193 |
struct nfs4_state *state; |
3114ea7a2 NFSv4: Return the... |
194 |
struct inode *inode; |
8487c479e NFSv4: Allow retr... |
195 |
nfs4_stateid *stateid; |
b3c2aa074 NFSv4: Refactor N... |
196 197 198 199 |
long timeout; unsigned char delay : 1, recovering : 1, retry : 1; |
0688e64bc NFS: Allow signal... |
200 |
bool interruptible; |
4ce79717c [PATCH] NFS: Head... |
201 202 203 |
}; struct nfs4_state_recovery_ops { |
7eff03aec NFSv4: Add a reco... |
204 |
int owner_flag_bit; |
b79a4a1b4 NFSv4: Fix state ... |
205 |
int state_flag_bit; |
4ce79717c [PATCH] NFS: Head... |
206 207 |
int (*recover_open)(struct nfs4_state_owner *, struct nfs4_state *); int (*recover_lock)(struct nfs4_state *, struct file_lock *); |
a52458b48 NFS/NFSD/SUNRPC: ... |
208 209 |
int (*establish_clid)(struct nfs_client *, const struct cred *); int (*reclaim_complete)(struct nfs_client *, const struct cred *); |
05f4c350e NFS: Discover NFS... |
210 |
int (*detect_trunking)(struct nfs_client *, struct nfs_client **, |
a52458b48 NFS/NFSD/SUNRPC: ... |
211 |
const struct cred *); |
4ce79717c [PATCH] NFS: Head... |
212 |
}; |
1b146fcff pnfs: Move nfs4_o... |
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
struct nfs4_opendata { struct kref kref; struct nfs_openargs o_arg; struct nfs_openres o_res; struct nfs_open_confirmargs c_arg; struct nfs_open_confirmres c_res; struct nfs4_string owner_name; struct nfs4_string group_name; struct nfs4_label *a_label; struct nfs_fattr f_attr; struct nfs4_label *f_label; struct dentry *dir; struct dentry *dentry; struct nfs4_state_owner *owner; struct nfs4_state *state; struct iattr attrs; struct nfs4_layoutget *lgp; unsigned long timestamp; bool rpc_done; bool file_created; bool is_recover; bool cancelled; int rpc_status; }; |
04fa2c6bb NFS pnfs data ser... |
237 238 |
struct nfs4_add_xprt_data { struct nfs_client *clp; |
a52458b48 NFS/NFSD/SUNRPC: ... |
239 |
const struct cred *cred; |
04fa2c6bb NFS pnfs data ser... |
240 |
}; |
29fba38b7 nfs41: lease renewal |
241 |
struct nfs4_state_maintenance_ops { |
a52458b48 NFS/NFSD/SUNRPC: ... |
242 243 244 |
int (*sched_state_renewal)(struct nfs_client *, const struct cred *, unsigned); const struct cred * (*get_state_renewal_cred)(struct nfs_client *); int (*renew_lease)(struct nfs_client *, const struct cred *); |
29fba38b7 nfs41: lease renewal |
245 |
}; |
ec011fe84 NFS: Introduce a ... |
246 |
struct nfs4_mig_recovery_ops { |
b03d735b4 NFS: Add method t... |
247 |
int (*get_locations)(struct inode *, struct nfs4_fs_locations *, |
a52458b48 NFS/NFSD/SUNRPC: ... |
248 249 |
struct page *, const struct cred *); int (*fsid_present)(struct inode *, const struct cred *); |
ec011fe84 NFS: Introduce a ... |
250 |
}; |
f786aa90e constify dentry_o... |
251 |
extern const struct dentry_operations nfs4_dentry_operations; |
73a79706d NFS: Split out NF... |
252 253 254 |
/* dir.c */ int nfs_atomic_open(struct inode *, struct dentry *, struct file *, |
44907d790 get rid of 'opene... |
255 |
unsigned, umode_t); |
6b3b5496d [PATCH] NFSv4: Ad... |
256 |
|
f2aedb713 NFS: Add fs_conte... |
257 |
/* fs_context.c */ |
1ae811ee2 NFS: Fix a regres... |
258 |
extern struct file_system_type nfs4_fs_type; |
72de53ec4 NFS: Do secinfo a... |
259 |
/* nfs4namespace.c */ |
beffb8feb qstr: constify in... |
260 261 |
struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *, const struct qstr *); |
f2aedb713 NFS: Add fs_conte... |
262 |
int nfs4_submount(struct fs_context *, struct nfs_server *); |
800c06a5b NFS: Add function... |
263 264 |
int nfs4_replace_transport(struct nfs_server *server, const struct nfs4_fs_locations *locations); |
72de53ec4 NFS: Do secinfo a... |
265 |
|
4ce79717c [PATCH] NFS: Head... |
266 |
/* nfs4proc.c */ |
f4ac1674f nfs: Add ALLOCATE... |
267 |
extern int nfs4_handle_exception(struct nfs_server *, int, struct nfs4_exception *); |
0f913a57d NFS export nfs4_a... |
268 269 270 |
extern int nfs4_async_handle_error(struct rpc_task *task, struct nfs_server *server, struct nfs4_state *state, long *timeout); |
1c6dcbe5c NFS: Implement SEEK |
271 272 273 |
extern int nfs4_call_sync(struct rpc_clnt *, struct nfs_server *, struct rpc_message *, struct nfs4_sequence_args *, struct nfs4_sequence_res *, int); |
fba83f341 NFS: Pass "privil... |
274 |
extern void nfs4_init_sequence(struct nfs4_sequence_args *, struct nfs4_sequence_res *, int, int); |
a52458b48 NFS/NFSD/SUNRPC: ... |
275 276 |
extern int nfs4_proc_setclientid(struct nfs_client *, u32, unsigned short, const struct cred *, struct nfs4_setclientid_res *); extern int nfs4_proc_setclientid_confirm(struct nfs_client *, struct nfs4_setclientid_res *arg, const struct cred *); |
5e6b19901 NFSv4: Fix securi... |
277 |
extern int nfs4_proc_get_rootfh(struct nfs_server *, struct nfs_fh *, struct nfs_fsinfo *, bool); |
a52458b48 NFS/NFSD/SUNRPC: ... |
278 279 |
extern int nfs4_proc_bind_conn_to_session(struct nfs_client *, const struct cred *cred); extern int nfs4_proc_exchange_id(struct nfs_client *clp, const struct cred *cred); |
662455391 NFSv4.1: Add DEST... |
280 |
extern int nfs4_destroy_clientid(struct nfs_client *clp); |
a52458b48 NFS/NFSD/SUNRPC: ... |
281 282 |
extern int nfs4_init_clientid(struct nfs_client *, const struct cred *); extern int nfs41_init_clientid(struct nfs_client *, const struct cred *); |
1f7977c13 NFSv4.1: Simplify... |
283 |
extern int nfs4_do_close(struct nfs4_state *state, gfp_t gfp_mask, int wait); |
55a975937 NFS: Ensure the c... |
284 |
extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle); |
f05d147f7 NFS: Fix followin... |
285 286 |
extern int nfs4_proc_fs_locations(struct rpc_clnt *, struct inode *, const struct qstr *, struct nfs4_fs_locations *, struct page *); |
b03d735b4 NFS: Add method t... |
287 |
extern int nfs4_proc_get_locations(struct inode *, struct nfs4_fs_locations *, |
a52458b48 NFS/NFSD/SUNRPC: ... |
288 289 |
struct page *page, const struct cred *); extern int nfs4_proc_fsid_present(struct inode *, const struct cred *); |
f7b37b8b1 NFS: Add softreva... |
290 291 292 293 |
extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *, struct dentry *, struct nfs_fh *, struct nfs_fattr *); |
72de53ec4 NFS: Do secinfo a... |
294 |
extern int nfs4_proc_secinfo(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *); |
64c2ce8b7 nfsv4: Switch to ... |
295 |
extern const struct xattr_handler *nfs4_xattr_handlers[]; |
5521abfdc NFSv4: Resend the... |
296 |
extern int nfs4_set_rw_stateid(nfs4_stateid *stateid, |
9b2061498 NFSv4: The statei... |
297 298 299 |
const struct nfs_open_context *ctx, const struct nfs_lock_context *l_ctx, fmode_t fmode); |
ec4b09250 NFS: inter ssc open |
300 301 302 303 304 305 306 |
extern int nfs4_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle, struct nfs_fattr *fattr, struct nfs4_label *label, struct inode *inode); extern int update_open_stateid(struct nfs4_state *state, const nfs4_stateid *open_stateid, const nfs4_stateid *deleg_stateid, fmode_t fmode); |
4ce79717c [PATCH] NFS: Head... |
307 |
|
0efb01b2a nfs4: Make nfs4_p... |
308 309 |
extern int nfs4_proc_get_lease_time(struct nfs_client *clp, struct nfs_fsinfo *fsinfo); |
1b523ca97 nfs: modify updat... |
310 311 312 313 |
extern void nfs4_update_changeattr(struct inode *dir, struct nfs4_change_info *cinfo, unsigned long timestamp, unsigned long cache_validity); |
ccde1e9c0 nfs: make the buf... |
314 315 |
extern int nfs4_buf_to_pages_noslab(const void *buf, size_t buflen, struct page **pages); |
1b523ca97 nfs: modify updat... |
316 |
|
557134a39 nfs41: sessions c... |
317 |
#if defined(CONFIG_NFS_V4_1) |
f9c96fcc5 NFSv4.1 free slot... |
318 |
extern int nfs41_sequence_done(struct rpc_task *, struct nfs4_sequence_res *); |
a52458b48 NFS/NFSD/SUNRPC: ... |
319 320 |
extern int nfs4_proc_create_session(struct nfs_client *, const struct cred *); extern int nfs4_proc_destroy_session(struct nfs4_session *, const struct cred *); |
863a3c6c6 NFSv4.1: layoutco... |
321 |
extern int nfs4_proc_layoutcommit(struct nfs4_layoutcommit_data *data, |
ef3115378 NFSv4.1 convert l... |
322 |
bool sync); |
ba84db96a NFS detect sessio... |
323 324 |
extern int nfs4_detect_session_trunking(struct nfs_client *clp, struct nfs41_exchange_id_res *res, struct rpc_xprt *xprt); |
94de8b27d NFSv4.1: add MDS ... |
325 326 327 328 329 330 331 |
static inline bool is_ds_only_client(struct nfs_client *clp) { return (clp->cl_exchange_flags & EXCHGID4_FLAG_MASK_PNFS) == EXCHGID4_FLAG_USE_PNFS_DS; } |
d83217c13 NFSv4.1: data ser... |
332 333 334 335 336 337 |
static inline bool is_ds_client(struct nfs_client *clp) { return clp->cl_exchange_flags & EXCHGID4_FLAG_USE_PNFS_DS; } |
ab4c23613 nfs4.1: Add state... |
338 |
|
8c21c62c4 nfs4.1: Add SP4_M... |
339 340 341 |
static inline bool _nfs4_state_protect(struct nfs_client *clp, unsigned long sp4_mode, struct rpc_clnt **clntp, struct rpc_message *msg) |
ab4c23613 nfs4.1: Add state... |
342 |
{ |
ab4c23613 nfs4.1: Add state... |
343 |
rpc_authflavor_t flavor; |
b79e87e07 NFSv4.1: don't us... |
344 345 346 347 348 349 350 351 352 353 354 |
if (sp4_mode == NFS_SP4_MACH_CRED_CLEANUP || sp4_mode == NFS_SP4_MACH_CRED_PNFS_CLEANUP) { /* Using machine creds for cleanup operations * is only relevent if the client credentials * might expire. So don't bother for * RPC_AUTH_UNIX. If file was only exported to * sec=sys, the PUTFH would fail anyway. */ if ((*clntp)->cl_auth->au_flavor == RPC_AUTH_UNIX) return false; } |
ab4c23613 nfs4.1: Add state... |
355 |
if (test_bit(sp4_mode, &clp->cl_sp4_flags)) { |
5e16923b4 NFS/SUNRPC: don't... |
356 |
msg->rpc_cred = rpc_machine_cred(); |
ab4c23613 nfs4.1: Add state... |
357 358 |
flavor = clp->cl_rpcclient->cl_auth->au_flavor; |
312cd958a NFSv4.1: sp4_mach... |
359 360 |
WARN_ON_ONCE(flavor != RPC_AUTH_GSS_KRB5I && flavor != RPC_AUTH_GSS_KRB5P); |
ab4c23613 nfs4.1: Add state... |
361 |
*clntp = clp->cl_rpcclient; |
8c21c62c4 nfs4.1: Add SP4_M... |
362 363 |
return true; |
ab4c23613 nfs4.1: Add state... |
364 |
} |
8c21c62c4 nfs4.1: Add SP4_M... |
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 |
return false; } /* * Function responsible for determining if an rpc_message should use the * machine cred under SP4_MACH_CRED and if so switching the credential and * authflavor (using the nfs_client's rpc_clnt which will be krb5i/p). * Should be called before rpc_call_sync/rpc_call_async. */ static inline void nfs4_state_protect(struct nfs_client *clp, unsigned long sp4_mode, struct rpc_clnt **clntp, struct rpc_message *msg) { _nfs4_state_protect(clp, sp4_mode, clntp, msg); } /* * Special wrapper to nfs4_state_protect for write. * If WRITE can use machine cred but COMMIT cannot, make sure all writes * that use machine cred use NFS_FILE_SYNC. */ static inline void nfs4_state_protect_write(struct nfs_client *clp, struct rpc_clnt **clntp, |
d45f60c67 nfs: merge nfs_pg... |
388 |
struct rpc_message *msg, struct nfs_pgio_header *hdr) |
8c21c62c4 nfs4.1: Add SP4_M... |
389 390 391 |
{ if (_nfs4_state_protect(clp, NFS_SP4_MACH_CRED_WRITE, clntp, msg) && !test_bit(NFS_SP4_MACH_CRED_COMMIT, &clp->cl_sp4_flags)) |
d45f60c67 nfs: merge nfs_pg... |
392 |
hdr->args.stable = NFS_FILE_SYNC; |
ab4c23613 nfs4.1: Add state... |
393 |
} |
fbcd4abcb nfs41: setup_sequ... |
394 |
#else /* CONFIG_NFS_v4_1 */ |
94de8b27d NFSv4.1: add MDS ... |
395 396 |
static inline bool is_ds_only_client(struct nfs_client *clp) |
d83217c13 NFSv4.1: data ser... |
397 398 399 400 401 402 |
{ return false; } static inline bool is_ds_client(struct nfs_client *clp) |
94de8b27d NFSv4.1: add MDS ... |
403 404 405 |
{ return false; } |
ab4c23613 nfs4.1: Add state... |
406 407 408 409 410 411 |
static inline void nfs4_state_protect(struct nfs_client *clp, unsigned long sp4_flags, struct rpc_clnt **clntp, struct rpc_message *msg) { } |
8c21c62c4 nfs4.1: Add SP4_M... |
412 413 414 |
static inline void nfs4_state_protect_write(struct nfs_client *clp, struct rpc_clnt **clntp, |
d45f60c67 nfs: merge nfs_pg... |
415 |
struct rpc_message *msg, struct nfs_pgio_header *hdr) |
8c21c62c4 nfs4.1: Add SP4_M... |
416 417 |
{ } |
557134a39 nfs41: sessions c... |
418 |
#endif /* CONFIG_NFS_V4_1 */ |
4ce79717c [PATCH] NFS: Head... |
419 |
|
97dc13594 NFSv41: Clean up ... |
420 |
extern const struct nfs4_minor_version_ops *nfs_v4_minor_ops[]; |
29fba38b7 nfs41: lease renewal |
421 |
|
1549210fc NFSv4: Fix an Oop... |
422 |
extern const u32 nfs4_fattr_bitmap[3]; |
a09df2ca2 NFSv4: Extend fat... |
423 424 |
extern const u32 nfs4_statfs_bitmap[3]; extern const u32 nfs4_pathconf_bitmap[3]; |
dae100c2b pnfs: ask for lay... |
425 |
extern const u32 nfs4_fsinfo_bitmap[3]; |
a09df2ca2 NFSv4: Extend fat... |
426 |
extern const u32 nfs4_fs_locations_bitmap[3]; |
4ce79717c [PATCH] NFS: Head... |
427 |
|
abf79bb34 NFS: Add a slot t... |
428 429 430 431 |
void nfs40_shutdown_client(struct nfs_client *); void nfs41_shutdown_client(struct nfs_client *); int nfs40_init_client(struct nfs_client *); int nfs41_init_client(struct nfs_client *); |
cdb7ecede NFS: Create a fre... |
432 |
void nfs4_free_client(struct nfs_client *); |
6663ee7f8 NFS: Create an al... |
433 |
struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *); |
4ce79717c [PATCH] NFS: Head... |
434 |
/* nfs4renewd.c */ |
adfa6f980 NFS: Rename struc... |
435 |
extern void nfs4_schedule_state_renewal(struct nfs_client *); |
4ce79717c [PATCH] NFS: Head... |
436 |
extern void nfs4_renewd_prepare_shutdown(struct nfs_server *); |
adfa6f980 NFS: Rename struc... |
437 |
extern void nfs4_kill_renewd(struct nfs_client *); |
65f27f384 WorkStruct: Pass ... |
438 |
extern void nfs4_renew_state(struct work_struct *); |
7dc2993a9 NFSv4.0: nfs4_do_... |
439 |
extern void nfs4_set_lease_period(struct nfs_client *clp, unsigned long lease); |
fb10fb67a NFSv4: Cleanup th... |
440 |
|
4ce79717c [PATCH] NFS: Head... |
441 442 |
/* nfs4state.c */ |
d49dd1175 NFSv4: add declar... |
443 |
extern const nfs4_stateid current_stateid; |
a52458b48 NFS/NFSD/SUNRPC: ... |
444 445 446 |
const struct cred *nfs4_get_clid_cred(struct nfs_client *clp); const struct cred *nfs4_get_machine_cred(struct nfs_client *clp); const struct cred *nfs4_get_renew_cred(struct nfs_client *clp); |
05f4c350e NFS: Discover NFS... |
447 448 449 |
int nfs4_discover_server_trunking(struct nfs_client *clp, struct nfs_client **); int nfs40_discover_server_trunking(struct nfs_client *clp, |
a52458b48 NFS/NFSD/SUNRPC: ... |
450 |
struct nfs_client **, const struct cred *); |
a7b721037 nfs41: introduce ... |
451 |
#if defined(CONFIG_NFS_V4_1) |
05f4c350e NFS: Discover NFS... |
452 |
int nfs41_discover_server_trunking(struct nfs_client *clp, |
a52458b48 NFS/NFSD/SUNRPC: ... |
453 |
struct nfs_client **, const struct cred *); |
9f594791d NFSv4.1: Handle o... |
454 |
extern void nfs4_schedule_session_recovery(struct nfs4_session *, int); |
3f10a6af4 NFS: Remove nfs41... |
455 |
extern void nfs41_notify_server(struct nfs_client *); |
0491567b5 NFS: add COPY_NOT... |
456 457 |
bool nfs4_check_serverowner_major_id(struct nfs41_server_owner *o1, struct nfs41_server_owner *o2); |
0400a6b0c NFSv4/4.1: Fix nf... |
458 |
#else |
9f594791d NFSv4.1: Handle o... |
459 |
static inline void nfs4_schedule_session_recovery(struct nfs4_session *session, int err) |
0400a6b0c NFSv4/4.1: Fix nf... |
460 461 |
{ } |
a7b721037 nfs41: introduce ... |
462 |
#endif /* CONFIG_NFS_V4_1 */ |
4ce79717c [PATCH] NFS: Head... |
463 |
|
a52458b48 NFS/NFSD/SUNRPC: ... |
464 |
extern struct nfs4_state_owner *nfs4_get_state_owner(struct nfs_server *, const struct cred *, gfp_t); |
4ce79717c [PATCH] NFS: Head... |
465 |
extern void nfs4_put_state_owner(struct nfs4_state_owner *); |
c77e22834 NFSv4: Fix a pote... |
466 467 |
extern void nfs4_purge_state_owners(struct nfs_server *, struct list_head *); extern void nfs4_free_state_owners(struct list_head *head); |
4ce79717c [PATCH] NFS: Head... |
468 469 |
extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *); extern void nfs4_put_open_state(struct nfs4_state *); |
643168c2d nfs4_closedata do... |
470 471 |
extern void nfs4_close_state(struct nfs4_state *, fmode_t); extern void nfs4_close_sync(struct nfs4_state *, fmode_t); |
dc0b027df NFSv4: Convert th... |
472 |
extern void nfs4_state_set_mode_locked(struct nfs4_state *, fmode_t); |
a1d0b5eeb NFS: Properly han... |
473 474 |
extern void nfs_inode_find_state_and_recover(struct inode *inode, const nfs4_stateid *stateid); |
4f14c194a NFSv4: Clear the ... |
475 |
extern int nfs4_state_mark_reclaim_nograce(struct nfs_client *, struct nfs4_state *); |
0400a6b0c NFSv4/4.1: Fix nf... |
476 |
extern void nfs4_schedule_lease_recovery(struct nfs_client *); |
330212796 NFSv4: Move nfs4_... |
477 478 |
extern int nfs4_wait_clnt_recover(struct nfs_client *clp); extern int nfs4_client_recover_expired_lease(struct nfs_client *clp); |
b0d3ded1a NFSv4: Clean up n... |
479 |
extern void nfs4_schedule_state_manager(struct nfs_client *); |
042b60beb NFSv4: renewd nee... |
480 |
extern void nfs4_schedule_path_down_recovery(struct nfs_client *clp); |
5d422301f NFSv4: Fail I/O i... |
481 |
extern int nfs4_schedule_stateid_recovery(const struct nfs_server *, struct nfs4_state *); |
c9fdeb280 NFS: Add basic mi... |
482 |
extern int nfs4_schedule_migration_recovery(const struct nfs_server *); |
b7f7a66e4 NFS: Support NFS4... |
483 |
extern void nfs4_schedule_lease_moved_recovery(struct nfs_client *); |
0a014a44a NFSv4.1: Don't de... |
484 |
extern void nfs41_handle_sequence_flag_errors(struct nfs_client *clp, u32 flags, bool); |
78fe0f41d NFS: use scope fr... |
485 |
extern void nfs41_handle_server_scope(struct nfs_client *, |
79d4e1f0d NFS: Use proper n... |
486 |
struct nfs41_server_scope **); |
faf5f49c2 NFSv4: Make NFS c... |
487 |
extern void nfs4_put_lock_state(struct nfs4_lock_state *lsp); |
8d0a8a9d0 [PATCH] NFSv4: Cl... |
488 |
extern int nfs4_set_lock_state(struct nfs4_state *state, struct file_lock *fl); |
abf4e13cc NFSv4: Use the ri... |
489 |
extern int nfs4_select_rw_stateid(struct nfs4_state *, fmode_t, |
173934754 NFSv4: change nfs... |
490 |
const struct nfs_lock_context *, nfs4_stateid *, |
a52458b48 NFS/NFSD/SUNRPC: ... |
491 |
const struct cred **); |
c82bac6f4 NFSv4: Don't try ... |
492 493 |
extern bool nfs4_copy_open_stateid(nfs4_stateid *dst, struct nfs4_state *state); |
4ce79717c [PATCH] NFS: Head... |
494 |
|
8535b2be5 NFSv4: Don't use ... |
495 |
extern struct nfs_seqid *nfs_alloc_seqid(struct nfs_seqid_counter *counter, gfp_t gfp_mask); |
cee54fc94 NFSv4: Add functi... |
496 497 498 |
extern int nfs_wait_on_sequence(struct nfs_seqid *seqid, struct rpc_task *task); extern void nfs_increment_open_seqid(int status, struct nfs_seqid *seqid); extern void nfs_increment_lock_seqid(int status, struct nfs_seqid *seqid); |
72211dbe7 NFSv4: Release th... |
499 |
extern void nfs_release_seqid(struct nfs_seqid *seqid); |
cee54fc94 NFSv4: Add functi... |
500 |
extern void nfs_free_seqid(struct nfs_seqid *seqid); |
3be0f80b5 NFSv4.1: Fix up r... |
501 |
extern int nfs4_setup_sequence(struct nfs_client *client, |
cb04ad2a2 nfs4: pass slot t... |
502 503 504 |
struct nfs4_sequence_args *args, struct nfs4_sequence_res *res, struct rpc_task *task); |
2c4b131de nfs4: export nfs4... |
505 506 |
extern int nfs4_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *res); |
cee54fc94 NFSv4: Add functi... |
507 |
|
5ae67c4fe NFSv4: It is not ... |
508 |
extern void nfs4_free_lock_state(struct nfs_server *server, struct nfs4_lock_state *lsp); |
6b8d84e2f NFS add a simple ... |
509 |
extern int nfs4_proc_commit(struct file *dst, __u64 offset, __u32 count, struct nfs_commitres *res); |
4ce79717c [PATCH] NFS: Head... |
510 |
extern const nfs4_stateid zero_stateid; |
fcd8843c4 NFSv4: Replace cl... |
511 |
extern const nfs4_stateid invalid_stateid; |
4ce79717c [PATCH] NFS: Head... |
512 |
|
129d1977e NFS: Create an in... |
513 |
/* nfs4super.c */ |
fbdefd644 NFS: Split out th... |
514 |
struct nfs_mount_info; |
ab7017a3a NFS: Add version ... |
515 |
extern struct nfs_subversion nfs_v4; |
fac1e8e4e NFS: Keep module ... |
516 517 |
extern bool nfs4_disable_idmapping; extern unsigned short max_session_slots; |
5405fc44c NFSv4.x: Add kern... |
518 |
extern unsigned short max_session_cb_slots; |
fac1e8e4e NFS: Keep module ... |
519 |
extern unsigned short send_implementation_id; |
f6de7a39c NFSv4: Document t... |
520 |
extern bool recover_lost_locks; |
89d77c8fa NFS: Convert v4 i... |
521 |
|
6f2ea7f2a NFS: Add nfs4_uni... |
522 523 |
#define NFS4_CLIENT_ID_UNIQ_LEN (64) extern char nfs4_client_id_uniquifier[NFS4_CLIENT_ID_UNIQ_LEN]; |
f2aedb713 NFS: Add fs_conte... |
524 525 |
extern int nfs4_try_get_tree(struct fs_context *); extern int nfs4_get_referral_tree(struct fs_context *); |
466bfe7f4 NFS: Initialize v... |
526 527 528 529 530 531 532 533 534 |
/* nfs4sysctl.c */ #ifdef CONFIG_SYSCTL int nfs4_register_sysctl(void); void nfs4_unregister_sysctl(void); #else static inline int nfs4_register_sysctl(void) { return 0; } |
0add3e856 nfs: fix stub ret... |
535 |
static inline void nfs4_unregister_sysctl(void) |
466bfe7f4 NFS: Initialize v... |
536 537 538 |
{ } #endif |
4ce79717c [PATCH] NFS: Head... |
539 |
/* nfs4xdr.c */ |
499b49881 sunrpc: mark all ... |
540 |
extern const struct rpc_procinfo nfs4_procedures[]; |
4ce79717c [PATCH] NFS: Head... |
541 |
|
04a5da690 NFSv4.2: define l... |
542 543 544 545 546 |
#ifdef CONFIG_NFS_V4_2 extern const u32 nfs42_maxsetxattr_overhead; extern const u32 nfs42_maxgetxattr_overhead; extern const u32 nfs42_maxlistxattrs_overhead; #endif |
4ce79717c [PATCH] NFS: Head... |
547 548 549 |
struct nfs4_mount_data; /* callback_xdr.c */ |
e9679189e sunrpc: mark all ... |
550 551 |
extern const struct svc_version nfs4_callback_version1; extern const struct svc_version nfs4_callback_version4; |
4ce79717c [PATCH] NFS: Head... |
552 |
|
f597c5379 NFSv4: Add helper... |
553 554 |
static inline void nfs4_stateid_copy(nfs4_stateid *dst, const nfs4_stateid *src) { |
93b717fd8 NFSv4: Label stat... |
555 556 |
memcpy(dst->data, src->data, sizeof(dst->data)); dst->type = src->type; |
f597c5379 NFSv4: Add helper... |
557 558 559 560 |
} static inline bool nfs4_stateid_match(const nfs4_stateid *dst, const nfs4_stateid *src) { |
93b717fd8 NFSv4: Label stat... |
561 562 563 |
if (dst->type != src->type) return false; return memcmp(dst->data, src->data, sizeof(dst->data)) == 0; |
f597c5379 NFSv4: Add helper... |
564 |
} |
e999e80ee NFSv4: Don't upda... |
565 566 567 568 569 570 571 572 573 |
static inline bool nfs4_stateid_match_other(const nfs4_stateid *dst, const nfs4_stateid *src) { return memcmp(dst->other, src->other, NFS4_STATEID_OTHER_SIZE) == 0; } static inline bool nfs4_stateid_is_newer(const nfs4_stateid *s1, const nfs4_stateid *s2) { return (s32)(be32_to_cpu(s1->seqid) - be32_to_cpu(s2->seqid)) > 0; } |
b4868b44c NFSv4: Wait for s... |
574 575 576 577 578 579 580 |
static inline bool nfs4_stateid_is_next(const nfs4_stateid *s1, const nfs4_stateid *s2) { u32 seq1 = be32_to_cpu(s1->seqid); u32 seq2 = be32_to_cpu(s2->seqid); return seq2 == seq1 + 1U || (seq2 == 1U && seq1 == 0xffffffffU); } |
42c304c34 NFS: nfs_inode_fi... |
581 582 583 584 585 |
static inline bool nfs4_stateid_match_or_older(const nfs4_stateid *dst, const nfs4_stateid *src) { return nfs4_stateid_match_other(dst, src) && !(src->seqid && nfs4_stateid_is_newer(dst, src)); } |
922839570 NFSv4: Add a help... |
586 587 588 589 590 591 592 593 |
static inline void nfs4_stateid_seqid_inc(nfs4_stateid *s1) { u32 seqid = be32_to_cpu(s1->seqid); if (++seqid == 0) ++seqid; s1->seqid = cpu_to_be32(seqid); } |
5d422301f NFSv4: Fail I/O i... |
594 595 596 597 |
static inline bool nfs4_valid_open_stateid(const struct nfs4_state *state) { return test_bit(NFS_STATE_RECOVERY_FAILED, &state->flags) == 0; } |
3e7dfb165 NFSv4: Fix CLOSE ... |
598 599 600 601 602 603 |
static inline bool nfs4_state_match_open_stateid_other(const struct nfs4_state *state, const nfs4_stateid *stateid) { return test_bit(NFS_OPEN_STATE, &state->flags) && nfs4_stateid_match_other(&state->open_stateid, stateid); } |
95ad37f90 NFSv4.2: add clie... |
604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 |
/* nfs42xattr.c */ #ifdef CONFIG_NFS_V4_2 extern int __init nfs4_xattr_cache_init(void); extern void nfs4_xattr_cache_exit(void); extern void nfs4_xattr_cache_add(struct inode *inode, const char *name, const char *buf, struct page **pages, ssize_t buflen); extern void nfs4_xattr_cache_remove(struct inode *inode, const char *name); extern ssize_t nfs4_xattr_cache_get(struct inode *inode, const char *name, char *buf, ssize_t buflen); extern void nfs4_xattr_cache_set_list(struct inode *inode, const char *buf, ssize_t buflen); extern ssize_t nfs4_xattr_cache_list(struct inode *inode, char *buf, ssize_t buflen); extern void nfs4_xattr_cache_zap(struct inode *inode); |
4ce79717c [PATCH] NFS: Head... |
619 |
#else |
95ad37f90 NFSv4.2: add clie... |
620 621 622 623 624 625 |
static inline void nfs4_xattr_cache_zap(struct inode *inode) { } #endif /* CONFIG_NFS_V4_2 */ #else /* CONFIG_NFS_V4 */ |
4ce79717c [PATCH] NFS: Head... |
626 |
|
643168c2d nfs4_closedata do... |
627 628 |
#define nfs4_close_state(a, b) do { } while (0) #define nfs4_close_sync(a, b) do { } while (0) |
8c21c62c4 nfs4.1: Add SP4_M... |
629 630 |
#define nfs4_state_protect(a, b, c, d) do { } while (0) #define nfs4_state_protect_write(a, b, c, d) do { } while (0) |
4ce79717c [PATCH] NFS: Head... |
631 |
|
95ad37f90 NFSv4.2: add clie... |
632 |
|
4ce79717c [PATCH] NFS: Head... |
633 634 |
#endif /* CONFIG_NFS_V4 */ #endif /* __LINUX_FS_NFS_NFS4_FS.H */ |