1 /* AFS File Server client stubs
3 * Copyright (C) 2002, 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #include <linux/init.h>
13 #include <linux/sched.h>
14 #include <linux/circ_buf.h>
19 * decode an AFSFid block
21 static void xdr_decode_AFSFid(const __be32 **_bp, struct afs_fid *fid)
23 const __be32 *bp = *_bp;
25 fid->vid = ntohl(*bp++);
26 fid->vnode = ntohl(*bp++);
27 fid->unique = ntohl(*bp++);
32 * decode an AFSFetchStatus block
34 static void xdr_decode_AFSFetchStatus(const __be32 **_bp,
35 struct afs_file_status *status,
36 struct afs_vnode *vnode)
38 const __be32 *bp = *_bp;
40 u64 data_version, size;
41 u32 changed = 0; /* becomes non-zero if ctime-type changes seen */
43 #define EXTRACT(DST) \
45 u32 x = ntohl(*bp++); \
50 status->if_version = ntohl(*bp++);
51 EXTRACT(status->type);
52 EXTRACT(status->nlink);
54 data_version = ntohl(*bp++);
55 EXTRACT(status->author);
56 EXTRACT(status->owner);
57 EXTRACT(status->caller_access); /* call ticket dependent */
58 EXTRACT(status->anon_access);
59 EXTRACT(status->mode);
60 EXTRACT(status->parent.vnode);
61 EXTRACT(status->parent.unique);
63 status->mtime_client = ntohl(*bp++);
64 status->mtime_server = ntohl(*bp++);
65 EXTRACT(status->group);
66 bp++; /* sync counter */
67 data_version |= (u64) ntohl(*bp++) << 32;
68 bp++; /* lock count */
69 size |= (u64) ntohl(*bp++) << 32;
73 if (size != status->size) {
77 status->mode &= S_IALLUGO;
79 _debug("vnode time %lx, %lx",
80 status->mtime_client, status->mtime_server);
83 status->parent.vid = vnode->fid.vid;
84 if (changed && !test_bit(AFS_VNODE_UNSET, &vnode->flags)) {
85 _debug("vnode changed");
86 i_size_write(&vnode->vfs_inode, size);
87 vnode->vfs_inode.i_uid = status->owner;
88 vnode->vfs_inode.i_gid = status->group;
89 vnode->vfs_inode.i_version = vnode->fid.unique;
90 vnode->vfs_inode.i_nlink = status->nlink;
92 mode = vnode->vfs_inode.i_mode;
96 vnode->vfs_inode.i_mode = mode;
99 vnode->vfs_inode.i_ctime.tv_sec = status->mtime_server;
100 vnode->vfs_inode.i_mtime = vnode->vfs_inode.i_ctime;
101 vnode->vfs_inode.i_atime = vnode->vfs_inode.i_ctime;
104 if (status->data_version != data_version) {
105 status->data_version = data_version;
106 if (vnode && !test_bit(AFS_VNODE_UNSET, &vnode->flags)) {
107 _debug("vnode modified %llx on {%x:%u}",
108 data_version, vnode->fid.vid, vnode->fid.vnode);
109 set_bit(AFS_VNODE_MODIFIED, &vnode->flags);
110 set_bit(AFS_VNODE_ZAP_DATA, &vnode->flags);
116 * decode an AFSCallBack block
118 static void xdr_decode_AFSCallBack(const __be32 **_bp, struct afs_vnode *vnode)
120 const __be32 *bp = *_bp;
122 vnode->cb_version = ntohl(*bp++);
123 vnode->cb_expiry = ntohl(*bp++);
124 vnode->cb_type = ntohl(*bp++);
125 vnode->cb_expires = vnode->cb_expiry + get_seconds();
129 static void xdr_decode_AFSCallBack_raw(const __be32 **_bp,
130 struct afs_callback *cb)
132 const __be32 *bp = *_bp;
134 cb->version = ntohl(*bp++);
135 cb->expiry = ntohl(*bp++);
136 cb->type = ntohl(*bp++);
141 * decode an AFSVolSync block
143 static void xdr_decode_AFSVolSync(const __be32 **_bp,
144 struct afs_volsync *volsync)
146 const __be32 *bp = *_bp;
148 volsync->creation = ntohl(*bp++);
158 * deliver reply data to an FS.FetchStatus
160 static int afs_deliver_fs_fetch_status(struct afs_call *call,
161 struct sk_buff *skb, bool last)
163 struct afs_vnode *vnode = call->reply;
166 _enter(",,%u", last);
168 afs_transfer_reply(call, skb);
172 if (call->reply_size != call->reply_max)
175 /* unmarshall the reply once we've received all of it */
177 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode);
178 xdr_decode_AFSCallBack(&bp, vnode);
180 xdr_decode_AFSVolSync(&bp, call->reply2);
182 _leave(" = 0 [done]");
187 * FS.FetchStatus operation type
189 static const struct afs_call_type afs_RXFSFetchStatus = {
190 .name = "FS.FetchStatus",
191 .deliver = afs_deliver_fs_fetch_status,
192 .abort_to_error = afs_abort_to_error,
193 .destructor = afs_flat_call_destructor,
197 * fetch the status information for a file
199 int afs_fs_fetch_file_status(struct afs_server *server,
201 struct afs_vnode *vnode,
202 struct afs_volsync *volsync,
203 const struct afs_wait_mode *wait_mode)
205 struct afs_call *call;
208 _enter(",%x,{%x:%d},,",
209 key_serial(key), vnode->fid.vid, vnode->fid.vnode);
211 call = afs_alloc_flat_call(&afs_RXFSFetchStatus, 16, (21 + 3 + 6) * 4);
217 call->reply2 = volsync;
218 call->service_id = FS_SERVICE;
219 call->port = htons(AFS_FS_PORT);
221 /* marshall the parameters */
223 bp[0] = htonl(FSFETCHSTATUS);
224 bp[1] = htonl(vnode->fid.vid);
225 bp[2] = htonl(vnode->fid.vnode);
226 bp[3] = htonl(vnode->fid.unique);
228 return afs_make_call(&server->addr, call, GFP_NOFS, wait_mode);
232 * deliver reply data to an FS.FetchData
234 static int afs_deliver_fs_fetch_data(struct afs_call *call,
235 struct sk_buff *skb, bool last)
237 struct afs_vnode *vnode = call->reply;
243 _enter("{%u},{%u},%d", call->unmarshall, skb->len, last);
245 switch (call->unmarshall) {
250 /* extract the returned data length */
252 _debug("extract data length");
253 ret = afs_extract_data(call, skb, last, &call->tmp, 4);
256 case -EAGAIN: return 0;
260 call->count = ntohl(call->tmp);
261 _debug("DATA length: %u", call->count);
262 if (call->count > PAGE_SIZE)
267 if (call->count < PAGE_SIZE) {
268 buffer = kmap_atomic(call->reply3, KM_USER0);
269 memset(buffer + PAGE_SIZE - call->count, 0,
271 kunmap_atomic(buffer, KM_USER0);
274 /* extract the returned data */
276 _debug("extract data");
278 buffer = kmap_atomic(page, KM_USER0);
279 ret = afs_extract_data(call, skb, last, buffer, call->count);
280 kunmap_atomic(buffer, KM_USER0);
283 case -EAGAIN: return 0;
290 /* extract the metadata */
292 ret = afs_extract_data(call, skb, last, call->buffer,
296 case -EAGAIN: return 0;
301 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode);
302 xdr_decode_AFSCallBack(&bp, vnode);
304 xdr_decode_AFSVolSync(&bp, call->reply2);
319 _leave(" = 0 [done]");
324 * FS.FetchData operation type
326 static const struct afs_call_type afs_RXFSFetchData = {
327 .name = "FS.FetchData",
328 .deliver = afs_deliver_fs_fetch_data,
329 .abort_to_error = afs_abort_to_error,
330 .destructor = afs_flat_call_destructor,
334 * fetch data from a file
336 int afs_fs_fetch_data(struct afs_server *server,
338 struct afs_vnode *vnode,
339 off_t offset, size_t length,
341 const struct afs_wait_mode *wait_mode)
343 struct afs_call *call;
348 call = afs_alloc_flat_call(&afs_RXFSFetchData, 24, (21 + 3 + 6) * 4);
354 call->reply2 = NULL; /* volsync */
355 call->reply3 = buffer;
356 call->service_id = FS_SERVICE;
357 call->port = htons(AFS_FS_PORT);
359 /* marshall the parameters */
361 bp[0] = htonl(FSFETCHDATA);
362 bp[1] = htonl(vnode->fid.vid);
363 bp[2] = htonl(vnode->fid.vnode);
364 bp[3] = htonl(vnode->fid.unique);
365 bp[4] = htonl(offset);
366 bp[5] = htonl(length);
368 return afs_make_call(&server->addr, call, GFP_NOFS, wait_mode);
372 * deliver reply data to an FS.GiveUpCallBacks
374 static int afs_deliver_fs_give_up_callbacks(struct afs_call *call,
375 struct sk_buff *skb, bool last)
377 _enter(",{%u},%d", skb->len, last);
380 return -EBADMSG; /* shouldn't be any reply data */
385 * FS.GiveUpCallBacks operation type
387 static const struct afs_call_type afs_RXFSGiveUpCallBacks = {
388 .name = "FS.GiveUpCallBacks",
389 .deliver = afs_deliver_fs_give_up_callbacks,
390 .abort_to_error = afs_abort_to_error,
391 .destructor = afs_flat_call_destructor,
395 * give up a set of callbacks
396 * - the callbacks are held in the server->cb_break ring
398 int afs_fs_give_up_callbacks(struct afs_server *server,
399 const struct afs_wait_mode *wait_mode)
401 struct afs_call *call;
406 ncallbacks = CIRC_CNT(server->cb_break_head, server->cb_break_tail,
407 ARRAY_SIZE(server->cb_break));
409 _enter("{%zu},", ncallbacks);
413 if (ncallbacks > AFSCBMAX)
414 ncallbacks = AFSCBMAX;
416 _debug("break %zu callbacks", ncallbacks);
418 call = afs_alloc_flat_call(&afs_RXFSGiveUpCallBacks,
419 12 + ncallbacks * 6 * 4, 0);
423 call->service_id = FS_SERVICE;
424 call->port = htons(AFS_FS_PORT);
426 /* marshall the parameters */
428 tp = bp + 2 + ncallbacks * 3;
429 *bp++ = htonl(FSGIVEUPCALLBACKS);
430 *bp++ = htonl(ncallbacks);
431 *tp++ = htonl(ncallbacks);
433 atomic_sub(ncallbacks, &server->cb_break_n);
434 for (loop = ncallbacks; loop > 0; loop--) {
435 struct afs_callback *cb =
436 &server->cb_break[server->cb_break_tail];
438 *bp++ = htonl(cb->fid.vid);
439 *bp++ = htonl(cb->fid.vnode);
440 *bp++ = htonl(cb->fid.unique);
441 *tp++ = htonl(cb->version);
442 *tp++ = htonl(cb->expiry);
443 *tp++ = htonl(cb->type);
445 server->cb_break_tail =
446 (server->cb_break_tail + 1) &
447 (ARRAY_SIZE(server->cb_break) - 1);
450 ASSERT(ncallbacks > 0);
451 wake_up_nr(&server->cb_break_waitq, ncallbacks);
453 return afs_make_call(&server->addr, call, GFP_NOFS, wait_mode);
457 * deliver reply data to an FS.CreateFile or an FS.MakeDir
459 static int afs_deliver_fs_create_vnode(struct afs_call *call,
460 struct sk_buff *skb, bool last)
462 struct afs_vnode *vnode = call->reply;
465 _enter("{%u},{%u},%d", call->unmarshall, skb->len, last);
467 afs_transfer_reply(call, skb);
471 if (call->reply_size != call->reply_max)
474 /* unmarshall the reply once we've received all of it */
476 xdr_decode_AFSFid(&bp, call->reply2);
477 xdr_decode_AFSFetchStatus(&bp, call->reply3, NULL);
478 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode);
479 xdr_decode_AFSCallBack_raw(&bp, call->reply4);
480 /* xdr_decode_AFSVolSync(&bp, call->replyX); */
482 _leave(" = 0 [done]");
487 * FS.CreateFile and FS.MakeDir operation type
489 static const struct afs_call_type afs_RXFSCreateXXXX = {
490 .name = "FS.CreateXXXX",
491 .deliver = afs_deliver_fs_create_vnode,
492 .abort_to_error = afs_abort_to_error,
493 .destructor = afs_flat_call_destructor,
497 * create a file or make a directory
499 int afs_fs_create(struct afs_server *server,
501 struct afs_vnode *vnode,
504 struct afs_fid *newfid,
505 struct afs_file_status *newstatus,
506 struct afs_callback *newcb,
507 const struct afs_wait_mode *wait_mode)
509 struct afs_call *call;
510 size_t namesz, reqsz, padsz;
515 namesz = strlen(name);
516 padsz = (4 - (namesz & 3)) & 3;
517 reqsz = (5 * 4) + namesz + padsz + (6 * 4);
519 call = afs_alloc_flat_call(&afs_RXFSCreateXXXX, reqsz,
520 (3 + 21 + 21 + 3 + 6) * 4);
526 call->reply2 = newfid;
527 call->reply3 = newstatus;
528 call->reply4 = newcb;
529 call->service_id = FS_SERVICE;
530 call->port = htons(AFS_FS_PORT);
532 /* marshall the parameters */
534 *bp++ = htonl(S_ISDIR(mode) ? FSMAKEDIR : FSCREATEFILE);
535 *bp++ = htonl(vnode->fid.vid);
536 *bp++ = htonl(vnode->fid.vnode);
537 *bp++ = htonl(vnode->fid.unique);
538 *bp++ = htonl(namesz);
539 memcpy(bp, name, namesz);
540 bp = (void *) bp + namesz;
542 memset(bp, 0, padsz);
543 bp = (void *) bp + padsz;
545 *bp++ = htonl(AFS_SET_MODE);
546 *bp++ = 0; /* mtime */
547 *bp++ = 0; /* owner */
548 *bp++ = 0; /* group */
549 *bp++ = htonl(mode & S_IALLUGO); /* unix mode */
550 *bp++ = 0; /* segment size */
552 return afs_make_call(&server->addr, call, GFP_NOFS, wait_mode);
556 * deliver reply data to an FS.RemoveFile or FS.RemoveDir
558 static int afs_deliver_fs_remove(struct afs_call *call,
559 struct sk_buff *skb, bool last)
561 struct afs_vnode *vnode = call->reply;
564 _enter("{%u},{%u},%d", call->unmarshall, skb->len, last);
566 afs_transfer_reply(call, skb);
570 if (call->reply_size != call->reply_max)
573 /* unmarshall the reply once we've received all of it */
575 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode);
576 /* xdr_decode_AFSVolSync(&bp, call->replyX); */
578 _leave(" = 0 [done]");
583 * FS.RemoveDir/FS.RemoveFile operation type
585 static const struct afs_call_type afs_RXFSRemoveXXXX = {
586 .name = "FS.RemoveXXXX",
587 .deliver = afs_deliver_fs_remove,
588 .abort_to_error = afs_abort_to_error,
589 .destructor = afs_flat_call_destructor,
593 * remove a file or directory
595 int afs_fs_remove(struct afs_server *server,
597 struct afs_vnode *vnode,
600 const struct afs_wait_mode *wait_mode)
602 struct afs_call *call;
603 size_t namesz, reqsz, padsz;
608 namesz = strlen(name);
609 padsz = (4 - (namesz & 3)) & 3;
610 reqsz = (5 * 4) + namesz + padsz;
612 call = afs_alloc_flat_call(&afs_RXFSRemoveXXXX, reqsz, (21 + 6) * 4);
618 call->service_id = FS_SERVICE;
619 call->port = htons(AFS_FS_PORT);
621 /* marshall the parameters */
623 *bp++ = htonl(isdir ? FSREMOVEDIR : FSREMOVEFILE);
624 *bp++ = htonl(vnode->fid.vid);
625 *bp++ = htonl(vnode->fid.vnode);
626 *bp++ = htonl(vnode->fid.unique);
627 *bp++ = htonl(namesz);
628 memcpy(bp, name, namesz);
629 bp = (void *) bp + namesz;
631 memset(bp, 0, padsz);
632 bp = (void *) bp + padsz;
635 return afs_make_call(&server->addr, call, GFP_NOFS, wait_mode);
639 * deliver reply data to an FS.Link
641 static int afs_deliver_fs_link(struct afs_call *call,
642 struct sk_buff *skb, bool last)
644 struct afs_vnode *dvnode = call->reply, *vnode = call->reply2;
647 _enter("{%u},{%u},%d", call->unmarshall, skb->len, last);
649 afs_transfer_reply(call, skb);
653 if (call->reply_size != call->reply_max)
656 /* unmarshall the reply once we've received all of it */
658 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode);
659 xdr_decode_AFSFetchStatus(&bp, &dvnode->status, dvnode);
660 /* xdr_decode_AFSVolSync(&bp, call->replyX); */
662 _leave(" = 0 [done]");
667 * FS.Link operation type
669 static const struct afs_call_type afs_RXFSLink = {
671 .deliver = afs_deliver_fs_link,
672 .abort_to_error = afs_abort_to_error,
673 .destructor = afs_flat_call_destructor,
679 int afs_fs_link(struct afs_server *server,
681 struct afs_vnode *dvnode,
682 struct afs_vnode *vnode,
684 const struct afs_wait_mode *wait_mode)
686 struct afs_call *call;
687 size_t namesz, reqsz, padsz;
692 namesz = strlen(name);
693 padsz = (4 - (namesz & 3)) & 3;
694 reqsz = (5 * 4) + namesz + padsz + (3 * 4);
696 call = afs_alloc_flat_call(&afs_RXFSLink, reqsz, (21 + 21 + 6) * 4);
701 call->reply = dvnode;
702 call->reply2 = vnode;
703 call->service_id = FS_SERVICE;
704 call->port = htons(AFS_FS_PORT);
706 /* marshall the parameters */
708 *bp++ = htonl(FSLINK);
709 *bp++ = htonl(dvnode->fid.vid);
710 *bp++ = htonl(dvnode->fid.vnode);
711 *bp++ = htonl(dvnode->fid.unique);
712 *bp++ = htonl(namesz);
713 memcpy(bp, name, namesz);
714 bp = (void *) bp + namesz;
716 memset(bp, 0, padsz);
717 bp = (void *) bp + padsz;
719 *bp++ = htonl(vnode->fid.vid);
720 *bp++ = htonl(vnode->fid.vnode);
721 *bp++ = htonl(vnode->fid.unique);
723 return afs_make_call(&server->addr, call, GFP_NOFS, wait_mode);
727 * deliver reply data to an FS.Symlink
729 static int afs_deliver_fs_symlink(struct afs_call *call,
730 struct sk_buff *skb, bool last)
732 struct afs_vnode *vnode = call->reply;
735 _enter("{%u},{%u},%d", call->unmarshall, skb->len, last);
737 afs_transfer_reply(call, skb);
741 if (call->reply_size != call->reply_max)
744 /* unmarshall the reply once we've received all of it */
746 xdr_decode_AFSFid(&bp, call->reply2);
747 xdr_decode_AFSFetchStatus(&bp, call->reply3, NULL);
748 xdr_decode_AFSFetchStatus(&bp, &vnode->status, vnode);
749 /* xdr_decode_AFSVolSync(&bp, call->replyX); */
751 _leave(" = 0 [done]");
756 * FS.Symlink operation type
758 static const struct afs_call_type afs_RXFSSymlink = {
759 .name = "FS.Symlink",
760 .deliver = afs_deliver_fs_symlink,
761 .abort_to_error = afs_abort_to_error,
762 .destructor = afs_flat_call_destructor,
766 * create a symbolic link
768 int afs_fs_symlink(struct afs_server *server,
770 struct afs_vnode *vnode,
772 const char *contents,
773 struct afs_fid *newfid,
774 struct afs_file_status *newstatus,
775 const struct afs_wait_mode *wait_mode)
777 struct afs_call *call;
778 size_t namesz, reqsz, padsz, c_namesz, c_padsz;
783 namesz = strlen(name);
784 padsz = (4 - (namesz & 3)) & 3;
786 c_namesz = strlen(contents);
787 c_padsz = (4 - (c_namesz & 3)) & 3;
789 reqsz = (6 * 4) + namesz + padsz + c_namesz + c_padsz + (6 * 4);
791 call = afs_alloc_flat_call(&afs_RXFSSymlink, reqsz,
792 (3 + 21 + 21 + 6) * 4);
798 call->reply2 = newfid;
799 call->reply3 = newstatus;
800 call->service_id = FS_SERVICE;
801 call->port = htons(AFS_FS_PORT);
803 /* marshall the parameters */
805 *bp++ = htonl(FSSYMLINK);
806 *bp++ = htonl(vnode->fid.vid);
807 *bp++ = htonl(vnode->fid.vnode);
808 *bp++ = htonl(vnode->fid.unique);
809 *bp++ = htonl(namesz);
810 memcpy(bp, name, namesz);
811 bp = (void *) bp + namesz;
813 memset(bp, 0, padsz);
814 bp = (void *) bp + padsz;
816 *bp++ = htonl(c_namesz);
817 memcpy(bp, contents, c_namesz);
818 bp = (void *) bp + c_namesz;
820 memset(bp, 0, c_padsz);
821 bp = (void *) bp + c_padsz;
823 *bp++ = htonl(AFS_SET_MODE);
824 *bp++ = 0; /* mtime */
825 *bp++ = 0; /* owner */
826 *bp++ = 0; /* group */
827 *bp++ = htonl(S_IRWXUGO); /* unix mode */
828 *bp++ = 0; /* segment size */
830 return afs_make_call(&server->addr, call, GFP_NOFS, wait_mode);
834 * deliver reply data to an FS.Rename
836 static int afs_deliver_fs_rename(struct afs_call *call,
837 struct sk_buff *skb, bool last)
839 struct afs_vnode *orig_dvnode = call->reply, *new_dvnode = call->reply2;
842 _enter("{%u},{%u},%d", call->unmarshall, skb->len, last);
844 afs_transfer_reply(call, skb);
848 if (call->reply_size != call->reply_max)
851 /* unmarshall the reply once we've received all of it */
853 xdr_decode_AFSFetchStatus(&bp, &orig_dvnode->status, orig_dvnode);
854 if (new_dvnode != orig_dvnode)
855 xdr_decode_AFSFetchStatus(&bp, &new_dvnode->status, new_dvnode);
856 /* xdr_decode_AFSVolSync(&bp, call->replyX); */
858 _leave(" = 0 [done]");
863 * FS.Rename operation type
865 static const struct afs_call_type afs_RXFSRename = {
867 .deliver = afs_deliver_fs_rename,
868 .abort_to_error = afs_abort_to_error,
869 .destructor = afs_flat_call_destructor,
873 * create a symbolic link
875 int afs_fs_rename(struct afs_server *server,
877 struct afs_vnode *orig_dvnode,
878 const char *orig_name,
879 struct afs_vnode *new_dvnode,
880 const char *new_name,
881 const struct afs_wait_mode *wait_mode)
883 struct afs_call *call;
884 size_t reqsz, o_namesz, o_padsz, n_namesz, n_padsz;
889 o_namesz = strlen(orig_name);
890 o_padsz = (4 - (o_namesz & 3)) & 3;
892 n_namesz = strlen(new_name);
893 n_padsz = (4 - (n_namesz & 3)) & 3;
896 4 + o_namesz + o_padsz +
898 4 + n_namesz + n_padsz;
900 call = afs_alloc_flat_call(&afs_RXFSRename, reqsz, (21 + 21 + 6) * 4);
905 call->reply = orig_dvnode;
906 call->reply2 = new_dvnode;
907 call->service_id = FS_SERVICE;
908 call->port = htons(AFS_FS_PORT);
910 /* marshall the parameters */
912 *bp++ = htonl(FSRENAME);
913 *bp++ = htonl(orig_dvnode->fid.vid);
914 *bp++ = htonl(orig_dvnode->fid.vnode);
915 *bp++ = htonl(orig_dvnode->fid.unique);
916 *bp++ = htonl(o_namesz);
917 memcpy(bp, orig_name, o_namesz);
918 bp = (void *) bp + o_namesz;
920 memset(bp, 0, o_padsz);
921 bp = (void *) bp + o_padsz;
924 *bp++ = htonl(new_dvnode->fid.vid);
925 *bp++ = htonl(new_dvnode->fid.vnode);
926 *bp++ = htonl(new_dvnode->fid.unique);
927 *bp++ = htonl(n_namesz);
928 memcpy(bp, new_name, n_namesz);
929 bp = (void *) bp + n_namesz;
931 memset(bp, 0, n_padsz);
932 bp = (void *) bp + n_padsz;
935 return afs_make_call(&server->addr, call, GFP_NOFS, wait_mode);