diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-12-23 15:21:56 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-12-23 15:21:56 -0500 |
commit | dc0b027dfadfcb8a5504f7d8052754bf8d501ab9 (patch) | |
tree | f27f81794950b8a159e8045b7b6a74f19f2ac26e /fs/nfs/nfs4state.c | |
parent | 7a50c60e461f6ff97428da9448c3dad5b7bef491 (diff) |
NFSv4: Convert the open and close ops to use fmode
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r-- | fs/nfs/nfs4state.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index cd16b301f13c..2022fe47966f 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -363,18 +363,18 @@ nfs4_alloc_open_state(void) | |||
363 | } | 363 | } |
364 | 364 | ||
365 | void | 365 | void |
366 | nfs4_state_set_mode_locked(struct nfs4_state *state, mode_t mode) | 366 | nfs4_state_set_mode_locked(struct nfs4_state *state, fmode_t fmode) |
367 | { | 367 | { |
368 | if (state->state == mode) | 368 | if (state->state == fmode) |
369 | return; | 369 | return; |
370 | /* NB! List reordering - see the reclaim code for why. */ | 370 | /* NB! List reordering - see the reclaim code for why. */ |
371 | if ((mode & FMODE_WRITE) != (state->state & FMODE_WRITE)) { | 371 | if ((fmode & FMODE_WRITE) != (state->state & FMODE_WRITE)) { |
372 | if (mode & FMODE_WRITE) | 372 | if (fmode & FMODE_WRITE) |
373 | list_move(&state->open_states, &state->owner->so_states); | 373 | list_move(&state->open_states, &state->owner->so_states); |
374 | else | 374 | else |
375 | list_move_tail(&state->open_states, &state->owner->so_states); | 375 | list_move_tail(&state->open_states, &state->owner->so_states); |
376 | } | 376 | } |
377 | state->state = mode; | 377 | state->state = fmode; |
378 | } | 378 | } |
379 | 379 | ||
380 | static struct nfs4_state * | 380 | static struct nfs4_state * |
@@ -454,16 +454,16 @@ void nfs4_put_open_state(struct nfs4_state *state) | |||
454 | /* | 454 | /* |
455 | * Close the current file. | 455 | * Close the current file. |
456 | */ | 456 | */ |
457 | static void __nfs4_close(struct path *path, struct nfs4_state *state, mode_t mode, int wait) | 457 | static void __nfs4_close(struct path *path, struct nfs4_state *state, fmode_t fmode, int wait) |
458 | { | 458 | { |
459 | struct nfs4_state_owner *owner = state->owner; | 459 | struct nfs4_state_owner *owner = state->owner; |
460 | int call_close = 0; | 460 | int call_close = 0; |
461 | int newstate; | 461 | fmode_t newstate; |
462 | 462 | ||
463 | atomic_inc(&owner->so_count); | 463 | atomic_inc(&owner->so_count); |
464 | /* Protect against nfs4_find_state() */ | 464 | /* Protect against nfs4_find_state() */ |
465 | spin_lock(&owner->so_lock); | 465 | spin_lock(&owner->so_lock); |
466 | switch (mode & (FMODE_READ | FMODE_WRITE)) { | 466 | switch (fmode & (FMODE_READ | FMODE_WRITE)) { |
467 | case FMODE_READ: | 467 | case FMODE_READ: |
468 | state->n_rdonly--; | 468 | state->n_rdonly--; |
469 | break; | 469 | break; |
@@ -498,14 +498,14 @@ static void __nfs4_close(struct path *path, struct nfs4_state *state, mode_t mod | |||
498 | nfs4_do_close(path, state, wait); | 498 | nfs4_do_close(path, state, wait); |
499 | } | 499 | } |
500 | 500 | ||
501 | void nfs4_close_state(struct path *path, struct nfs4_state *state, mode_t mode) | 501 | void nfs4_close_state(struct path *path, struct nfs4_state *state, fmode_t fmode) |
502 | { | 502 | { |
503 | __nfs4_close(path, state, mode, 0); | 503 | __nfs4_close(path, state, fmode, 0); |
504 | } | 504 | } |
505 | 505 | ||
506 | void nfs4_close_sync(struct path *path, struct nfs4_state *state, mode_t mode) | 506 | void nfs4_close_sync(struct path *path, struct nfs4_state *state, fmode_t fmode) |
507 | { | 507 | { |
508 | __nfs4_close(path, state, mode, 1); | 508 | __nfs4_close(path, state, fmode, 1); |
509 | } | 509 | } |
510 | 510 | ||
511 | /* | 511 | /* |