Skip to contentSkip to conversation

kNFSd - 4 of 7 - nfsdv4 byte range locking - prepatation

PATCH New NeilBrown 1 participant 1 message Sep 22, 2003

Subsystems (2)
lore
Share & tools
lore

NeilBrown

author
#0 lore raw

PATCH 1/1 kNFSd - 4 of 7 - nfsdv4 byte range locking - prepatation

### Comments for ChangeSet

From: "William A.(Andy) Adamson" <[email protected]>

this first patch renames some structures and functions that can be used for byte-range locking as well as for the exiting open share locks, and does some cleanup.

-->Andy

----------- Diffstat output ------------

 ./fs/nfsd/nfs4proc.c         |   16 +++----
 ./fs/nfsd/nfs4state.c        |   94 +++++++++++++++++++++----------------------
 ./include/linux/nfsd/state.h |   16 +++----
 3 files changed, 63 insertions(+), 63 deletions(-)
fs/nfsd/nfs4proc.c renamed from fs/nfsd/nfs4proc.c~current~ +8 -8
diff ./fs/nfsd/nfs4proc.c~current~ ./fs/nfsd/nfs4proc.c
@@ -355,7 +355,7 @@ nfsd4_read(struct svc_rqst *rqstp, struc
 	if (read->rd_offset >= OFFSET_MAX)
 		return nfserr_inval;
 
-	nfsd4_lock_state();
+	nfs4_lock_state();
 	status = nfs_ok;
 	/* For stateid -1, we don't check share reservations.  */
 	if (ONE_STATEID(&read->rd_stateid)) {
@@ -388,7 +388,7 @@ nfsd4_read(struct svc_rqst *rqstp, struc
 	}
 	status = nfs_ok;
 out:
-	nfsd4_unlock_state();
+	nfs4_unlock_state();
 	read->rd_rqstp = rqstp;
 	read->rd_fhp = current_fh;
 	return status;
@@ -464,7 +464,7 @@ nfsd4_setattr(struct svc_rqst *rqstp, st
 			return status;
 		}
 
-		nfsd4_lock_state();
+		nfs4_lock_state();
 		if ((status = nfs4_preprocess_stateid_op(current_fh, 
 						&setattr->sa_stateid, 
 						CHECK_FH, &stp))) {
@@ -476,11 +476,11 @@ nfsd4_setattr(struct svc_rqst *rqstp, st
 			dprintk("NFSD: nfsd4_setattr: not opened for write!\n");
 			goto out;
 		}
-		nfsd4_unlock_state();
+		nfs4_unlock_state();
 	}
 	return (nfsd_setattr(rqstp, current_fh, &setattr->sa_iattr, 0, (time_t)0));
 out:
-	nfsd4_unlock_state();
+	nfs4_unlock_state();
 	return status;
 }
 
@@ -497,7 +497,7 @@ nfsd4_write(struct svc_rqst *rqstp, stru
 	if (write->wr_offset >= OFFSET_MAX)
 		return nfserr_inval;
 
-	nfsd4_lock_state();
+	nfs4_lock_state();
 	if (ZERO_STATEID(stateid) || ONE_STATEID(stateid)) {
 		dprintk("NFSD: nfsd4_write: zero stateid...\n");
 		if ((status = nfs4_share_conflict(current_fh, NFS4_SHARE_DENY_WRITE))) {
@@ -519,7 +519,7 @@ nfsd4_write(struct svc_rqst *rqstp, stru
 	}
 
 zero_stateid:
-	nfsd4_unlock_state();
+	nfs4_unlock_state();
 	write->wr_bytes_written = write->wr_buflen;
 	write->wr_how_written = write->wr_stable_how;
 	p = (u32 *)write->wr_verifier;
@@ -530,7 +530,7 @@ zero_stateid:
 			  write->wr_vec, write->wr_vlen, write->wr_buflen,
 			  &write->wr_how_written));
 out:
-	nfsd4_unlock_state();
+	nfs4_unlock_state();
 	return status;
 }
 
fs/nfsd/nfs4state.c renamed from fs/nfsd/nfs4state.c~current~ +47 -47

300 lines not on this page · raw message

include/linux/nfsd/state.h renamed from include/linux/nfsd/state.h~current~ +8 -8
diff ./include/linux/nfsd/state.h~current~ ./include/linux/nfsd/state.h
@@ -119,14 +119,14 @@ struct nfs4_replay {
 /*
 * nfs4_stateowner can either be an open_owner, or (eventually) a lock_owner
 *
-*    o so_peropenstate list is used to ensure no dangling nfs4_stateid
+*    o so_perfilestate list is used to ensure no dangling nfs4_stateid
 *              reverences when we release a stateowner.
 */
 struct nfs4_stateowner {
 	struct list_head        so_idhash;   /* hash by so_id */
 	struct list_head        so_strhash;   /* hash by op_name */
 	struct list_head        so_perclient; /* nfs4_client->cl_perclient */
-	struct list_head        so_peropenstate; /* list: nfs4_stateid */
+	struct list_head        so_perfilestate; /* list: nfs4_stateid */
 	u32                     so_id;
 	struct nfs4_client *    so_client;
 	u32                     so_seqid;    
@@ -145,7 +145,7 @@ struct nfs4_file {
 	struct list_head        fi_perfile; /* list: nfs4_stateid */
 	struct inode		*fi_inode;
 	u32                     fi_id;      /* used with stateowner->so_id 
-					     * for openstateid_hashtbl hash */
+					     * for stateid_hashtbl hash */
 };
 
 /*
@@ -155,9 +155,9 @@ struct nfs4_file {
 */
 
 struct nfs4_stateid {
-	struct list_head              st_hash; /* openstateid_hashtbl[]*/
-	struct list_head              st_perfile; /* file_hashtbl[]*/
-	struct list_head              st_peropenstate; /* nfs4_stateowner->so_peropenstate */
+	struct list_head              st_hash;
+	struct list_head              st_perfile;
+	struct list_head              st_perfilestate;
 	struct nfs4_stateowner      * st_stateowner;
 	struct nfs4_file            * st_file;
 	stateid_t                     st_stateid;
@@ -183,6 +183,6 @@ extern int nfs4_preprocess_stateid_op(st
 		stateid_t *stateid, int flags, struct nfs4_stateid **stpp);
 extern int nfs4_share_conflict(struct svc_fh *current_fh, 
 		unsigned int deny_type);
-extern void nfsd4_lock_state(void);
-extern void nfsd4_unlock_state(void);
+extern void nfs4_lock_state(void);
+extern void nfs4_unlock_state(void);
 #endif   /* NFSD4_STATE_H */

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs