summaryrefslogtreecommitdiffstats
path: root/doc/legacy/hacker-guide/call-stub.txt
blob: 021037a3512c289ec36a22f1ef0ef698f0e65f58 (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
creating a call stub and pausing a call
---------------------------------------
libglusterfs provides seperate API to pause each of the fop. parameters to each API is
@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
       NOTE: @fn should exactly take the same type and number of parameters that
             the corresponding regular fop takes.
rest will be the regular parameters to corresponding fop.

NOTE: @frame can never be NULL. fop_<operation>_stub() fails with errno
      set to EINVAL, if @frame is NULL. also wherever @loc is applicable,
      @loc cannot be NULL.

refer to individual stub creation API to know about call-stub creation's behaviour with
specific parameters.

here is the list of stub creation APIs for xlator fops.

@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@loc       - pointer to location structure.
             NOTE: @loc will be copied to a different location, with inode_ref() to
	           @loc->inode and @loc->parent, if not NULL. also @loc->path will be
		   copied to a different location.
@need_xattr - flag to specify if xattr should be returned or not.
call_stub_t *
fop_lookup_stub (call_frame_t *frame,
		 fop_lookup_t fn,
		 loc_t *loc,
		 int32_t need_xattr);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
call_stub_t *
fop_stat_stub (call_frame_t *frame,
	       fop_stat_t fn,
	       loc_t *loc);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@fd    - file descriptor parameter to lk fop.
         NOTE: @fd is stored with a fd_ref().
call_stub_t *
fop_fstat_stub (call_frame_t *frame,
		fop_fstat_t fn,
		fd_t *fd);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to @loc->inode and
	       @loc->parent, if not NULL. also @loc->path will be copied to a different location.
@mode  - mode parameter to chmod.
call_stub_t *
fop_chmod_stub (call_frame_t *frame,
		fop_chmod_t fn,
		loc_t *loc,
		mode_t mode);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@fd    - file descriptor parameter to lk fop.
         NOTE: @fd is stored with a fd_ref().
@mode  - mode parameter for fchmod fop.
call_stub_t *
fop_fchmod_stub (call_frame_t *frame,
		 fop_fchmod_t fn,
		 fd_t *fd,
		 mode_t mode);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to @loc->inode and
	       @loc->parent, if not NULL. also @loc->path will be copied to a different location.
@uid   - uid parameter to chown.
@gid   - gid parameter to chown.
call_stub_t *
fop_chown_stub (call_frame_t *frame,
		fop_chown_t fn,
		loc_t *loc,
		uid_t uid,
		gid_t gid);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@fd    - file descriptor parameter to lk fop.
         NOTE: @fd is stored with a fd_ref().
@uid   - uid parameter to fchown.
@gid   - gid parameter to fchown.
call_stub_t *
fop_fchown_stub (call_frame_t *frame,
		 fop_fchown_t fn,
		 fd_t *fd,
		 uid_t uid,
		 gid_t gid);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location, if not NULL.
@off   - offset parameter to truncate fop.
call_stub_t *
fop_truncate_stub (call_frame_t *frame,
		   fop_truncate_t fn,
		   loc_t *loc,
		   off_t off);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@fd    - file descriptor parameter to lk fop.
         NOTE: @fd is stored with a fd_ref().
@off   - offset parameter to ftruncate fop.
call_stub_t *
fop_ftruncate_stub (call_frame_t *frame,
		    fop_ftruncate_t fn,
		    fd_t *fd,
		    off_t off);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
@tv    - tv parameter to utimens fop.
call_stub_t *
fop_utimens_stub (call_frame_t *frame,
		  fop_utimens_t fn,
		  loc_t *loc,
		  struct timespec tv[2]);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
@mask  - mask parameter for access fop.
call_stub_t *
fop_access_stub (call_frame_t *frame,
		 fop_access_t fn,
		 loc_t *loc,
		 int32_t mask);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
@size  - size parameter to readlink fop.
call_stub_t *
fop_readlink_stub (call_frame_t *frame,
		   fop_readlink_t fn,
		   loc_t *loc,
		   size_t size);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
@mode  - mode parameter to mknod fop.
@rdev  - rdev parameter to mknod fop.
call_stub_t *
fop_mknod_stub (call_frame_t *frame,
		fop_mknod_t fn,
		loc_t *loc,
		mode_t mode,
		dev_t rdev);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
@mode  - mode parameter to mkdir fop.
call_stub_t *
fop_mkdir_stub (call_frame_t *frame,
		fop_mkdir_t fn,
		loc_t *loc,
		mode_t mode);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
call_stub_t *
fop_unlink_stub (call_frame_t *frame,
		 fop_unlink_t fn,
		 loc_t *loc);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
call_stub_t *
fop_rmdir_stub (call_frame_t *frame,
		fop_rmdir_t fn,
		loc_t *loc);

@frame    - call frame which has to be used to resume the call at call_resume().
@fn       - procedure to call during call_resume().
@linkname - linkname parameter to symlink fop.
@loc      - pointer to location structure.
            NOTE: @loc will be copied to a different location, with inode_ref() to
	          @loc->inode and @loc->parent, if not NULL. also @loc->path will be
		  copied to a different location.
call_stub_t *
fop_symlink_stub (call_frame_t *frame,
		  fop_symlink_t fn,
		  const char *linkname,
		  loc_t *loc);

@frame    - call frame which has to be used to resume the call at call_resume().
@fn       - procedure to call during call_resume().
@oldloc   - pointer to location structure.
            NOTE: @oldloc will be copied to a different location, with inode_ref() to
	          @oldloc->inode and @oldloc->parent, if not NULL. also @oldloc->path will
		  be copied to a different location, if not NULL.
@newloc   - pointer to location structure.
            NOTE: @newloc will be copied to a different location, with inode_ref() to
	          @newloc->inode and @newloc->parent, if not NULL. also @newloc->path will
		  be copied to a different location, if not NULL.
call_stub_t *
fop_rename_stub (call_frame_t *frame,
		 fop_rename_t fn,
		 loc_t *oldloc,
		 loc_t *newloc);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc     - pointer to location structure.
           NOTE: @loc will be copied to a different location, with inode_ref() to
	         @loc->inode and @loc->parent, if not NULL. also @loc->path will be
		 copied to a different location.
@newpath - newpath parameter to link fop.
call_stub_t *
fop_link_stub (call_frame_t *frame,
	       fop_link_t fn,
	       loc_t *oldloc,
	       const char *newpath);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
@flags - flags parameter to create fop.
@mode  - mode parameter to create fop.
@fd    - file descriptor parameter to create fop.
         NOTE: @fd is stored with a fd_ref().
call_stub_t *
fop_create_stub (call_frame_t *frame,
		 fop_create_t fn,
		 loc_t *loc,
		 int32_t flags,
		 mode_t mode, fd_t *fd);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@flags - flags parameter to open fop.
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
call_stub_t *
fop_open_stub (call_frame_t *frame,
	       fop_open_t fn,
	       loc_t *loc,
	       int32_t flags,
	       fd_t *fd);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@fd    - file descriptor parameter to lk fop.
         NOTE: @fd is stored with a fd_ref().
@size  - size parameter to readv fop.
@off   - offset parameter to readv fop.
call_stub_t *
fop_readv_stub (call_frame_t *frame,
		fop_readv_t fn,
		fd_t *fd,
		size_t size,
		off_t off);

@frame  - call frame which has to be used to resume the call at call_resume().
@fn     - procedure to call during call_resume().
@fd     - file descriptor parameter to lk fop.
          NOTE: @fd is stored with a fd_ref().
@vector - vector parameter to writev fop.
	  NOTE: @vector is iov_dup()ed while creating stub. and frame->root->req_refs
                dictionary is dict_ref()ed.
@count  - count parameter to writev fop.
@off    - off parameter to writev fop.
call_stub_t *
fop_writev_stub (call_frame_t *frame,
		 fop_writev_t fn,
		 fd_t *fd,
		 struct iovec *vector,
		 int32_t count,
		 off_t off);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@fd    - file descriptor parameter to flush fop.
         NOTE: @fd is stored with a fd_ref().
call_stub_t *
fop_flush_stub (call_frame_t *frame,
		fop_flush_t fn,
		fd_t *fd);


@frame    - call frame which has to be used to resume the call at call_resume().
@fn       - procedure to call during call_resume().
@fd       - file descriptor parameter to lk fop.
            NOTE: @fd is stored with a fd_ref().
@datasync - datasync parameter to fsync fop.
call_stub_t *
fop_fsync_stub (call_frame_t *frame,
		fop_fsync_t fn,
		fd_t *fd,
		int32_t datasync);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to @loc->inode and
	       @loc->parent, if not NULL. also @loc->path will be copied to a different location.
@fd    - file descriptor parameter to opendir fop.
         NOTE: @fd is stored with a fd_ref().
call_stub_t *
fop_opendir_stub (call_frame_t *frame,
		  fop_opendir_t fn,
		  loc_t *loc,
		  fd_t *fd);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@fd    - file descriptor parameter to getdents fop.
         NOTE: @fd is stored with a fd_ref().
@size  - size parameter to getdents fop.
@off   - off parameter to getdents fop.
@flags - flags parameter to getdents fop.
call_stub_t *
fop_getdents_stub (call_frame_t *frame,
		   fop_getdents_t fn,
		   fd_t *fd,
		   size_t size,
		   off_t off,
		   int32_t flag);

@frame   - call frame which has to be used to resume the call at call_resume().
@fn      - procedure to call during call_resume().
@fd      - file descriptor parameter to setdents fop.
           NOTE: @fd is stored with a fd_ref().
@flags   - flags parameter to setdents fop.
@entries - entries parameter to setdents fop.
call_stub_t *
fop_setdents_stub (call_frame_t *frame,
		   fop_setdents_t fn,
		   fd_t *fd,
		   int32_t flags,
		   dir_entry_t *entries,
		   int32_t count);

@frame    - call frame which has to be used to resume the call at call_resume().
@fn       - procedure to call during call_resume().
@fd       - file descriptor parameter to setdents fop.
            NOTE: @fd is stored with a fd_ref().
@datasync - datasync parameter to fsyncdir fop.
call_stub_t *
fop_fsyncdir_stub (call_frame_t *frame,
		   fop_fsyncdir_t fn,
		   fd_t *fd,
		   int32_t datasync);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
call_stub_t *
fop_statfs_stub (call_frame_t *frame,
		 fop_statfs_t fn,
		 loc_t *loc);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
@dict  - dict parameter to setxattr fop.
         NOTE: stub creation procedure stores @dict pointer with dict_ref() to it.
call_stub_t *
fop_setxattr_stub (call_frame_t *frame,
		   fop_setxattr_t fn,
		   loc_t *loc,
		   dict_t *dict,
		   int32_t flags);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
@name  - name parameter to getxattr fop.
call_stub_t *
fop_getxattr_stub (call_frame_t *frame,
		   fop_getxattr_t fn,
		   loc_t *loc,
		   const char *name);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
@name  - name parameter to removexattr fop.
         NOTE: name string will be copied to a different location while creating stub.
call_stub_t *
fop_removexattr_stub (call_frame_t *frame,
		      fop_removexattr_t fn,
		      loc_t *loc,
		      const char *name);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@fd    - file descriptor parameter to lk fop.
         NOTE: @fd is stored with a fd_ref().
@cmd   - command parameter to lk fop.
@lock  - lock parameter to lk fop.
         NOTE: lock will be copied to a different location while creating stub.
call_stub_t *
fop_lk_stub (call_frame_t *frame,
	     fop_lk_t fn,
	     fd_t *fd,
	     int32_t cmd,
	     struct flock *lock);

@frame    - call frame which has to be used to resume the call at call_resume().
@fn       - procedure to call during call_resume().
@fd       - fd parameter to gf_lk fop.
	    NOTE: @fd is fd_ref()ed while creating stub, if not NULL.
@cmd      - cmd parameter to gf_lk fop.
@lock     - lock paramater to gf_lk fop.
	    NOTE: @lock is copied to a different memory location while creating
	          stub.
call_stub_t *
fop_gf_lk_stub (call_frame_t *frame,
		fop_gf_lk_t fn,
		fd_t *fd,
		int32_t cmd,
		struct flock *lock);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@fd    - file descriptor parameter to readdir fop.
         NOTE: @fd is stored with a fd_ref().
@size  - size parameter to readdir fop.
@off   - offset parameter to readdir fop.
call_stub_t *
fop_readdir_stub (call_frame_t *frame,
		  fop_readdir_t fn,
		  fd_t *fd,
		  size_t size,
		  off_t off);

@frame - call frame which has to be used to resume the call at call_resume().
@fn    - procedure to call during call_resume().
@loc   - pointer to location structure.
         NOTE: @loc will be copied to a different location, with inode_ref() to
	       @loc->inode and @loc->parent, if not NULL. also @loc->path will be
	       copied to a different location.
@flags - flags parameter to checksum fop.
call_stub_t *
fop_checksum_stub (call_frame_t *frame,
		   fop_checksum_t fn,
		   loc_t *loc,
		   int32_t flags);

@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@inode     - inode parameter to @fn.
	     NOTE: @inode pointer is stored with a inode_ref().
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
@dict      - dict parameter to @fn.
	     NOTE: @dict pointer is stored with dict_ref().
call_stub_t *
fop_lookup_cbk_stub (call_frame_t *frame,
		     fop_lookup_cbk_t fn,
		     int32_t op_ret,
		     int32_t op_errno,
		     inode_t *inode,
		     struct stat *buf,
		     dict_t *dict);
@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_stat_cbk_stub (call_frame_t *frame,
		   fop_stat_cbk_t fn,
		   int32_t op_ret,
		   int32_t op_errno,
		   struct stat *buf);

@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_fstat_cbk_stub (call_frame_t *frame,
		    fop_fstat_cbk_t fn,
		    int32_t op_ret,
		    int32_t op_errno,
		    struct stat *buf);

@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_chmod_cbk_stub (call_frame_t *frame,
		    fop_chmod_cbk_t fn,
		    int32_t op_ret,
		    int32_t op_errno,
		    struct stat *buf);

@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_fchmod_cbk_stub (call_frame_t *frame,
		     fop_fchmod_cbk_t fn,
		     int32_t op_ret,
		     int32_t op_errno,
		     struct stat *buf);

@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_chown_cbk_stub (call_frame_t *frame,
		    fop_chown_cbk_t fn,
		    int32_t op_ret,
		    int32_t op_errno,
		    struct stat *buf);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_fchown_cbk_stub (call_frame_t *frame,
		     fop_fchown_cbk_t fn,
		     int32_t op_ret,
		     int32_t op_errno,
		     struct stat *buf);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_truncate_cbk_stub (call_frame_t *frame,
		       fop_truncate_cbk_t fn,
		       int32_t op_ret,
		       int32_t op_errno,
		       struct stat *buf);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_ftruncate_cbk_stub (call_frame_t *frame,
			fop_ftruncate_cbk_t fn,
			int32_t op_ret,
			int32_t op_errno,
			struct stat *buf);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_utimens_cbk_stub (call_frame_t *frame,
		      fop_utimens_cbk_t fn,
		      int32_t op_ret,
		      int32_t op_errno,
		      struct stat *buf);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
call_stub_t *
fop_access_cbk_stub (call_frame_t *frame,
		     fop_access_cbk_t fn,
		     int32_t op_ret,
		     int32_t op_errno);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@path      - path parameter to @fn.
	     NOTE: @path is copied to a different memory location, if not NULL.
call_stub_t *
fop_readlink_cbk_stub (call_frame_t *frame,
		       fop_readlink_cbk_t fn,
		       int32_t op_ret,
		       int32_t op_errno,
		       const char *path);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@inode     - inode parameter to @fn.
	     NOTE: @inode pointer is stored with a inode_ref().
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_mknod_cbk_stub (call_frame_t *frame,
		    fop_mknod_cbk_t fn,
		    int32_t op_ret,
		    int32_t op_errno,
		    inode_t *inode,
		    struct stat *buf);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@inode     - inode parameter to @fn.
	     NOTE: @inode pointer is stored with a inode_ref().
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_mkdir_cbk_stub (call_frame_t *frame,
		    fop_mkdir_cbk_t fn,
		    int32_t op_ret,
		    int32_t op_errno,
		    inode_t *inode,
		    struct stat *buf);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
call_stub_t *
fop_unlink_cbk_stub (call_frame_t *frame,
		     fop_unlink_cbk_t fn,
		     int32_t op_ret,
		     int32_t op_errno);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
call_stub_t *
fop_rmdir_cbk_stub (call_frame_t *frame,
		    fop_rmdir_cbk_t fn,
		    int32_t op_ret,
		    int32_t op_errno);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@inode     - inode parameter to @fn.
	     NOTE: @inode pointer is stored with a inode_ref().
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_symlink_cbk_stub (call_frame_t *frame,
		      fop_symlink_cbk_t fn,
		      int32_t op_ret,
		      int32_t op_errno,
		      inode_t *inode,
		      struct stat *buf);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_rename_cbk_stub (call_frame_t *frame,
		     fop_rename_cbk_t fn,
		     int32_t op_ret,
		     int32_t op_errno,
		     struct stat *buf);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@inode     - inode parameter to @fn.
	     NOTE: @inode pointer is stored with a inode_ref().
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_link_cbk_stub (call_frame_t *frame,
		   fop_link_cbk_t fn,
		   int32_t op_ret,
		   int32_t op_errno,
		   inode_t *inode,
		   struct stat *buf);

@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@fd        - fd parameter to @fn.
	     NOTE: @fd pointer is stored with a fd_ref().
@inode     - inode parameter to @fn.
	     NOTE: @inode pointer is stored with a inode_ref().
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_create_cbk_stub (call_frame_t *frame,
		     fop_create_cbk_t fn,
		     int32_t op_ret,
		     int32_t op_errno,
		     fd_t *fd,
		     inode_t *inode,
		     struct stat *buf);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@fd        - fd parameter to @fn.
	     NOTE: @fd pointer is stored with a fd_ref().
call_stub_t *
fop_open_cbk_stub (call_frame_t *frame,
		   fop_open_cbk_t fn,
		   int32_t op_ret,
		   int32_t op_errno,
		   fd_t *fd);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@vector    - vector parameter to @fn.
	     NOTE: @vector is copied to a different memory location, if not NULL. also
	           frame->root->rsp_refs is dict_ref()ed.
@stbuf     - stbuf parameter to @fn.
	     NOTE: @stbuf is copied to a different memory location, if not NULL.
call_stub_t *
fop_readv_cbk_stub (call_frame_t *frame,
		    fop_readv_cbk_t fn,
		    int32_t op_ret,
		    int32_t op_errno,
		    struct iovec *vector,
		    int32_t count,
		    struct stat *stbuf);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@stbuf     - stbuf parameter to @fn.
	     NOTE: @stbuf is copied to a different memory location, if not NULL.
call_stub_t *
fop_writev_cbk_stub (call_frame_t *frame,
		     fop_writev_cbk_t fn,
		     int32_t op_ret,
		     int32_t op_errno,
		     struct stat *stbuf);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
call_stub_t *
fop_flush_cbk_stub (call_frame_t *frame,
		    fop_flush_cbk_t fn,
		    int32_t op_ret,
		    int32_t op_errno);

@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
call_stub_t *
fop_fsync_cbk_stub (call_frame_t *frame,
		    fop_fsync_cbk_t fn,
		    int32_t op_ret,
		    int32_t op_errno);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@fd        - fd parameter to @fn.
	     NOTE: @fd pointer is stored with a fd_ref().
call_stub_t *
fop_opendir_cbk_stub (call_frame_t *frame,
		      fop_opendir_cbk_t fn,
		      int32_t op_ret,
		      int32_t op_errno,
		      fd_t *fd);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@entries   - entries parameter to @fn.
@count     - count parameter to @fn.
call_stub_t *
fop_getdents_cbk_stub (call_frame_t *frame,
		      fop_getdents_cbk_t fn,
		      int32_t op_ret,
		      int32_t op_errno,
		      dir_entry_t *entries,
		      int32_t count);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
call_stub_t *
fop_setdents_cbk_stub (call_frame_t *frame,
		       fop_setdents_cbk_t fn,
		       int32_t op_ret,
		       int32_t op_errno);

@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
call_stub_t *
fop_fsyncdir_cbk_stub (call_frame_t *frame,
		       fop_fsyncdir_cbk_t fn,
		       int32_t op_ret,
		       int32_t op_errno);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@buf       - buf parameter to @fn.
	     NOTE: @buf is copied to a different memory location, if not NULL.
call_stub_t *
fop_statfs_cbk_stub (call_frame_t *frame,
		     fop_statfs_cbk_t fn,
		     int32_t op_ret,
		     int32_t op_errno,
		     struct statvfs *buf);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
call_stub_t *
fop_setxattr_cbk_stub (call_frame_t *frame,
		       fop_setxattr_cbk_t fn,
		       int32_t op_ret,
		       int32_t op_errno);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
@value     - value dictionary parameter to @fn.
	     NOTE: @value pointer is stored with a dict_ref().
call_stub_t *
fop_getxattr_cbk_stub (call_frame_t *frame,
		       fop_getxattr_cbk_t fn,
		       int32_t op_ret,
		       int32_t op_errno,
		       dict_t *value);


@frame     - call frame which has to be used to resume the call at call_resume().
@fn        - procedure to call during call_resume().
@op_ret    - op_ret parameter to @fn.
@op_errno  - op_errno parameter to @fn.
call_stub_t *
fop_removexattr_cbk_stub (call_frame_t *frame,
			  fop_removexattr_cbk_t fn,
			  int32_t op_ret,
			  int32_t op_errno);


@frame    - call frame which has to be used to resume the call at call_resume().
@fn       - procedure to call during call_resume().
@op_ret   - op_ret parameter to @fn.
@op_errno - op_errno parameter to @fn.
@lock     - lock parameter to @fn.
	    NOTE: @lock is copied to a different memory location while creating
	          stub.
call_stub_t *
fop_lk_cbk_stub (call_frame_t *frame,
		 fop_lk_cbk_t fn,
		 int32_t op_ret,
		 int32_t op_errno,
		 struct flock *lock);

@frame    - call frame which has to be used to resume the call at call_resume().
@fn       - procedure to call during call_resume().
@op_ret   - op_ret parameter to @fn.
@op_errno - op_errno parameter to @fn.
@lock     - lock parameter to @fn.
	    NOTE: @lock is copied to a different memory location while creating
	          stub.
call_stub_t *
fop_gf_lk_cbk_stub (call_frame_t *frame,
		    fop_gf_lk_cbk_t fn,
		    int32_t op_ret,
		    int32_t op_errno,
		    struct flock *lock);


@frame    - call frame which has to be used to resume the call at call_resume().
@fn       - procedure to call during call_resume().
@op_ret   - op_ret parameter to @fn.
@op_errno - op_errno parameter to @fn.
@entries  - entries parameter to @fn.
call_stub_t *
fop_readdir_cbk_stub (call_frame_t *frame,
		      fop_readdir_cbk_t fn,
		      int32_t op_ret,
		      int32_t op_errno,
		      gf_dirent_t *entries);


@frame         - call frame which has to be used to resume the call at call_resume().
@fn            - procedure to call during call_resume().
@op_ret        - op_ret parameter to @fn.
@op_errno      - op_errno parameter to @fn.
@file_checksum - file_checksum parameter to @fn.
                 NOTE: file_checksum will be copied to a different memory location
		       while creating stub.
@dir_checksum  - dir_checksum parameter to @fn.
                 NOTE: file_checksum will be copied to a different memory location
		       while creating stub.
call_stub_t *
fop_checksum_cbk_stub (call_frame_t *frame,
		       fop_checksum_cbk_t fn,
		       int32_t op_ret,
		       int32_t op_errno,
		       uint8_t *file_checksum,
		       uint8_t *dir_checksum);

resuming a call:
---------------
  call can be resumed using call stub through call_resume API.

  void call_resume (call_stub_t *stub);

  stub - call stub created during pausing a call.

  NOTE: call_resume() will decrease reference count of any fd_t, dict_t and inode_t that it finds
        in  stub->args.<operation>.<fd_t-or-inode_t-or-dict_t>. so, if any fd_t, dict_t or
	inode_t pointers are assigned at stub->args.<operation>.<fd_t-or-inode_t-or-dict_t> after
	fop_<operation>_stub() call, they must be <fd_t-or-inode_t-or-dict_t>_ref()ed.

	call_resume does not STACK_DESTROY() for any fop.

  if stub->fn is NULL, call_resume does STACK_WIND() or STACK_UNWIND() using the stub->frame.

  return - call resume fails only if stub is NULL. call resume fails with errno set to EINVAL.