]> err.no Git - linux-2.6/blobdiff - fs/nfs/nfs4_fs.h
Pull sbs into release branch
[linux-2.6] / fs / nfs / nfs4_fs.h
index 44b56c915f722a5deadba122d4e9e533cbc1cb8c..d2802b1ca3b9b84d57efbadd789c019094e2bc2e 100644 (file)
@@ -83,6 +83,7 @@ struct nfs_unique_id {
 struct nfs4_state_owner {
        struct nfs_unique_id so_owner_id;
        struct nfs_client    *so_client;
+       struct nfs_server    *so_server;
        struct rb_node       so_client_node;
 
        struct rpc_cred      *so_cred;   /* Associated cred */
@@ -122,7 +123,10 @@ struct nfs4_lock_state {
 /* bits for nfs4_state->flags */
 enum {
        LK_STATE_IN_USE,
-       NFS_DELEGATED_STATE,
+       NFS_DELEGATED_STATE,            /* Current stateid is delegation */
+       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 */
 };
 
 struct nfs4_state {
@@ -136,11 +140,14 @@ struct nfs4_state {
        unsigned long flags;            /* Do we hold any locks? */
        spinlock_t state_lock;          /* Protects the lock_states list */
 
-       nfs4_stateid stateid;
+       seqlock_t seqlock;              /* Protects the stateid/open_stateid */
+       nfs4_stateid stateid;           /* Current stateid: may be delegation */
+       nfs4_stateid open_stateid;      /* OPEN stateid */
 
-       unsigned int n_rdonly;
-       unsigned int n_wronly;
-       unsigned int n_rdwr;
+       /* The following 3 fields are protected by owner->so_lock */
+       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 */
        int state;                      /* State on the server (R,W, or RW) */
        atomic_t count;
 };
@@ -175,7 +182,7 @@ extern int nfs4_do_close(struct path *path, struct nfs4_state *state);
 extern struct dentry *nfs4_atomic_open(struct inode *, struct dentry *, struct nameidata *);
 extern int nfs4_open_revalidate(struct inode *, struct dentry *, int, struct nameidata *);
 extern int nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *fhandle);
-extern int nfs4_proc_fs_locations(struct inode *dir, struct qstr *name,
+extern int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name,
                struct nfs4_fs_locations *fs_locations, struct page *page);
 
 extern struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops;