Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57131
b: refs/heads/master
c: b4946ff
h: refs/heads/master
i:
  57129: 4bf7b91
  57127: 037fc3c
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed May 30, 2007
1 parent 65a87d6 commit 8df3843
Show file tree
Hide file tree
Showing 2 changed files with 10 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: 7a74fc4925067c2102175baef73f9b07ab519b71
refs/heads/master: b4946ffb1860597b187d78d61ac6504177eb0ff8
12 changes: 9 additions & 3 deletions trunk/fs/nfs/direct.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static inline struct nfs_direct_req *nfs_direct_req_alloc(void)
return dreq;
}

static void nfs_direct_req_release(struct kref *kref)
static void nfs_direct_req_free(struct kref *kref)
{
struct nfs_direct_req *dreq = container_of(kref, struct nfs_direct_req, kref);

Expand All @@ -177,6 +177,11 @@ static void nfs_direct_req_release(struct kref *kref)
kmem_cache_free(nfs_direct_cachep, dreq);
}

static void nfs_direct_req_release(struct nfs_direct_req *dreq)
{
kref_put(&dreq->kref, nfs_direct_req_free);
}

/*
* Collects and returns the final error value/byte-count.
*/
Expand All @@ -196,7 +201,6 @@ static ssize_t nfs_direct_wait(struct nfs_direct_req *dreq)
result = dreq->count;

out:
kref_put(&dreq->kref, nfs_direct_req_release);
return (ssize_t) result;
}

Expand All @@ -214,7 +218,7 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq)
}
complete_all(&dreq->completion);

kref_put(&dreq->kref, nfs_direct_req_release);
nfs_direct_req_release(dreq);
}

/*
Expand Down Expand Up @@ -369,6 +373,7 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, unsigned long user_addr, size
if (!result)
result = nfs_direct_wait(dreq);
rpc_clnt_sigunmask(clnt, &oldset);
nfs_direct_req_release(dreq);

return result;
}
Expand Down Expand Up @@ -716,6 +721,7 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, siz
if (!result)
result = nfs_direct_wait(dreq);
rpc_clnt_sigunmask(clnt, &oldset);
nfs_direct_req_release(dreq);

return result;
}
Expand Down

0 comments on commit 8df3843

Please sign in to comment.