]> Pileus Git - ~andy/linux/blobdiff - fs/nfs/nfs4state.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rric/oprofile
[~andy/linux] / fs / nfs / nfs4state.c
index 9e76712dcae9090f674cbc1d79df45f0743986e5..2022fe47966f52d641496fe633ad0d0b98b15fc7 100644 (file)
@@ -363,18 +363,18 @@ nfs4_alloc_open_state(void)
 }
 
 void
-nfs4_state_set_mode_locked(struct nfs4_state *state, mode_t mode)
+nfs4_state_set_mode_locked(struct nfs4_state *state, fmode_t fmode)
 {
-       if (state->state == mode)
+       if (state->state == fmode)
                return;
        /* NB! List reordering - see the reclaim code for why.  */
-       if ((mode & FMODE_WRITE) != (state->state & FMODE_WRITE)) {
-               if (mode & FMODE_WRITE)
+       if ((fmode & FMODE_WRITE) != (state->state & FMODE_WRITE)) {
+               if (fmode & FMODE_WRITE)
                        list_move(&state->open_states, &state->owner->so_states);
                else
                        list_move_tail(&state->open_states, &state->owner->so_states);
        }
-       state->state = mode;
+       state->state = fmode;
 }
 
 static struct nfs4_state *
@@ -454,16 +454,16 @@ void nfs4_put_open_state(struct nfs4_state *state)
 /*
  * Close the current file.
  */
-static void __nfs4_close(struct path *path, struct nfs4_state *state, mode_t mode, int wait)
+static void __nfs4_close(struct path *path, struct nfs4_state *state, fmode_t fmode, int wait)
 {
        struct nfs4_state_owner *owner = state->owner;
        int call_close = 0;
-       int newstate;
+       fmode_t newstate;
 
        atomic_inc(&owner->so_count);
        /* Protect against nfs4_find_state() */
        spin_lock(&owner->so_lock);
-       switch (mode & (FMODE_READ | FMODE_WRITE)) {
+       switch (fmode & (FMODE_READ | FMODE_WRITE)) {
                case FMODE_READ:
                        state->n_rdonly--;
                        break;
@@ -498,14 +498,14 @@ static void __nfs4_close(struct path *path, struct nfs4_state *state, mode_t mod
                nfs4_do_close(path, state, wait);
 }
 
-void nfs4_close_state(struct path *path, struct nfs4_state *state, mode_t mode)
+void nfs4_close_state(struct path *path, struct nfs4_state *state, fmode_t fmode)
 {
-       __nfs4_close(path, state, mode, 0);
+       __nfs4_close(path, state, fmode, 0);
 }
 
-void nfs4_close_sync(struct path *path, struct nfs4_state *state, mode_t mode)
+void nfs4_close_sync(struct path *path, struct nfs4_state *state, fmode_t fmode)
 {
-       __nfs4_close(path, state, mode, 1);
+       __nfs4_close(path, state, fmode, 1);
 }
 
 /*
@@ -781,7 +781,7 @@ static void nfs4_clear_state_manager_bit(struct nfs_client *clp)
 /*
  * Schedule the nfs_client asynchronous state management routine
  */
-static void nfs4_schedule_state_manager(struct nfs_client *clp)
+void nfs4_schedule_state_manager(struct nfs_client *clp)
 {
        struct task_struct *task;
 
@@ -951,7 +951,6 @@ static void nfs4_clear_open_state(struct nfs4_state *state)
        clear_bit(NFS_O_WRONLY_STATE, &state->flags);
        clear_bit(NFS_O_RDWR_STATE, &state->flags);
        list_for_each_entry(lock, &state->lock_states, ls_locks) {
-               lock->ls_seqid.counter = 0;
                lock->ls_seqid.flags = 0;
                lock->ls_flags &= ~NFS_LOCK_INITIALIZED;
        }
@@ -966,7 +965,6 @@ static void nfs4_state_mark_reclaim_helper(struct nfs_client *clp, int (*mark_re
        /* Reset all sequence ids to zero */
        for (pos = rb_first(&clp->cl_state_owners); pos != NULL; pos = rb_next(pos)) {
                sp = rb_entry(pos, struct nfs4_state_owner, so_client_node);
-               sp->so_seqid.counter = 0;
                sp->so_seqid.flags = 0;
                spin_lock(&sp->so_lock);
                list_for_each_entry(state, &sp->so_states, open_states) {