fs/nfs/nfs4proc.c | 73 ++++++++++-------------------------------------- fs/nfs/nfs4xdr.c | 12 ------- include/linux/nfs_xdr.h | 7 ---- 3 files changed, 16 insertions(+), 76 deletions(-) diff -u --recursive --new-file --show-c-function linux-2.6.5-24-decompoundify_statfs/fs/nfs/nfs4proc.c linux-2.6.5-25-decompoundify_unlink/fs/nfs/nfs4proc.c --- linux-2.6.5-24-decompoundify_statfs/fs/nfs/nfs4proc.c 2004-03-24 00:48:48.000000000 -0500 +++ linux-2.6.5-25-decompoundify_unlink/fs/nfs/nfs4proc.c 2004-03-24 00:48:57.000000000 -0500 @@ -116,27 +116,6 @@ u32 nfs4_pathconf_bitmap[2] = { 0 }; -static inline void -__nfs4_setup_getattr(struct nfs4_compound *cp, u32 *bitmap, - struct nfs_fattr *fattr) -{ - struct nfs4_getattr *getattr = GET_OP(cp, getattr); - - getattr->gt_bmval = bitmap; - getattr->gt_attrs = fattr; - getattr->gt_fsstat = NULL; - - OPNUM(cp) = OP_GETATTR; - cp->req_nops++; -} - -static void -nfs4_setup_getattr(struct nfs4_compound *cp, - struct nfs_fattr *fattr) -{ - __nfs4_setup_getattr(cp, nfs4_fattr_bitmap, fattr); -} - static void nfs4_setup_putfh(struct nfs4_compound *cp, struct nfs_fh *fhandle) { @@ -221,18 +200,6 @@ nfs4_setup_readlink(struct nfs4_compound } static void -nfs4_setup_remove(struct nfs4_compound *cp, struct qstr *name, struct nfs4_change_info *cinfo) -{ - struct nfs4_remove *remove = GET_OP(cp, remove); - - remove->name = name; - remove->rm_cinfo = cinfo; - - OPNUM(cp) = OP_REMOVE; - cp->req_nops++; -} - -static void renew_lease(struct nfs_server *server, unsigned long timestamp) { struct nfs4_client *clp = server->nfs4_state; @@ -1100,46 +1067,38 @@ static int nfs4_proc_remove(struct inode } struct unlink_desc { - struct nfs4_compound compound; - struct nfs4_op ops[3]; - struct nfs4_change_info cinfo; - struct nfs_fattr attrs; + struct nfs4_remove_arg args; + struct nfs4_change_info res; }; -static int -nfs4_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, struct qstr *name) +static int nfs4_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, + struct qstr *name) { - struct unlink_desc * up; - struct nfs4_compound * cp; + struct unlink_desc *up; up = (struct unlink_desc *) kmalloc(sizeof(*up), GFP_KERNEL); if (!up) return -ENOMEM; - cp = &up->compound; - nfs4_setup_compound(cp, up->ops, NFS_SERVER(dir->d_inode), "unlink_setup"); - nfs4_setup_putfh(cp, NFS_FH(dir->d_inode)); - nfs4_setup_remove(cp, name, &up->cinfo); - nfs4_setup_getattr(cp, &up->attrs); - - msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMPOUND]; - msg->rpc_argp = cp; - msg->rpc_resp = cp; + up->args.fh = NFS_FH(dir->d_inode); + up->args.name = name; + + msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_REMOVE]; + msg->rpc_argp = &up->args; + msg->rpc_resp = &up->res; return 0; } -static int -nfs4_proc_unlink_done(struct dentry *dir, struct rpc_task *task) +static int nfs4_proc_unlink_done(struct dentry *dir, struct rpc_task *task) { struct rpc_message *msg = &task->tk_msg; struct unlink_desc *up; - if (msg->rpc_argp) { - up = (struct unlink_desc *) msg->rpc_argp; - process_lease(&up->compound); - process_cinfo(&up->cinfo, &up->attrs); - nfs_refresh_inode(dir->d_inode, &up->attrs); + if (msg->rpc_resp != NULL) { + up = container_of(msg->rpc_resp, struct unlink_desc, res); + update_changeattr(dir->d_inode, &up->res); kfree(up); + msg->rpc_resp = NULL; msg->rpc_argp = NULL; } return 0; diff -u --recursive --new-file --show-c-function linux-2.6.5-24-decompoundify_statfs/fs/nfs/nfs4xdr.c linux-2.6.5-25-decompoundify_unlink/fs/nfs/nfs4xdr.c --- linux-2.6.5-24-decompoundify_statfs/fs/nfs/nfs4xdr.c 2004-03-24 00:48:48.000000000 -0500 +++ linux-2.6.5-25-decompoundify_unlink/fs/nfs/nfs4xdr.c 2004-03-24 00:48:57.000000000 -0500 @@ -1138,9 +1138,6 @@ encode_compound(struct xdr_stream *xdr, for (i = 0; i < cp->req_nops; i++) { switch (cp->ops[i].opnum) { - case OP_GETATTR: - status = encode_getattr(xdr, &cp->ops[i].u.getattr); - break; case OP_PUTFH: status = encode_putfh(xdr, cp->ops[i].u.putfh.pf_fhandle); break; @@ -1150,9 +1147,6 @@ encode_compound(struct xdr_stream *xdr, case OP_READLINK: status = encode_readlink(xdr, &cp->ops[i].u.readlink, req); break; - case OP_REMOVE: - status = encode_remove(xdr, cp->ops[i].u.remove.name); - break; default: BUG(); } @@ -3224,9 +3218,6 @@ decode_compound(struct xdr_stream *xdr, op = &cp->ops[0]; for (cp->nops = 0; cp->nops < cp->resp_nops; cp->nops++, op++) { switch (op->opnum) { - case OP_GETATTR: - status = decode_getattr(xdr, &op->u.getattr, cp->server); - break; case OP_PUTFH: status = decode_putfh(xdr); break; @@ -3236,9 +3227,6 @@ decode_compound(struct xdr_stream *xdr, case OP_READLINK: status = decode_readlink(xdr, req, &op->u.readlink); break; - case OP_REMOVE: - status = decode_remove(xdr, op->u.remove.rm_cinfo); - break; default: BUG(); return -EIO; diff -u --recursive --new-file --show-c-function linux-2.6.5-24-decompoundify_statfs/include/linux/nfs_xdr.h linux-2.6.5-25-decompoundify_unlink/include/linux/nfs_xdr.h --- linux-2.6.5-24-decompoundify_statfs/include/linux/nfs_xdr.h 2004-03-24 00:48:48.000000000 -0500 +++ linux-2.6.5-25-decompoundify_unlink/include/linux/nfs_xdr.h 2004-03-24 00:48:57.000000000 -0500 @@ -613,11 +613,6 @@ struct nfs4_readlink { struct page ** rl_pages; /* zero-copy data */ }; -struct nfs4_remove { - struct qstr * name; /* request */ - struct nfs4_change_info * rm_cinfo; /* response */ -}; - struct nfs4_remove_arg { const struct nfs_fh * fh; const struct qstr * name; @@ -659,13 +654,11 @@ struct nfs4_op { u32 opnum; union { struct nfs4_close close; - struct nfs4_getattr getattr; struct nfs4_open open; struct nfs4_open_confirm open_confirm; struct nfs4_putfh putfh; struct nfs4_readdir readdir; struct nfs4_readlink readlink; - struct nfs4_remove remove; struct nfs4_client * renew; struct nfs4_setattr setattr; } u;