]> err.no Git - linux-2.6/blobdiff - fs/nfsd/nfs4proc.c
[NETFILTER]: nf_conntrack: EXPORT_SYMBOL cleanup
[linux-2.6] / fs / nfsd / nfs4proc.c
index 63823945f972bcc59a74b2998f50cd252a5bb260..50bc94243ca1b08d77802d785f1de83cbdcd33f6 100644 (file)
@@ -93,6 +93,7 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
 {
        struct svc_fh resfh;
        __be32 status;
+       int created = 0;
 
        fh_init(&resfh, NFS4_FHSIZE);
        open->op_truncate = 0;
@@ -105,28 +106,27 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
                status = nfsd_create_v3(rqstp, current_fh, open->op_fname.data,
                                        open->op_fname.len, &open->op_iattr,
                                        &resfh, open->op_createmode,
-                                       (u32 *)open->op_verf.data, &open->op_truncate);
-       }
-       else {
+                                       (u32 *)open->op_verf.data, &open->op_truncate, &created);
+       } else {
                status = nfsd_lookup(rqstp, current_fh,
                                     open->op_fname.data, open->op_fname.len, &resfh);
                fh_unlock(current_fh);
        }
+       if (status)
+               goto out;
 
-       if (!status) {
-               set_change_info(&open->op_cinfo, current_fh);
+       set_change_info(&open->op_cinfo, current_fh);
 
-               /* set reply cache */
-               fh_dup2(current_fh, &resfh);
-               open->op_stateowner->so_replay.rp_openfh_len =
-                       resfh.fh_handle.fh_size;
-               memcpy(open->op_stateowner->so_replay.rp_openfh,
-                               &resfh.fh_handle.fh_base,
-                               resfh.fh_handle.fh_size);
+       /* set reply cache */
+       fh_dup2(current_fh, &resfh);
+       open->op_stateowner->so_replay.rp_openfh_len = resfh.fh_handle.fh_size;
+       memcpy(open->op_stateowner->so_replay.rp_openfh,
+                       &resfh.fh_handle.fh_base, resfh.fh_handle.fh_size);
 
+       if (!created)
                status = do_open_permission(rqstp, current_fh, open, MAY_NOP);
-       }
 
+out:
        fh_put(&resfh);
        return status;
 }
@@ -177,7 +177,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open
 
        /* check seqid for replay. set nfs4_owner */
        status = nfsd4_process_open1(open);
-       if (status == NFSERR_REPLAY_ME) {
+       if (status == nfserr_replay_me) {
                struct nfs4_replay *rp = &open->op_stateowner->so_replay;
                fh_put(current_fh);
                current_fh->fh_handle.fh_size = rp->rp_openfh_len;
@@ -188,7 +188,7 @@ nfsd4_open(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open
                        dprintk("nfsd4_open: replay failed"
                                " restoring previous filehandle\n");
                else
-                       status = NFSERR_REPLAY_ME;
+                       status = nfserr_replay_me;
        }
        if (status)
                goto out;
@@ -937,7 +937,7 @@ nfsd4_proc_compound(struct svc_rqst *rqstp,
                }
 
 encode_op:
-               if (op->status == NFSERR_REPLAY_ME) {
+               if (op->status == nfserr_replay_me) {
                        op->replay = &replay_owner->so_replay;
                        nfsd4_encode_replay(resp, op);
                        status = op->status = op->replay->rp_status;