]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blobdiff - fs/nfs/nfs4state.c
Merge tag 'mac80211-for-davem-2016-06-29-v2' of git://git.kernel.org/pub/scm/linux...
[mirror_ubuntu-focal-kernel.git] / fs / nfs / nfs4state.c
index d854693a15b0e2443779986552d29d9db3f6cdc2..9679f47493640d4ce4a8a5e571727ece40e13625 100644 (file)
 
 #define OPENOWNER_POOL_SIZE    8
 
-const nfs4_stateid zero_stateid;
+const nfs4_stateid zero_stateid = {
+       { .data = { 0 } },
+       .type = NFS4_SPECIAL_STATEID_TYPE,
+};
 static DEFINE_MUTEX(nfs_clid_init_mutex);
 
 int nfs4_init_clientid(struct nfs_client *clp, struct rpc_cred *cred)
@@ -985,15 +988,20 @@ static void nfs4_copy_open_stateid(nfs4_stateid *dst, struct nfs4_state *state)
  * Byte-range lock aware utility to initialize the stateid of read/write
  * requests.
  */
-int nfs4_select_rw_stateid(nfs4_stateid *dst, struct nfs4_state *state,
-               fmode_t fmode, const struct nfs_lockowner *lockowner)
+int nfs4_select_rw_stateid(struct nfs4_state *state,
+               fmode_t fmode, const struct nfs_lockowner *lockowner,
+               nfs4_stateid *dst, struct rpc_cred **cred)
 {
-       int ret = nfs4_copy_lock_stateid(dst, state, lockowner);
+       int ret;
+
+       if (cred != NULL)
+               *cred = NULL;
+       ret = nfs4_copy_lock_stateid(dst, state, lockowner);
        if (ret == -EIO)
                /* A lost lock - don't even consider delegations */
                goto out;
        /* returns true if delegation stateid found and copied */
-       if (nfs4_copy_delegation_stateid(dst, state->inode, fmode)) {
+       if (nfs4_copy_delegation_stateid(state->inode, fmode, dst, cred)) {
                ret = 0;
                goto out;
        }