Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88be9f99 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

NFS: Replace vfsmount and dentry in nfs_open_context with struct path

parent de05a0cc
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -74,7 +74,7 @@ again:
			continue;
			continue;
		get_nfs_open_context(ctx);
		get_nfs_open_context(ctx);
		spin_unlock(&inode->i_lock);
		spin_unlock(&inode->i_lock);
		err = nfs4_open_delegation_recall(ctx->dentry, state);
		err = nfs4_open_delegation_recall(ctx->path.dentry, state);
		if (err >= 0)
		if (err >= 0)
			err = nfs_delegation_claim_locks(ctx, state);
			err = nfs_delegation_claim_locks(ctx, state);
		put_nfs_open_context(ctx);
		put_nfs_open_context(ctx);
+2 −2
Original line number Original line Diff line number Diff line
@@ -266,7 +266,7 @@ static const struct rpc_call_ops nfs_read_direct_ops = {
static ssize_t nfs_direct_read_schedule(struct nfs_direct_req *dreq, unsigned long user_addr, size_t count, loff_t pos)
static ssize_t nfs_direct_read_schedule(struct nfs_direct_req *dreq, unsigned long user_addr, size_t count, loff_t pos)
{
{
	struct nfs_open_context *ctx = dreq->ctx;
	struct nfs_open_context *ctx = dreq->ctx;
	struct inode *inode = ctx->dentry->d_inode;
	struct inode *inode = ctx->path.dentry->d_inode;
	size_t rsize = NFS_SERVER(inode)->rsize;
	size_t rsize = NFS_SERVER(inode)->rsize;
	unsigned int pgbase;
	unsigned int pgbase;
	int result;
	int result;
@@ -606,7 +606,7 @@ static const struct rpc_call_ops nfs_write_direct_ops = {
static ssize_t nfs_direct_write_schedule(struct nfs_direct_req *dreq, unsigned long user_addr, size_t count, loff_t pos, int sync)
static ssize_t nfs_direct_write_schedule(struct nfs_direct_req *dreq, unsigned long user_addr, size_t count, loff_t pos, int sync)
{
{
	struct nfs_open_context *ctx = dreq->ctx;
	struct nfs_open_context *ctx = dreq->ctx;
	struct inode *inode = ctx->dentry->d_inode;
	struct inode *inode = ctx->path.dentry->d_inode;
	size_t wsize = NFS_SERVER(inode)->wsize;
	size_t wsize = NFS_SERVER(inode)->wsize;
	unsigned int pgbase;
	unsigned int pgbase;
	int result;
	int result;
+5 −5
Original line number Original line Diff line number Diff line
@@ -462,8 +462,8 @@ static struct nfs_open_context *alloc_nfs_open_context(struct vfsmount *mnt, str
	ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
	ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
	if (ctx != NULL) {
	if (ctx != NULL) {
		atomic_set(&ctx->count, 1);
		atomic_set(&ctx->count, 1);
		ctx->dentry = dget(dentry);
		ctx->path.dentry = dget(dentry);
		ctx->vfsmnt = mntget(mnt);
		ctx->path.mnt = mntget(mnt);
		ctx->cred = get_rpccred(cred);
		ctx->cred = get_rpccred(cred);
		ctx->state = NULL;
		ctx->state = NULL;
		ctx->lockowner = current->files;
		ctx->lockowner = current->files;
@@ -484,7 +484,7 @@ void put_nfs_open_context(struct nfs_open_context *ctx)
{
{
	if (atomic_dec_and_test(&ctx->count)) {
	if (atomic_dec_and_test(&ctx->count)) {
		if (!list_empty(&ctx->list)) {
		if (!list_empty(&ctx->list)) {
			struct inode *inode = ctx->dentry->d_inode;
			struct inode *inode = ctx->path.dentry->d_inode;
			spin_lock(&inode->i_lock);
			spin_lock(&inode->i_lock);
			list_del(&ctx->list);
			list_del(&ctx->list);
			spin_unlock(&inode->i_lock);
			spin_unlock(&inode->i_lock);
@@ -493,8 +493,8 @@ void put_nfs_open_context(struct nfs_open_context *ctx)
			nfs4_close_state(ctx->state, ctx->mode);
			nfs4_close_state(ctx->state, ctx->mode);
		if (ctx->cred != NULL)
		if (ctx->cred != NULL)
			put_rpccred(ctx->cred);
			put_rpccred(ctx->cred);
		dput(ctx->dentry);
		dput(ctx->path.dentry);
		mntput(ctx->vfsmnt);
		mntput(ctx->path.mnt);
		kfree(ctx);
		kfree(ctx);
	}
	}
}
}
+3 −3
Original line number Original line Diff line number Diff line
@@ -512,7 +512,7 @@ static int nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *sta
	ctx = nfs4_state_find_open_context(state);
	ctx = nfs4_state_find_open_context(state);
	if (IS_ERR(ctx))
	if (IS_ERR(ctx))
		return PTR_ERR(ctx);
		return PTR_ERR(ctx);
	ret = nfs4_do_open_reclaim(sp, state, ctx->dentry);
	ret = nfs4_do_open_reclaim(sp, state, ctx->path.dentry);
	put_nfs_open_context(ctx);
	put_nfs_open_context(ctx);
	return ret;
	return ret;
}
}
@@ -862,7 +862,7 @@ static int nfs4_open_expired(struct nfs4_state_owner *sp, struct nfs4_state *sta
	ctx = nfs4_state_find_open_context(state);
	ctx = nfs4_state_find_open_context(state);
	if (IS_ERR(ctx))
	if (IS_ERR(ctx))
		return PTR_ERR(ctx);
		return PTR_ERR(ctx);
	ret = nfs4_do_open_expired(sp, state, ctx->dentry);
	ret = nfs4_do_open_expired(sp, state, ctx->path.dentry);
	put_nfs_open_context(ctx);
	put_nfs_open_context(ctx);
	return ret;
	return ret;
}
}
@@ -3285,7 +3285,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
		memcpy(data->lsp->ls_stateid.data, data->res.stateid.data,
		memcpy(data->lsp->ls_stateid.data, data->res.stateid.data,
					sizeof(data->lsp->ls_stateid.data));
					sizeof(data->lsp->ls_stateid.data));
		data->lsp->ls_flags |= NFS_LOCK_INITIALIZED;
		data->lsp->ls_flags |= NFS_LOCK_INITIALIZED;
		renew_lease(NFS_SERVER(data->ctx->dentry->d_inode), data->timestamp);
		renew_lease(NFS_SERVER(data->ctx->path.dentry->d_inode), data->timestamp);
	}
	}
	nfs_increment_lock_seqid(data->rpc_status, data->arg.lock_seqid);
	nfs_increment_lock_seqid(data->rpc_status, data->arg.lock_seqid);
out:
out:
+3 −3
Original line number Original line Diff line number Diff line
@@ -114,7 +114,7 @@ void nfs_unlock_request(struct nfs_page *req)
 */
 */
int nfs_set_page_writeback_locked(struct nfs_page *req)
int nfs_set_page_writeback_locked(struct nfs_page *req)
{
{
	struct nfs_inode *nfsi = NFS_I(req->wb_context->dentry->d_inode);
	struct nfs_inode *nfsi = NFS_I(req->wb_context->path.dentry->d_inode);


	if (!nfs_lock_request(req))
	if (!nfs_lock_request(req))
		return 0;
		return 0;
@@ -127,7 +127,7 @@ int nfs_set_page_writeback_locked(struct nfs_page *req)
 */
 */
void nfs_clear_page_writeback(struct nfs_page *req)
void nfs_clear_page_writeback(struct nfs_page *req)
{
{
	struct nfs_inode *nfsi = NFS_I(req->wb_context->dentry->d_inode);
	struct nfs_inode *nfsi = NFS_I(req->wb_context->path.dentry->d_inode);


	if (req->wb_page != NULL) {
	if (req->wb_page != NULL) {
		spin_lock(&nfsi->req_lock);
		spin_lock(&nfsi->req_lock);
@@ -193,7 +193,7 @@ static int nfs_wait_bit_interruptible(void *word)
int
int
nfs_wait_on_request(struct nfs_page *req)
nfs_wait_on_request(struct nfs_page *req)
{
{
        struct rpc_clnt	*clnt = NFS_CLIENT(req->wb_context->dentry->d_inode);
	struct rpc_clnt *clnt = NFS_CLIENT(req->wb_context->path.dentry->d_inode);
	sigset_t oldmask;
	sigset_t oldmask;
	int ret = 0;
	int ret = 0;


Loading