-/*
- * TODO: For the time being, we don't try to get any attributes
- * along with any of the zero-copy operations READ, READDIR,
- * READLINK, WRITE.
- *
- * In the case of the first three, we want to put the GETATTR
- * after the read-type operation -- this is because it is hard
- * to predict the length of a GETATTR response in v4, and thus
- * align the READ data correctly. This means that the GETATTR
- * may end up partially falling into the page cache, and we should
- * shift it into the 'tail' of the xdr_buf before processing.
- * To do this efficiently, we need to know the total length
- * of data received, which doesn't seem to be available outside
- * of the RPC layer.
- *
- * In the case of WRITE, we also want to put the GETATTR after
- * the operation -- in this case because we want to make sure
- * we get the post-operation mtime and size. This means that
- * we can't use xdr_encode_pages() as written: we need a variant
- * of it which would leave room in the 'tail' iovec.
- *
- * Both of these changes to the XDR layer would in fact be quite
- * minor, but I decided to leave them for a subsequent patch.
- */
-static int _nfs4_proc_readlink(struct inode *inode, struct page *page,
- unsigned int pgbase, unsigned int pglen)
-{
- struct nfs4_readlink args = {
- .fh = NFS_FH(inode),
- .pgbase = pgbase,
- .pglen = pglen,
- .pages = &page,
- };
- struct rpc_message msg = {
- .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_READLINK],
- .rpc_argp = &args,
- .rpc_resp = NULL,
- };
-
- return rpc_call_sync(NFS_CLIENT(inode), &msg, 0);
-}
-
-static int nfs4_proc_readlink(struct inode *inode, struct page *page,
- unsigned int pgbase, unsigned int pglen)
-{
- struct nfs4_exception exception = { };
- int err;
- do {
- err = nfs4_handle_exception(NFS_SERVER(inode),
- _nfs4_proc_readlink(inode, page, pgbase, pglen),
- &exception);
- } while (exception.retry);
- return err;
-}
-
-static int _nfs4_proc_read(struct nfs_read_data *rdata)
-{
- int flags = rdata->flags;
- struct inode *inode = rdata->inode;
- struct nfs_fattr *fattr = rdata->res.fattr;
- struct nfs_server *server = NFS_SERVER(inode);
- struct rpc_message msg = {
- .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_READ],
- .rpc_argp = &rdata->args,
- .rpc_resp = &rdata->res,
- .rpc_cred = rdata->cred,
- };
- unsigned long timestamp = jiffies;
- int status;
-
- dprintk("NFS call read %d @ %Ld\n", rdata->args.count,
- (long long) rdata->args.offset);
-
- nfs_fattr_init(fattr);
- status = rpc_call_sync(server->client, &msg, flags);
- if (!status)
- renew_lease(server, timestamp);
- dprintk("NFS reply read: %d\n", status);
- return status;
-}
-
-static int nfs4_proc_read(struct nfs_read_data *rdata)
-{
- struct nfs4_exception exception = { };
- int err;
- do {
- err = nfs4_handle_exception(NFS_SERVER(rdata->inode),
- _nfs4_proc_read(rdata),
- &exception);
- } while (exception.retry);
- return err;
-}
-
-static int _nfs4_proc_write(struct nfs_write_data *wdata)
-{
- int rpcflags = wdata->flags;
- struct inode *inode = wdata->inode;
- struct nfs_fattr *fattr = wdata->res.fattr;
- struct nfs_server *server = NFS_SERVER(inode);
- struct rpc_message msg = {
- .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_WRITE],
- .rpc_argp = &wdata->args,
- .rpc_resp = &wdata->res,
- .rpc_cred = wdata->cred,
- };
- int status;
-
- dprintk("NFS call write %d @ %Ld\n", wdata->args.count,
- (long long) wdata->args.offset);
-
- wdata->args.bitmask = server->attr_bitmask;
- wdata->res.server = server;
- nfs_fattr_init(fattr);
- status = rpc_call_sync(server->client, &msg, rpcflags);
- dprintk("NFS reply write: %d\n", status);
- if (status < 0)
- return status;
- nfs_post_op_update_inode(inode, fattr);
- return wdata->res.count;
-}
-
-static int nfs4_proc_write(struct nfs_write_data *wdata)
-{
- struct nfs4_exception exception = { };
- int err;
- do {
- err = nfs4_handle_exception(NFS_SERVER(wdata->inode),
- _nfs4_proc_write(wdata),
- &exception);
- } while (exception.retry);
- return err;
-}
-
-static int _nfs4_proc_commit(struct nfs_write_data *cdata)
+/*
+ * TODO: For the time being, we don't try to get any attributes
+ * along with any of the zero-copy operations READ, READDIR,
+ * READLINK, WRITE.
+ *
+ * In the case of the first three, we want to put the GETATTR
+ * after the read-type operation -- this is because it is hard
+ * to predict the length of a GETATTR response in v4, and thus
+ * align the READ data correctly. This means that the GETATTR
+ * may end up partially falling into the page cache, and we should
+ * shift it into the 'tail' of the xdr_buf before processing.
+ * To do this efficiently, we need to know the total length
+ * of data received, which doesn't seem to be available outside
+ * of the RPC layer.
+ *
+ * In the case of WRITE, we also want to put the GETATTR after
+ * the operation -- in this case because we want to make sure
+ * we get the post-operation mtime and size. This means that
+ * we can't use xdr_encode_pages() as written: we need a variant
+ * of it which would leave room in the 'tail' iovec.
+ *
+ * Both of these changes to the XDR layer would in fact be quite
+ * minor, but I decided to leave them for a subsequent patch.
+ */
+static int _nfs4_proc_readlink(struct inode *inode, struct page *page,
+ unsigned int pgbase, unsigned int pglen)