Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206455
b: refs/heads/master
c: 998db52
h: refs/heads/master
i:
  206453: 0e6b0e3
  206451: ba4b41c
  206447: 6a34860
v: v3
  • Loading branch information
J. Bruce Fields committed Aug 7, 2010
1 parent 0d9f24c commit 47121d7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7fa53cc872332b265bc5ba1266f39586f218ad4a
refs/heads/master: 998db52c03cd293d16a457f1b396cea932244147
24 changes: 21 additions & 3 deletions trunk/fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,28 +162,46 @@ static struct list_head ownerstr_hashtbl[OWNER_HASH_SIZE];
static struct list_head file_hashtbl[FILE_HASH_SIZE];
static struct list_head stateid_hashtbl[STATEID_HASH_SIZE];

static inline void nfs4_file_get_access(struct nfs4_file *fp, int oflag)
static void __nfs4_file_get_access(struct nfs4_file *fp, int oflag)
{
BUG_ON(!(fp->fi_fds[oflag] || fp->fi_fds[O_RDWR]));
atomic_inc(&fp->fi_access[oflag]);
}

static inline void nfs4_file_put_fd(struct nfs4_file *fp, int oflag)
static void nfs4_file_get_access(struct nfs4_file *fp, int oflag)
{
if (oflag == O_RDWR) {
__nfs4_file_get_access(fp, O_RDONLY);
__nfs4_file_get_access(fp, O_WRONLY);
} else
__nfs4_file_get_access(fp, oflag);
}

static void nfs4_file_put_fd(struct nfs4_file *fp, int oflag)
{
if (fp->fi_fds[oflag]) {
fput(fp->fi_fds[oflag]);
fp->fi_fds[oflag] = NULL;
}
}

static inline void nfs4_file_put_access(struct nfs4_file *fp, int oflag)
static void __nfs4_file_put_access(struct nfs4_file *fp, int oflag)
{
if (atomic_dec_and_test(&fp->fi_access[oflag])) {
nfs4_file_put_fd(fp, O_RDWR);
nfs4_file_put_fd(fp, oflag);
}
}

static void nfs4_file_put_access(struct nfs4_file *fp, int oflag)
{
if (oflag == O_RDWR) {
__nfs4_file_put_access(fp, O_RDONLY);
__nfs4_file_put_access(fp, O_WRONLY);
} else
__nfs4_file_put_access(fp, oflag);
}

static struct nfs4_delegation *
alloc_init_deleg(struct nfs4_client *clp, struct nfs4_stateid *stp, struct svc_fh *current_fh, u32 type)
{
Expand Down

0 comments on commit 47121d7

Please sign in to comment.