-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmvfs_copy.c
1367 lines (1271 loc) · 34.1 KB
/
mvfs_copy.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* * (C) Copyright IBM Corporation 1998, 2010. */
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Author: IBM Corporation
This module is part of the IBM (R) Rational (R) ClearCase (R)
Multi-version file system (MVFS).
For support, please visit http://www.ibm.com/software/support
*/
/* mvfs_copy.c */
#include "mvfs_systm.h"
#include <tbs_base.h>
#include <tbs_errno.h>
#include "mvfs.h"
#include "mvfs_dnc.h"
#include "mvfs_copy.h"
#include "mvfs_transtype.h"
int
CopyInMfs_strbufpn(
caddr_t uargp,
struct mfs_strbufpn *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mfs_strbufpn_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mfs_strbufpn_32));
if (!res)
mfs_strbufpn_32_to_mfs_strbufpn(&vbl_32, kargp);
return res;
}
#endif
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mfs_strbufpn)));
}
int
CopyOutMfs_strbufpn(
struct mfs_strbufpn *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mfs_strbufpn_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mfs_strbufpn_to_mfs_strbufpn_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mfs_strbufpn_32)));
}
#endif
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mfs_strbufpn)));
}
int
CopyInMfs_strbufpn_index(
caddr_t uargp,
struct mfs_strbufpn *kargp,
int index,
MVFS_CALLER_INFO *callinfo
)
{
caddr_t data_ptr;
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mfs_strbufpn_32 vbl_32;
data_ptr = (caddr_t) (uargp + ((sizeof(struct mfs_strbufpn_32)) * index));
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(data_ptr, (caddr_t)&vbl_32, sizeof(struct mfs_strbufpn_32));
if (!res)
mfs_strbufpn_32_to_mfs_strbufpn(&vbl_32, kargp);
return res;
}
#endif
data_ptr = (caddr_t) (uargp + ((sizeof(struct mfs_strbufpn)) * index));
return(COPYIN(data_ptr, (caddr_t)kargp, sizeof(struct mfs_strbufpn)));
}
int
CopyOutMfs_strbufpn_index(
struct mfs_strbufpn *kargp,
caddr_t uargp,
int index,
MVFS_CALLER_INFO *callinfo
)
{
caddr_t data_ptr;
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mfs_strbufpn_32 vbl_32;
data_ptr = (caddr_t) (uargp + ((sizeof(struct mfs_strbufpn_32)) * index));
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mfs_strbufpn_to_mfs_strbufpn_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, data_ptr, sizeof(struct mfs_strbufpn_32)));
}
#endif
data_ptr = (caddr_t) (uargp + ((sizeof(struct mfs_strbufpn)) * index));
return (COPYOUT((caddr_t)kargp, data_ptr, sizeof(struct mfs_strbufpn)));
}
int
CopyInMfs_strbufpn_pair(
caddr_t uargp,
struct mfs_strbufpn_pair *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mfs_strbufpn_pair_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mfs_strbufpn_pair_32));
if (!res)
mfs_strbufpn_pair_32_to_mfs_strbufpn_pair(&vbl_32, kargp);
return res;
}
#endif
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mfs_strbufpn_pair)));
}
int
CopyOutMfs_strbufpn_pair(
struct mfs_strbufpn_pair *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mfs_strbufpn_pair_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mfs_strbufpn_pair_to_mfs_strbufpn_pair_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mfs_strbufpn_pair_32)));
}
#endif
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mfs_strbufpn_pair)));
}
int
CopyInMfs_strbuf(
caddr_t uargp,
struct mfs_strbuf *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mfs_strbuf_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mfs_strbuf_32));
if (!res)
mfs_strbuf_32_to_mfs_strbuf(&vbl_32, kargp);
return res;
}
#endif
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mfs_strbuf)));
}
int
CopyOutMfs_strbuf(
struct mfs_strbuf *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mfs_strbuf_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mfs_strbuf_to_mfs_strbuf_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mfs_strbuf_32)));
}
#endif
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mfs_strbuf)));
}
int
CopyInMfs_mntargs(
caddr_t uargp,
struct mfs_mntargs *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mfs_mntargs_32_to_mfs_mntargs((struct mfs_mntargs_32 *)uargp,
kargp);
return(0);
}
#endif /* LP64 */
BCOPY(uargp, (caddr_t)kargp, sizeof(struct mfs_mntargs));
return(0);
}
int
CopyInMvfscmd_block(
caddr_t uargp,
struct mvfscmd_block *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfscmd_block_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfscmd_block_32));
if (!res)
mvfscmd_block_32_to_mvfscmd_block(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfscmd_block)));
}
int
CopyOutMvfscmd_block(
struct mvfscmd_block *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mvfscmd_block_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mvfscmd_block_to_mvfscmd_block_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mvfscmd_block_32)));
}
#endif /* ATRIA_LP64 */
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfscmd_block)));
}
int
CopyOutMvfscmd_block_status(
struct mvfscmd_block *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
if (MDKI_CALLER_IS_32BIT(callinfo)) {
struct mvfscmd_block_32 *vbl_32;
/*
* Note: the status fields are the same size so we can
* just do a CopyOut.
*/
vbl_32 = (struct mvfscmd_block_32 *) uargp;
return (COPYOUT((caddr_t)&kargp->status, (caddr_t) &vbl_32->status,
sizeof(vbl_32->status)));
}
#endif /* ATRIA_LP64 */
{
struct mvfscmd_block *data = (struct mvfscmd_block *) uargp;
return(COPYOUT((caddr_t)&kargp->status, (caddr_t)&data->status,
sizeof(kargp->status)));
}
}
int
CopyInMvfs_loginfo(
caddr_t uargp,
struct mvfs_loginfo *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_loginfo_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_loginfo_32));
if (!res)
mvfs_loginfo_32_to_mvfs_loginfo(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_loginfo)));
}
int
CopyOutMvfs_loginfo(
struct mvfs_loginfo *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mvfs_loginfo_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mvfs_loginfo_to_mvfs_loginfo_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mvfs_loginfo_32)));
}
#endif /* ATRIA_LP64 */
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfs_loginfo)));
}
int
CopyInMvfs_viewtag_info(
caddr_t uargp,
struct mvfs_viewtag_info *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_viewtag_info_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_viewtag_info_32));
if (!res)
mvfs_viewtag_info_32_to_mvfs_viewtag_info(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_viewtag_info)));
}
int
CopyInMvfs_mkviewtag_info(
caddr_t uargp,
struct mvfs_mkviewtag_info *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_mkviewtag_info_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_mkviewtag_info_32));
if (!res)
mvfs_mkviewtag_info_32_to_mvfs_mkviewtag_info(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_mkviewtag_info)));
}
int
CopyInMvfs_viewinfo(
caddr_t uargp,
struct mvfs_viewinfo *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_viewinfo_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_viewinfo_32));
if (!res)
mvfs_viewinfo_32_to_mvfs_viewinfo(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_viewinfo)));
}
int
CopyOutMvfs_viewinfo(
struct mvfs_viewinfo *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mvfs_viewinfo_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mvfs_viewinfo_to_mvfs_viewinfo_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mvfs_viewinfo_32)));
}
#endif /* ATRIA_LP64 */
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfs_viewinfo)));
}
int
CopyInMvfs_vobinfo(
caddr_t uargp,
struct mvfs_vobinfo *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_vobinfo_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_vobinfo_32));
if (!res)
mvfs_vobinfo_32_to_mvfs_vobinfo(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_vobinfo)));
}
int
CopyOutMvfs_vobinfo(
struct mvfs_vobinfo *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mvfs_vobinfo_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mvfs_vobinfo_to_mvfs_vobinfo_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mvfs_vobinfo_32)));
}
#endif /* ATRIA_LP64 */
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfs_vobinfo)));
}
int
CopyInMvfs_ioget_poolmaps(
caddr_t uargp,
struct mvfs_ioget_poolmaps *kargp,
MVFS_CALLER_INFO *callinfo
)
{
int res;
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mvfs_ioget_poolmaps_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_ioget_poolmaps_32));
if (!res)
mvfs_ioget_poolmaps_32_to_mvfs_ioget_poolmaps(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_ioget_poolmaps)));
}
int
CopyOutMvfs_ioget_poolmaps(
struct mvfs_ioget_poolmaps *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
int res;
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mvfs_ioget_poolmaps_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mvfs_ioget_poolmaps_to_mvfs_ioget_poolmaps_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mvfs_ioget_poolmaps_32)));
}
#endif /* ATRIA_LP64 */
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfs_ioget_poolmaps)));
}
int
CopyInMvfs_iovfh(
caddr_t uargp,
struct mvfs_iovfh *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_iovfh_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_iovfh_32));
if (!res)
mvfs_iovfh_32_to_mvfs_iovfh(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_iovfh)));
}
int
CopyOutMvfs_iovfh(
struct mvfs_iovfh *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mvfs_iovfh_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mvfs_iovfh_to_mvfs_iovfh_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mvfs_iovfh_32)));
}
#endif /* ATRIA_LP64 */
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfs_iovfh)));
}
int
BcopyInMvfscmd_block(
caddr_t kdatap,
struct mvfscmd_block *kargp,
MVFS_CALLER_INFO *callinfo
)
{
int res = 0;
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mvfscmd_block_32_to_mvfscmd_block((struct mvfscmd_block_32 *)kdatap,
kargp);
return res;
}
#endif /* ATRIA_LP64 */
BCOPY(kdatap, (caddr_t) kargp, sizeof(struct mvfscmd_block));
return (res);
}
int
BcopyOutMvfscmd_block(
struct mvfscmd_block *kdatap,
caddr_t kargp,
MVFS_CALLER_INFO *callinfo
)
{
int res = 0;
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mvfscmd_block_32 *vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mvfscmd_block_to_mvfscmd_block_32(kdatap,
(struct mvfscmd_block_32 *)kargp);
return res;
}
#endif /* ATRIA_LP64 */
BCOPY((caddr_t)kdatap, kargp, sizeof(struct mvfscmd_block));
return res;
}
int
BcopyOutMvfscmd_block_status(
struct mvfscmd_block *kdatap,
caddr_t kargp,
MVFS_CALLER_INFO *callinfo
)
{
int res = 0;
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
if (MDKI_CALLER_IS_32BIT(callinfo)) {
((struct mvfscmd_block_32 *)kargp)->status = kdatap->status;
return res;
}
#endif /* ATRIA_LP64 */
{
struct mvfscmd_block *data = (struct mvfscmd_block *) kargp;
BCOPY((caddr_t)&kdatap->status, (caddr_t)&data->status,
sizeof(kdatap->status));
}
return res;
}
int
CopyInMvfs_splitpool(
caddr_t uargp,
struct mvfs_splitpool *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_splitpool_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_splitpool_32));
if (!res)
mvfs_splitpool_32_to_mvfs_splitpool(&vbl_32, kargp);
return res;
}
#endif
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfs_splitpool)));
}
int
CopyInMvfs_splitpool_index(
caddr_t uargp,
struct mvfs_splitpool *kargp,
int index,
MVFS_CALLER_INFO *callinfo
)
{
caddr_t splitdata;
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_splitpool_32 vbl_32;
splitdata = (caddr_t) (uargp + ((sizeof(struct mvfs_splitpool_32)) * index));
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(splitdata, (caddr_t)&vbl_32, sizeof(struct mvfs_splitpool_32));
if (!res)
mvfs_splitpool_32_to_mvfs_splitpool(&vbl_32, kargp);
return res;
}
#endif
splitdata = uargp + ((sizeof(struct mvfs_splitpool)) * index);
return(COPYIN(splitdata, (caddr_t)kargp, sizeof(struct mvfs_splitpool)));
}
int
CopyOutView_vstat(
struct view_vstat *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct view_vstat_32 *vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
/*
* structure is large so let's malloc space
*/
if ((vbl_32 = KMEM_ALLOC(sizeof(struct view_vstat_32), KM_SLEEP))
== NULL)
{
return(ENOMEM);
}
view_vstat_to_view_vstat_32(kargp, vbl_32);
res = (COPYOUT((caddr_t)vbl_32, uargp, sizeof(struct view_vstat_32)));
KMEM_FREE(vbl_32, sizeof(struct view_vstat_32));
return res;
}
#endif /* ATRIA_LP64 */
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct view_vstat)));
}
int
CopyInMvfs_xstat(
caddr_t uargp,
struct mvfs_xstat *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_xstat_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_xstat_32));
if (!res)
mvfs_xstat_32_to_mvfs_xstat(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_xstat)));
}
int
CopyOutMvfs_xstat(
struct mvfs_xstat *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mvfs_xstat_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mvfs_xstat_to_mvfs_xstat_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mvfs_xstat_32)));
}
#endif /* ATRIA_LP64 */
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfs_xstat)));
}
int
CopyInMvfs_ioinval(
caddr_t uargp,
struct mvfs_ioinval *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_ioinval_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_ioinval_32));
if (!res)
mvfs_ioinval_32_to_mvfs_ioinval(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_ioinval)));
}
int
CopyInMvfs_clrname_info(
caddr_t uargp,
struct mvfs_clrname_info *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_clrname_info_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_clrname_info_32));
if (!res)
mvfs_clrname_info_32_to_mvfs_clrname_info(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_clrname_info)));
}
int
CopyOutMvfs_clrname_info(
struct mvfs_clrname_info *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mvfs_clrname_info_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mvfs_clrname_info_to_mvfs_clrname_info_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mvfs_clrname_info_32)));
}
#endif /* ATRIA_LP64 */
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfs_clrname_info)));
}
int
CopyInMvfs_viewaddr(
caddr_t uargp,
struct mvfs_viewaddr *kargp,
MVFS_CALLER_INFO *callinfo
)
{
/* A struct mvfs_viewaddr is currently a ks_sockaddr_storage_t (a union
** type), each of whose constituents is the same length on all
** platforms in both 32-bit and 64-bit environments. Thus, we don't
** need to do anything special for it.
*/
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_viewaddr)));
}
int
CopyOutMvfs_viewaddr(
struct mvfs_viewaddr *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
/* See the comment above. */
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfs_viewaddr)));
}
int
CopyInMvfs_iochange_mtype(
caddr_t uargp,
struct mvfs_iochange_mtype *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_iochange_mtype_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_iochange_mtype_32));
if (!res)
mvfs_iochange_mtype_32_to_mvfs_iochange_mtype(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_iochange_mtype)));
}
int
CopyInMfs_ioncent(
caddr_t uargp,
struct mfs_ioncent *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mfs_ioncent_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mfs_ioncent_32));
if (!res)
mfs_ioncent_32_to_mfs_ioncent(&vbl_32, kargp);
return res;
} else {
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mfs_ioncent)));
}
#else
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mfs_ioncent)));
#endif /* ATRIA_LP64 */
}
int
CopyOutMfs_ioncent(
struct mfs_ioncent *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mfs_ioncent_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mfs_ioncent_to_mfs_ioncent_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mfs_ioncent_32)));
} else {
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mfs_ioncent)));
}
#else
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mfs_ioncent)));
#endif /* ATRIA_LP64 */
}
int
CopyInMvfs_bhinfo(
caddr_t uargp,
struct mvfs_bhinfo *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_bhinfo_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_bhinfo_32));
if (!res)
mvfs_bhinfo_32_to_mvfs_bhinfo(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_bhinfo)));
}
int
CopyOutMvfs_bhinfo(
struct mvfs_bhinfo *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mvfs_bhinfo_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mvfs_bhinfo_to_mvfs_bhinfo_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mvfs_bhinfo_32)));
}
#endif /* ATRIA_LP64 */
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfs_bhinfo)));
}
int
CopyInMvfs_statbufs(
caddr_t uargp,
struct mvfs_statbufs *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_statbufs_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_statbufs_32));
if (!res)
mvfs_statbufs_32_to_mvfs_statbufs(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_statbufs)));
}
int
CopyInMvfs_io_xattr(
caddr_t uargp,
struct mvfs_io_xattr *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_io_xattr_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_io_xattr_32));
if (!res)
mvfs_io_xattr_32_to_mvfs_io_xattr(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_io_xattr)));
}
int
CopyOutMvfs_io_xattr(
struct mvfs_io_xattr *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mvfs_io_xattr_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mvfs_io_xattr_to_mvfs_io_xattr_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mvfs_io_xattr_32)));
}
#endif /* ATRIA_LP64 */
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfs_io_xattr)));
}
int
CopyInMvfs_export_viewinfo(
caddr_t uargp,
struct mvfs_export_viewinfo *kargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
int res;
struct mvfs_export_viewinfo_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
res = COPYIN(uargp, (caddr_t)&vbl_32, sizeof(struct mvfs_export_viewinfo_32));
if (!res)
mvfs_export_viewinfo_32_to_mvfs_export_viewinfo(&vbl_32, kargp);
return res;
}
#endif /* ATRIA_LP64 */
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_export_viewinfo)));
}
int
CopyOutMvfs_export_viewinfo(
struct mvfs_export_viewinfo *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
#if defined(ATRIA_LP64) || defined(ATRIA_LLP64)
struct mvfs_export_viewinfo_32 vbl_32;
if (MDKI_CALLER_IS_32BIT(callinfo)) {
mvfs_export_viewinfo_to_mvfs_export_viewinfo_32(kargp, &vbl_32);
return (COPYOUT((caddr_t)&vbl_32, uargp, sizeof(struct mvfs_export_viewinfo_32)));
}
#endif /* ATRIA_LP64 */
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfs_export_viewinfo)));
}
int
CopyInMvfs_cache_sizes(
caddr_t uargp,
struct mvfs_cache_sizes *kargp,
MVFS_CALLER_INFO *callinfo
)
{
return(COPYIN(uargp, (caddr_t)kargp, sizeof(struct mvfs_cache_sizes)));
}
int
CopyOutMvfs_cache_sizes(
struct mvfs_cache_sizes *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
return(COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfs_cache_sizes)));
}
int
CopyOutMvfs_cache_usage(
struct mvfs_cache_usage *kargp,
caddr_t uargp,
MVFS_CALLER_INFO *callinfo
)
{
/*
* Needs no translation for 64 bit support
*/
return (COPYOUT((caddr_t)kargp, uargp, sizeof(struct mvfs_cache_usage)));
}
int
CopyInTbs_uuid_s(
caddr_t uargp,
struct tbs_uuid_s *kargp,
MVFS_CALLER_INFO *callinfo
)
{