nfs-ganesha 1.4
|
00001 /* 00002 * 00003 * 00004 * Copyright CEA/DAM/DIF (2008) 00005 * contributeur : Philippe DENIEL philippe.deniel@cea.fr 00006 * Thomas LEIBOVICI thomas.leibovici@cea.fr 00007 * 00008 * 00009 * This program is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Lesser General Public 00011 * License as published by the Free Software Foundation; either 00012 * version 3 of the License, or (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * Lesser General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public 00020 * License along with this library; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00022 * 00023 * --------------------------------------- 00024 */ 00025 00038 #ifndef _NFS_PROTO_FUNCTIONS_H 00039 #define _NFS_PROTO_FUNCTIONS_H 00040 00041 #include "nfs23.h" 00042 #include "mount.h" 00043 #include "nfs4.h" 00044 #include "nlm4.h" 00045 #include "rquota.h" 00046 00047 #include <pthread.h> 00048 #include <sys/types.h> 00049 #include <sys/param.h> 00050 00051 00052 #include "LRU_List.h" 00053 #include "fsal.h" 00054 #include "cache_inode.h" 00055 #include "nfs_exports.h" 00056 #include "nfs_creds.h" 00057 #include "nfs_file_handle.h" 00058 00059 #include "err_LRU_List.h" 00060 #include "err_HashTable.h" 00061 00062 #define NFS4_ATTRVALS_BUFFLEN 1024 00063 00064 /* ------------------------------ Typedefs and structs----------------------- */ 00065 00066 typedef union nfs_arg__ 00067 { 00068 fhandle2 arg_getattr2; 00069 SETATTR2args arg_setattr2; 00070 diropargs2 arg_lookup2; 00071 fhandle2 arg_readlink2; 00072 READ2args arg_read2; 00073 WRITE2args arg_write2; 00074 CREATE2args arg_create2; 00075 diropargs2 arg_remove2; 00076 RENAME2args arg_rename2; 00077 LINK2args arg_link2; 00078 SYMLINK2args arg_symlink2; 00079 CREATE2args arg_mkdir2; 00080 diropargs2 arg_rmdir2; 00081 READDIR2args arg_readdir2; 00082 fhandle2 arg_statfs2; 00083 GETATTR3args arg_getattr3; 00084 SETATTR3args arg_setattr3; 00085 LOOKUP3args arg_lookup3; 00086 ACCESS3args arg_access3; 00087 READLINK3args arg_readlink3; 00088 READ3args arg_read3; 00089 WRITE3args arg_write3; 00090 CREATE3args arg_create3; 00091 MKDIR3args arg_mkdir3; 00092 SYMLINK3args arg_symlink3; 00093 MKNOD3args arg_mknod3; 00094 REMOVE3args arg_remove3; 00095 RMDIR3args arg_rmdir3; 00096 RENAME3args arg_rename3; 00097 LINK3args arg_link3; 00098 READDIR3args arg_readdir3; 00099 READDIRPLUS3args arg_readdirplus3; 00100 FSSTAT3args arg_fsstat3; 00101 FSINFO3args arg_fsinfo3; 00102 PATHCONF3args arg_pathconf3; 00103 COMMIT3args arg_commit3; 00104 COMPOUND4args arg_compound4; 00105 00106 /* mnt protocol arguments */ 00107 dirpath arg_mnt; 00108 00109 /* nlm protocl arguments */ 00110 nlm4_testargs arg_nlm4_test; 00111 nlm4_lockargs arg_nlm4_lock; 00112 nlm4_cancargs arg_nlm4_cancel; 00113 nlm4_shareargs arg_nlm4_share; 00114 nlm4_unlockargs arg_nlm4_unlock; 00115 nlm4_sm_notifyargs arg_nlm4_sm_notify; 00116 nlm4_free_allargs arg_nlm4_free_allargs; 00117 nlm4_res arg_nlm4_res; 00118 00119 /* Rquota arguments */ 00120 getquota_args arg_rquota_getquota; 00121 getquota_args arg_rquota_getactivequota; 00122 setquota_args arg_rquota_setquota; 00123 setquota_args arg_rquota_setactivequota; 00124 00125 /* Rquota arguments */ 00126 ext_getquota_args arg_ext_rquota_getquota; 00127 ext_getquota_args arg_ext_rquota_getactivequota; 00128 ext_setquota_args arg_ext_rquota_setquota; 00129 ext_setquota_args arg_ext_rquota_setactivequota; 00130 } nfs_arg_t; 00131 00132 struct COMPOUND4res_extended 00133 { 00134 COMPOUND4res res_compound4; 00135 bool_t res_cached; 00136 }; 00137 00138 typedef union nfs_res__ 00139 { 00140 ATTR2res res_attr2; 00141 DIROP2res res_dirop2; 00142 READLINK2res res_readlink2; 00143 READ2res res_read2; 00144 nfsstat2 res_stat2; 00145 READDIR2res res_readdir2; 00146 STATFS2res res_statfs2; 00147 GETATTR3res res_getattr3; 00148 SETATTR3res res_setattr3; 00149 LOOKUP3res res_lookup3; 00150 ACCESS3res res_access3; 00151 READLINK3res res_readlink3; 00152 READ3res res_read3; 00153 WRITE3res res_write3; 00154 CREATE3res res_create3; 00155 MKDIR3res res_mkdir3; 00156 SYMLINK3res res_symlink3; 00157 MKNOD3res res_mknod3; 00158 REMOVE3res res_remove3; 00159 RMDIR3res res_rmdir3; 00160 RENAME3res res_rename3; 00161 LINK3res res_link3; 00162 READDIR3res res_readdir3; 00163 READDIRPLUS3res res_readdirplus3; 00164 FSSTAT3res res_fsstat3; 00165 FSINFO3res res_fsinfo3; 00166 PATHCONF3res res_pathconf3; 00167 COMMIT3res res_commit3; 00168 COMPOUND4res res_compound4; 00169 COMPOUND4res_extended res_compound4_extended; 00170 00171 /* mount protocol returned values */ 00172 fhstatus2 res_mnt1; 00173 exports res_mntexport; 00174 mountres3 res_mnt3; 00175 mountlist res_dump; 00176 00177 /* nlm4 returned values */ 00178 nlm4_testres res_nlm4test; 00179 nlm4_res res_nlm4; 00180 nlm4_shareres res_nlm4share; 00181 00182 /* Ext Rquota arguments */ 00183 getquota_rslt res_rquota_getquota; 00184 getquota_rslt res_rquota_getactivequota; 00185 setquota_rslt res_rquota_setquota; 00186 setquota_rslt res_rquota_setactivequota; 00187 /* Rquota arguments */ 00188 getquota_rslt res_ext_rquota_getquota; 00189 getquota_rslt res_ext_rquota_getactivequota; 00190 setquota_rslt res_ext_rquota_setquota; 00191 setquota_rslt res_ext_rquota_setactivequota; 00192 00193 char padding[1024]; 00194 } nfs_res_t; 00195 00196 /* flags related to the behaviour of the requests (to be stored in the dispatch behaviour field) */ 00197 #define NOTHING_SPECIAL 0x0000 /* Nothing to be done for this kind of request */ 00198 #define MAKES_WRITE 0x0001 /* The function modifyes the FSAL (not permitted for RO FS) */ 00199 #define NEEDS_CRED 0x0002 /* A credential is needed for this operation */ 00200 #define CAN_BE_DUP 0x0004 /* Handling of dup request can be done for this request */ 00201 #define SUPPORTS_GSS 0x0008 /* Request may be authenticated by RPCSEC_GSS */ 00202 00203 typedef int (*nfs_protocol_function_t) (nfs_arg_t *, 00204 exportlist_t *, 00205 fsal_op_context_t *, 00206 nfs_worker_data_t *, 00207 struct svc_req *, nfs_res_t *); 00208 00209 typedef int (*nfsremote_protocol_function_t) (CLIENT *, nfs_arg_t *, nfs_res_t *); 00210 00211 typedef void (*nfs_protocol_free_t) (nfs_res_t *); 00212 00213 typedef struct nfs_function_desc__ 00214 { 00215 nfs_protocol_function_t service_function; 00216 nfs_protocol_free_t free_function; 00217 xdrproc_t xdr_decode_func; 00218 xdrproc_t xdr_encode_func; 00219 char *funcname; 00220 unsigned int dispatch_behaviour; 00221 } nfs_function_desc_t; 00222 00228 int mnt_Null(nfs_arg_t *parg, 00229 exportlist_t *pexport, 00230 fsal_op_context_t *pcontext, 00231 nfs_worker_data_t *pworker, 00232 struct svc_req *preq, 00233 nfs_res_t *pres); 00234 00235 int mnt_Mnt(nfs_arg_t *parg, 00236 exportlist_t *pexport, 00237 fsal_op_context_t *pcontext, 00238 nfs_worker_data_t *pworker, 00239 struct svc_req *preq, 00240 nfs_res_t *pres); 00241 00242 int mnt_Dump(nfs_arg_t *parg, 00243 exportlist_t *pexport, 00244 fsal_op_context_t *pcontext, 00245 nfs_worker_data_t *pworker, 00246 struct svc_req *preq, 00247 nfs_res_t *pres); 00248 00249 int mnt_Umnt(nfs_arg_t *parg, 00250 exportlist_t *pexport, 00251 fsal_op_context_t *pcontext, 00252 nfs_worker_data_t *pworker, 00253 struct svc_req *preq, 00254 nfs_res_t *pres); 00255 00256 int mnt_UmntAll(nfs_arg_t *parg, 00257 exportlist_t *pexport, 00258 fsal_op_context_t *pcontext, 00259 nfs_worker_data_t *pworker, 00260 struct svc_req *preq, 00261 nfs_res_t *pres); 00262 00263 int mnt_Export(nfs_arg_t *parg, 00264 exportlist_t *pexport, 00265 fsal_op_context_t *pcontext, 00266 nfs_worker_data_t *pworker, 00267 struct svc_req *preq, 00268 nfs_res_t * pres); 00269 00270 /* @} 00271 * -- End of MNT protocol functions. -- 00272 */ 00273 00280 int nlm_Null(nfs_arg_t *parg, 00281 exportlist_t *pexport, 00282 fsal_op_context_t *pcontext, 00283 nfs_worker_data_t *pworker, 00284 struct svc_req *preq, 00285 nfs_res_t *pres); 00286 00287 int nlm4_Test(nfs_arg_t *parg, 00288 exportlist_t *pexport, 00289 fsal_op_context_t *pcontext, 00290 nfs_worker_data_t *pworker, 00291 struct svc_req *preq, 00292 nfs_res_t *pres); 00293 00294 int nlm4_Lock(nfs_arg_t *parg, 00295 exportlist_t *pexport, 00296 fsal_op_context_t *pcontext, 00297 nfs_worker_data_t *pworker, 00298 struct svc_req *preq, 00299 nfs_res_t *pres); 00300 00301 int nlm4_Cancel(nfs_arg_t *parg, 00302 exportlist_t *pexport, 00303 fsal_op_context_t *pcontext, 00304 nfs_worker_data_t *pworker, 00305 struct svc_req *preq, 00306 nfs_res_t *pres); 00307 00308 int nlm4_Unlock(nfs_arg_t *parg, 00309 exportlist_t *pexport, 00310 fsal_op_context_t *pcontext, 00311 nfs_worker_data_t *pworker, 00312 struct svc_req *preq, 00313 nfs_res_t *pres); 00314 00315 int nlm4_Sm_Notify(nfs_arg_t *parg, 00316 exportlist_t *pexport, 00317 fsal_op_context_t *pcontext, 00318 nfs_worker_data_t *pworker, 00319 struct svc_req *preq, 00320 nfs_res_t *pres); 00321 00322 int nlm4_Test_Message(nfs_arg_t *parg, 00323 exportlist_t *pexport, 00324 fsal_op_context_t *pcontext, 00325 nfs_worker_data_t *pworker, 00326 struct svc_req *preq, 00327 nfs_res_t *pres); 00328 00329 int nlm4_Cancel_Message(nfs_arg_t *parg, 00330 exportlist_t *pexport, 00331 fsal_op_context_t *pcontext, 00332 nfs_worker_data_t *pworker, 00333 struct svc_req *preq, 00334 nfs_res_t *pres); 00335 00336 int nlm4_Lock_Message(nfs_arg_t *parg, 00337 exportlist_t *pexport, 00338 fsal_op_context_t *pcontext, 00339 nfs_worker_data_t *pworker, 00340 struct svc_req *preq, 00341 nfs_res_t *pres); 00342 00343 int nlm4_Unlock_Message(nfs_arg_t *parg, 00344 exportlist_t *pexport, 00345 fsal_op_context_t *pcontext, 00346 nfs_worker_data_t *pworker, 00347 struct svc_req *preq, 00348 nfs_res_t *pres); 00349 00350 00351 int nlm4_Granted_Res(nfs_arg_t *parg, 00352 exportlist_t *pexport, 00353 fsal_op_context_t *pcontext, 00354 nfs_worker_data_t *pworker, 00355 struct svc_req *preq, 00356 nfs_res_t *pres); 00357 00358 int nlm4_Share(nfs_arg_t * parg, 00359 exportlist_t * pexport, 00360 fsal_op_context_t * pcontext, 00361 nfs_worker_data_t * pworker, 00362 struct svc_req * preq, 00363 nfs_res_t * pres); 00364 00365 int nlm4_Unshare(nfs_arg_t * parg, 00366 exportlist_t * pexport, 00367 fsal_op_context_t * pcontext, 00368 nfs_worker_data_t * pworker, 00369 struct svc_req * preq, 00370 nfs_res_t * pres); 00371 00372 int nlm4_Free_All(nfs_arg_t *parg, 00373 exportlist_t *pexport, 00374 fsal_op_context_t *pcontext, 00375 nfs_worker_data_t *pworker, 00376 struct svc_req *preq, 00377 nfs_res_t *pres); 00378 00379 /* @} 00380 * -- End of NLM protocol functions. -- 00381 */ 00382 00389 int rquota_Null(nfs_arg_t *parg, 00390 exportlist_t *pexport, 00391 fsal_op_context_t *pcontext, 00392 nfs_worker_data_t *pworker, 00393 struct svc_req *preq, 00394 nfs_res_t *pres); 00395 00396 int rquota_getquota(nfs_arg_t *parg, 00397 exportlist_t *pexport, 00398 fsal_op_context_t *pcontext, 00399 nfs_worker_data_t *pworker, 00400 struct svc_req *preq, 00401 nfs_res_t *pres); 00402 00403 int rquota_getactivequota(nfs_arg_t *parg, 00404 exportlist_t *pexport, 00405 fsal_op_context_t *pcontext, 00406 nfs_worker_data_t *pworker, 00407 struct svc_req *preq, 00408 nfs_res_t * pres); 00409 00410 int rquota_setquota(nfs_arg_t * parg /* IN */ , 00411 exportlist_t * pexport /* IN */ , 00412 fsal_op_context_t * pcontext /* IN */ , 00413 nfs_worker_data_t *pworker, 00414 struct svc_req *preq /* IN */ , 00415 nfs_res_t * pres /* OUT */ ); 00416 00417 int rquota_setactivequota(nfs_arg_t *parg, 00418 exportlist_t *pexport, 00419 fsal_op_context_t *pcontext, 00420 nfs_worker_data_t *pworker, 00421 struct svc_req *preq, 00422 nfs_res_t *pres); 00423 00424 /* @} 00425 * * -- End of RQUOTA protocol functions. -- 00426 * */ 00427 00434 int nfs_Null(nfs_arg_t *parg, 00435 exportlist_t *pexport, 00436 fsal_op_context_t *pcontext, 00437 nfs_worker_data_t *pworker, 00438 struct svc_req *preq, 00439 nfs_res_t *pres); 00440 00441 int nfs_Getattr(nfs_arg_t *parg, 00442 exportlist_t *pexport, 00443 fsal_op_context_t *pcontext, 00444 nfs_worker_data_t *pworker, 00445 struct svc_req *preq, 00446 nfs_res_t *pres); 00447 00448 int nfs_Setattr(nfs_arg_t *parg, 00449 exportlist_t *pexport, 00450 fsal_op_context_t *pcontext, 00451 nfs_worker_data_t *pworker, 00452 struct svc_req *preq, 00453 nfs_res_t *pres); 00454 00455 int nfs2_Root(nfs_arg_t *parg, 00456 exportlist_t *pexport, 00457 fsal_op_context_t *pcontext, 00458 nfs_worker_data_t *pworker, 00459 struct svc_req *preq, 00460 nfs_res_t *pres); 00461 00462 int nfs_Lookup(nfs_arg_t *parg, 00463 exportlist_t *pexport, 00464 fsal_op_context_t *pcontext, 00465 nfs_worker_data_t *pworker, 00466 struct svc_req *preq, 00467 nfs_res_t *pres); 00468 00469 int nfs_Readlink(nfs_arg_t *parg, 00470 exportlist_t *pexport, 00471 fsal_op_context_t *pcontext, 00472 nfs_worker_data_t *pworker, 00473 struct svc_req *preq, 00474 nfs_res_t *pres); 00475 00476 int nfs_Read(nfs_arg_t *parg, 00477 exportlist_t *pexport, 00478 fsal_op_context_t *pcontext, 00479 nfs_worker_data_t *pworker, 00480 struct svc_req *preq, 00481 nfs_res_t *pres); 00482 00483 int nfs2_Writecache(nfs_arg_t *parg, 00484 exportlist_t *pexport, 00485 fsal_op_context_t *pcontext, 00486 nfs_worker_data_t *pworker, 00487 struct svc_req *preq, 00488 nfs_res_t *pres); 00489 00490 int nfs_Write(nfs_arg_t *parg, 00491 exportlist_t *pexport, 00492 fsal_op_context_t *pcontext, 00493 nfs_worker_data_t *pworker, 00494 struct svc_req *preq, 00495 nfs_res_t *pres); 00496 00497 int nfs_Create(nfs_arg_t *parg, 00498 exportlist_t *pexport, 00499 fsal_op_context_t *pcontext, 00500 nfs_worker_data_t *pworker, 00501 struct svc_req *preq, 00502 nfs_res_t *pres); 00503 00504 int nfs_Remove(nfs_arg_t *parg, 00505 exportlist_t *pexport, 00506 fsal_op_context_t *pcontext, 00507 nfs_worker_data_t *pworker, 00508 struct svc_req *preq, 00509 nfs_res_t *pres); 00510 00511 int nfs_Rename(nfs_arg_t *parg, 00512 exportlist_t *pexport, 00513 fsal_op_context_t *pcontext, 00514 nfs_worker_data_t *pworker, 00515 struct svc_req *preq, 00516 nfs_res_t *pres); 00517 00518 int nfs_Link(nfs_arg_t *parg, 00519 exportlist_t *pexport, 00520 fsal_op_context_t *pcontext, 00521 nfs_worker_data_t *pworker, 00522 struct svc_req *preq, 00523 nfs_res_t *pres); 00524 00525 int nfs_Symlink(nfs_arg_t *parg, 00526 exportlist_t *pexport, 00527 fsal_op_context_t *pcontext, 00528 nfs_worker_data_t *pworker, 00529 struct svc_req *preq, 00530 nfs_res_t *pres); 00531 00532 int nfs_Mkdir(nfs_arg_t *parg, 00533 exportlist_t *pexport, 00534 fsal_op_context_t *pcontext, 00535 nfs_worker_data_t *pworker, 00536 struct svc_req *preq, 00537 nfs_res_t *pres); 00538 00539 int nfs_Rmdir(nfs_arg_t *parg, 00540 exportlist_t *pexport, 00541 fsal_op_context_t *pcontext, 00542 nfs_worker_data_t *pworker, 00543 struct svc_req *preq, 00544 nfs_res_t *pres); 00545 00546 int nfs_Readdir(nfs_arg_t *parg, 00547 exportlist_t *pexport, 00548 fsal_op_context_t *pcontext, 00549 nfs_worker_data_t *pworker, 00550 struct svc_req *preq, 00551 nfs_res_t *pres); 00552 00553 int nfs_Fsstat(nfs_arg_t *parg, 00554 exportlist_t *pexport, 00555 fsal_op_context_t *pcontext, 00556 nfs_worker_data_t *pworker, 00557 struct svc_req *preq, 00558 nfs_res_t *pres); 00559 00560 int nfs3_Access(nfs_arg_t *parg, 00561 exportlist_t *pexport, 00562 fsal_op_context_t *pcontext, 00563 nfs_worker_data_t *pworker, 00564 struct svc_req *preq, 00565 nfs_res_t *pres); 00566 00567 int nfs3_Readdirplus(nfs_arg_t *parg, 00568 exportlist_t *pexport, 00569 fsal_op_context_t *pcontext, 00570 nfs_worker_data_t *pworker, 00571 struct svc_req *preq, 00572 nfs_res_t *pres); 00573 00574 int nfs3_Fsinfo(nfs_arg_t *parg, 00575 exportlist_t *pexport, 00576 fsal_op_context_t *pcontext, 00577 nfs_worker_data_t *pworker, 00578 struct svc_req *preq, 00579 nfs_res_t *pres); 00580 00581 int nfs3_Pathconf(nfs_arg_t *parg, 00582 exportlist_t *pexport, 00583 fsal_op_context_t *pcontext, 00584 nfs_worker_data_t *pworker, 00585 struct svc_req *preq, 00586 nfs_res_t *pres); 00587 00588 int nfs3_Commit(nfs_arg_t *parg, 00589 exportlist_t *pexport, 00590 fsal_op_context_t *pcontext, 00591 nfs_worker_data_t *pworker, 00592 struct svc_req *preq, 00593 nfs_res_t *pres); 00594 00595 int nfs3_Mknod(nfs_arg_t *parg, 00596 exportlist_t *pexport, 00597 fsal_op_context_t *pcontext, 00598 nfs_worker_data_t *pworker, 00599 struct svc_req *preq, 00600 nfs_res_t *pres); 00601 00602 /* Functions needed for nfs v4 */ 00603 00604 int nfs4_Compound(nfs_arg_t *parg, 00605 exportlist_t *pexport, 00606 fsal_op_context_t *pcontext, 00607 nfs_worker_data_t *pworker, 00608 struct svc_req *preq /* IN */ , 00609 nfs_res_t *pres); 00610 00611 typedef int (*nfs4_op_function_t) (struct nfs_argop4 *, compound_data_t *, 00612 struct nfs_resop4 *); 00613 00614 int nfs4_op_access(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00615 compound_data_t * data, /* [IN] current data for the compound request */ 00616 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00617 00618 int nfs4_op_close(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00619 compound_data_t * data, /* [IN] current data for the compound request */ 00620 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00621 00622 int nfs4_op_commit(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00623 compound_data_t * data, /* [IN] current data for the compound request */ 00624 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00625 00626 int nfs4_op_create(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00627 compound_data_t * data, /* [IN] current data for the compound request */ 00628 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00629 00630 int nfs4_op_delegpurge(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00631 compound_data_t * data, /* [IN] current data for the compound request */ 00632 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00633 00634 int nfs4_op_delegreturn(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00635 compound_data_t * data, /* [IN] current data for the compound request */ 00636 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00637 00638 int nfs4_op_getattr(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00639 compound_data_t * data, /* [IN] current data for the compound request */ 00640 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00641 00642 int nfs4_op_getfh(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00643 compound_data_t * data, /* [IN] current data for the compound request */ 00644 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00645 00646 int nfs4_op_link(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00647 compound_data_t * data, /* [IN] current data for the compound request */ 00648 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00649 00650 int nfs4_op_lock(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00651 compound_data_t * data, /* [IN] current data for the compound request */ 00652 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00653 00654 int nfs4_op_lockt(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00655 compound_data_t * data, /* [IN] current data for the compound request */ 00656 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00657 00658 int nfs4_op_locku(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00659 compound_data_t * data, /* [IN] current data for the compound request */ 00660 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00661 00662 int nfs4_op_lookup(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00663 compound_data_t * data, /* [IN] current data for the compound request */ 00664 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00665 00666 int nfs4_op_lookupp(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00667 compound_data_t * data, /* [IN] current data for the compound request */ 00668 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00669 00670 int nfs4_op_lookupp(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00671 compound_data_t * data, /* [IN] current data for the compound request */ 00672 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00673 00674 int nfs4_op_nverify(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00675 compound_data_t * data, /* [IN] current data for the compound request */ 00676 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00677 00678 int nfs4_op_open(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00679 compound_data_t * data, /* [IN] current data for the compound request */ 00680 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00681 00682 int nfs4_op_open_confirm(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00683 compound_data_t * data, /* [IN] current data for the compound request */ 00684 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00685 00686 int nfs4_op_open_downgrade(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00687 compound_data_t * data, /* [IN] current data for the compound request */ 00688 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00689 00690 int nfs4_op_openattr(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00691 compound_data_t * data, /* [IN] current data for the compound request */ 00692 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00693 00694 int nfs4_op_putfh(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00695 compound_data_t * data, /* [IN] current data for the compound request */ 00696 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00697 00698 int nfs4_op_putpubfh(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00699 compound_data_t * data, /* [IN] current data for the compound request */ 00700 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00701 int nfs4_op_putrootfh(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00702 compound_data_t * data, /* [IN] current data for the compound request */ 00703 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00704 00705 int nfs4_op_read(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00706 compound_data_t * data, /* [IN] current data for the compound request */ 00707 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00708 00709 int nfs4_op_readdir(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00710 compound_data_t * data, /* [IN] current data for the compound request */ 00711 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00712 00713 int nfs4_op_remove(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00714 compound_data_t * data, /* [IN] current data for the compound request */ 00715 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00716 00717 int nfs4_op_renew(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00718 compound_data_t * data, /* [IN] current data for the compound request */ 00719 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00720 00721 int nfs4_op_rename(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00722 compound_data_t * data, /* [IN] current data for the compound request */ 00723 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00724 00725 int nfs4_op_restorefh(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00726 compound_data_t * data, /* [IN] current data for the compound request */ 00727 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00728 00729 int nfs4_op_readdir(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00730 compound_data_t * data, /* [IN] current data for the compound request */ 00731 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00732 00733 int nfs4_op_readlink(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00734 compound_data_t * data, /* [IN] current data for the compound request */ 00735 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00736 00737 int nfs4_op_savefh(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00738 compound_data_t * data, /* [IN] current data for the compound request */ 00739 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00740 00741 int nfs4_op_secinfo(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00742 compound_data_t * data, /* [IN] current data for the compound request */ 00743 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00744 00745 int nfs4_op_setattr(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00746 compound_data_t * data, /* [IN] current data for the compound request */ 00747 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00748 00749 int nfs4_op_setclientid(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00750 compound_data_t * data, /* [IN] current data for the compound request */ 00751 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00752 00753 int nfs4_op_setclientid_confirm(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00754 compound_data_t * data, /* [IN] current data for the compound request */ 00755 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00756 00757 int nfs4_op_verify(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00758 compound_data_t * data, /* [IN] current data for the compound request */ 00759 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00760 00761 int nfs4_op_write(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00762 compound_data_t * data, /* [IN] current data for the compound request */ 00763 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00764 00765 int nfs4_op_release_lockowner(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00766 compound_data_t * data, /* [IN] current data for the compound request */ 00767 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00768 00769 int nfs4_op_illegal(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00770 compound_data_t * data, /* [IN] current data for the compound request */ 00771 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00772 00773 #ifdef _USE_NFS4_1 00774 int nfs41_op_exchange_id(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00775 compound_data_t * data, /* [IN] current data for the compound request */ 00776 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00777 00778 int nfs41_op_commit(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00779 compound_data_t * data, /* [IN] current data for the compound request */ 00780 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00781 00782 int nfs41_op_close(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00783 compound_data_t * data, /* [IN] current data for the compound request */ 00784 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00785 00786 int nfs41_op_create_session(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00787 compound_data_t * data, /* [IN] current data for the compound request */ 00788 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00789 00790 int nfs41_op_getdevicelist(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00791 compound_data_t * data, /* [IN] current data for the compound request */ 00792 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00793 00794 int nfs41_op_free_stateid(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00795 compound_data_t * data, /* [IN] current data for the compound request */ 00796 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00797 00798 int nfs41_op_getdeviceinfo(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00799 compound_data_t * data, /* [IN] current data for the compound request */ 00800 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00801 00802 int nfs41_op_destroy_session(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00803 compound_data_t * data, /* [IN] current data for the compound request */ 00804 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00805 00806 int nfs41_op_open(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00807 compound_data_t * data, /* [IN] current data for the compound request */ 00808 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00809 00810 int nfs41_op_lock(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00811 compound_data_t * data, /* [IN] current data for the compound request */ 00812 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00813 00814 int nfs41_op_lockt(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00815 compound_data_t * data, /* [IN] current data for the compound request */ 00816 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00817 00818 int nfs41_op_locku(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00819 compound_data_t * data, /* [IN] current data for the compound request */ 00820 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00821 00822 int nfs41_op_layoutget(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00823 compound_data_t * data, /* [IN] current data for the compound request */ 00824 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00825 00826 int nfs41_op_layoutcommit(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00827 compound_data_t * data, /* [IN] current data for the compound request */ 00828 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00829 00830 int nfs41_op_layoutreturn(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00831 compound_data_t * data, /* [IN] current data for the compound request */ 00832 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00833 00834 int nfs41_op_reclaim_complete(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00835 compound_data_t * data, /* [IN] current data for the compound request */ 00836 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00837 00838 int nfs41_op_sequence(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00839 compound_data_t * data, /* [IN] current data for the compound request */ 00840 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00841 00842 int nfs41_op_read(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00843 compound_data_t * data, /* [IN] current data for the compound request */ 00844 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00845 00846 int nfs41_op_set_ssv(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00847 compound_data_t * data, /* [IN] current data for the compound request */ 00848 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00849 00850 int nfs41_op_test_stateid(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00851 compound_data_t * data, /* [IN] current data for the compound request */ 00852 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00853 00854 int nfs41_op_write(struct nfs_argop4 *op, /* [IN] NFS4 OP arguments */ 00855 compound_data_t * data, /* [IN] current data for the compound request */ 00856 struct nfs_resop4 *resp); /* [OUT] NFS4 OP results */ 00857 00858 #endif /* _USE_NFS4_1 */ 00859 00860 /* Available operations on pseudo fs */ 00861 int nfs4_op_getattr_pseudo(struct nfs_argop4 *op, 00862 compound_data_t * data, struct nfs_resop4 *resp); 00863 00864 int nfs4_op_access_pseudo(struct nfs_argop4 *op, 00865 compound_data_t * data, struct nfs_resop4 *resp); 00866 00867 int nfs4_op_lookup_pseudo(struct nfs_argop4 *op, 00868 compound_data_t * data, struct nfs_resop4 *resp); 00869 00870 int nfs4_op_lookupp_pseudo(struct nfs_argop4 *op, 00871 compound_data_t * data, struct nfs_resop4 *resp); 00872 00873 int nfs4_op_readdir_pseudo(struct nfs_argop4 *op, 00874 compound_data_t * data, struct nfs_resop4 *resp); 00875 00876 /* Available operations on xattrs */ 00877 int nfs4_op_getattr_xattr(struct nfs_argop4 *op, 00878 compound_data_t * data, struct nfs_resop4 *resp); 00879 00880 int nfs4_op_access_xattr(struct nfs_argop4 *op, 00881 compound_data_t * data, struct nfs_resop4 *resp); 00882 00883 int nfs4_op_lookup_xattr(struct nfs_argop4 *op, 00884 compound_data_t * data, struct nfs_resop4 *resp); 00885 00886 int nfs4_op_lookupp_xattr(struct nfs_argop4 *op, 00887 compound_data_t * data, struct nfs_resop4 *resp); 00888 00889 int nfs4_op_readdir_xattr(struct nfs_argop4 *op, 00890 compound_data_t * data, struct nfs_resop4 *resp); 00891 00892 nfsstat4 nfs4_fh_to_xattrfh(nfs_fh4 * pfhin, nfs_fh4 * pfhout); 00893 nfsstat4 nfs4_xattrfh_to_fh(nfs_fh4 * pfhin, nfs_fh4 * pfhout); 00894 00895 int nfs4_op_open_xattr(struct nfs_argop4 *op, 00896 compound_data_t * data, struct nfs_resop4 *resp); 00897 00898 int nfs4_op_read_xattr(struct nfs_argop4 *op, 00899 compound_data_t * data, struct nfs_resop4 *resp); 00900 00901 int nfs4_op_write_xattr(struct nfs_argop4 *op, 00902 compound_data_t * data, struct nfs_resop4 *resp); 00903 00904 int nfs4_op_remove_xattr(struct nfs_argop4 *op, 00905 compound_data_t * data, struct nfs_resop4 *resp); 00906 00907 int nfs_XattrD_Name(char *strname, char *objectname); 00908 00909 int nfs4_XattrToFattr(fattr4 * Fattr, 00910 compound_data_t * data, nfs_fh4 * objFH, bitmap4 * Bitmap); 00911 00912 /* NFSv4 CB calls */ 00913 int nfs4_cb_getattr(struct nfs_cb_argop4 *op, 00914 compound_data_t * data, struct nfs_cb_resop4 *resp); 00915 00916 int nfs4_cb_recall(struct nfs_cb_argop4 *op, 00917 compound_data_t * data, struct nfs_cb_resop4 *resp); 00918 00919 int nfs4_cb_illegal(struct nfs_cb_argop4 *op, 00920 compound_data_t * data, struct nfs_cb_resop4 *resp); 00921 00922 /* Stats management for NFSv4 */ 00923 int nfs4_op_stat_update(nfs_arg_t * parg /* IN */ , 00924 nfs_res_t * pres /* IN */ , 00925 nfs_request_stat_t * pstat_req /* OUT */ ); 00926 00927 /* @} 00928 * -- End of NFS protocols functions. -- 00929 */ 00930 00931 /* 00932 * Definition of an array for the characteristics of each GETATTR sub-operations 00933 */ 00934 00935 #define FATTR4_ATTR_READ 0x00001 00936 #define FATTR4_ATTR_WRITE 0x00010 00937 #define FATTR4_ATTR_READ_WRITE 0x00011 00938 00939 typedef struct fattr4_dent 00940 { 00941 char *name; /* The name of the operation */ 00942 unsigned int val; /* The rank for the operation */ 00943 unsigned int supported; /* Is this action supported ? */ 00944 unsigned int size_fattr4; /* The size of the dedicated attr subtype */ 00945 unsigned int access; /* The access type for this attributes */ 00946 } fattr4_dent_t; 00947 00948 /* This array reflects the tables on page 39-46 of RFC3530 */ 00949 static const fattr4_dent_t __attribute__ ((__unused__)) fattr4tab[] = 00950 { 00951 { 00952 "FATTR4_SUPPORTED_ATTRS", 0, 1, sizeof(fattr4_supported_attrs), FATTR4_ATTR_READ} 00953 , 00954 { 00955 "FATTR4_TYPE", 1, 1, sizeof(fattr4_type), FATTR4_ATTR_READ} 00956 , 00957 { 00958 "FATTR4_FH_EXPIRE_TYPE", 2, 1, sizeof(fattr4_fh_expire_type), FATTR4_ATTR_READ} 00959 , 00960 { 00961 "FATTR4_CHANGE", 3, 1, sizeof(fattr4_change), FATTR4_ATTR_READ} 00962 , 00963 { 00964 "FATTR4_SIZE", 4, 1, sizeof(fattr4_size), FATTR4_ATTR_READ_WRITE} 00965 , 00966 { 00967 "FATTR4_LINK_SUPPORT", 5, 1, sizeof(fattr4_link_support), FATTR4_ATTR_READ} 00968 , 00969 { 00970 "FATTR4_SYMLINK_SUPPORT", 6, 1, sizeof(fattr4_symlink_support), FATTR4_ATTR_READ} 00971 , 00972 { 00973 "FATTR4_NAMED_ATTR", 7, 1, sizeof(fattr4_named_attr), FATTR4_ATTR_READ} 00974 , 00975 { 00976 "FATTR4_FSID", 8, 1, sizeof(fattr4_fsid), FATTR4_ATTR_READ} 00977 , 00978 { 00979 "FATTR4_UNIQUE_HANDLES", 9, 1, sizeof(fattr4_unique_handles), FATTR4_ATTR_READ} 00980 , 00981 { 00982 "FATTR4_LEASE_TIME", 10, 1, sizeof(fattr4_lease_time), FATTR4_ATTR_READ} 00983 , 00984 { 00985 "FATTR4_RDATTR_ERROR", 11, 1, sizeof(fattr4_rdattr_error), FATTR4_ATTR_READ} 00986 , 00987 { 00988 #ifdef _USE_NFS4_ACL 00989 "FATTR4_ACL", 12, 1, sizeof(fattr4_acl), FATTR4_ATTR_READ_WRITE} 00990 #else 00991 "FATTR4_ACL", 12, 0, sizeof(fattr4_acl), FATTR4_ATTR_READ_WRITE} 00992 #endif 00993 , 00994 { 00995 #ifdef _USE_NFS4_ACL 00996 "FATTR4_ACLSUPPORT", 13, 1, sizeof(fattr4_aclsupport), FATTR4_ATTR_READ} 00997 #else 00998 "FATTR4_ACLSUPPORT", 13, 1, sizeof(fattr4_aclsupport), FATTR4_ATTR_READ} 00999 #endif 01000 , 01001 { 01002 "FATTR4_ARCHIVE", 14, 1, sizeof(fattr4_archive), FATTR4_ATTR_READ_WRITE} 01003 , 01004 { 01005 "FATTR4_CANSETTIME", 15, 1, sizeof(fattr4_cansettime), FATTR4_ATTR_READ} 01006 , 01007 { 01008 "FATTR4_CASE_INSENSITIVE", 16, 1, sizeof(fattr4_case_insensitive), FATTR4_ATTR_READ} 01009 , 01010 { 01011 "FATTR4_CASE_PRESERVING", 17, 1, sizeof(fattr4_case_preserving), FATTR4_ATTR_READ} 01012 , 01013 { 01014 "FATTR4_CHOWN_RESTRICTED", 18, 1, sizeof(fattr4_chown_restricted), FATTR4_ATTR_READ} 01015 , 01016 { 01017 "FATTR4_FILEHANDLE", 19, 1, sizeof(fattr4_filehandle), FATTR4_ATTR_READ} 01018 , 01019 { 01020 "FATTR4_FILEID", 20, 1, sizeof(fattr4_fileid), FATTR4_ATTR_READ} 01021 , 01022 { 01023 "FATTR4_FILES_AVAIL", 21, 1, sizeof(fattr4_files_avail), FATTR4_ATTR_READ} 01024 , 01025 { 01026 "FATTR4_FILES_FREE", 22, 1, sizeof(fattr4_files_free), FATTR4_ATTR_READ} 01027 , 01028 { 01029 "FATTR4_FILES_TOTAL", 23, 1, sizeof(fattr4_files_total), FATTR4_ATTR_READ} 01030 , 01031 { 01032 "FATTR4_FS_LOCATIONS", 24, 0, sizeof(fattr4_fs_locations), FATTR4_ATTR_READ} 01033 , 01034 { 01035 "FATTR4_HIDDEN", 25, 1, sizeof(fattr4_hidden), FATTR4_ATTR_READ_WRITE} 01036 , 01037 { 01038 "FATTR4_HOMOGENEOUS", 26, 1, sizeof(fattr4_homogeneous), FATTR4_ATTR_READ} 01039 , 01040 { 01041 "FATTR4_MAXFILESIZE", 27, 1, sizeof(fattr4_maxfilesize), FATTR4_ATTR_READ} 01042 , 01043 { 01044 "FATTR4_MAXLINK", 28, 1, sizeof(fattr4_maxlink), FATTR4_ATTR_READ} 01045 , 01046 { 01047 "FATTR4_MAXNAME", 29, 1, sizeof(fattr4_maxname), FATTR4_ATTR_READ} 01048 , 01049 { 01050 "FATTR4_MAXREAD", 30, 1, sizeof(fattr4_maxread), FATTR4_ATTR_READ} 01051 , 01052 { 01053 "FATTR4_MAXWRITE", 31, 1, sizeof(fattr4_maxwrite), FATTR4_ATTR_READ} 01054 , 01055 { 01056 "FATTR4_MIMETYPE", 32, 0, sizeof(fattr4_mimetype), FATTR4_ATTR_READ_WRITE} 01057 , 01058 { 01059 "FATTR4_MODE", 33, 1, sizeof(fattr4_mode), FATTR4_ATTR_READ_WRITE} 01060 , 01061 { 01062 "FATTR4_NO_TRUNC", 34, 1, sizeof(fattr4_no_trunc), FATTR4_ATTR_READ} 01063 , 01064 { 01065 "FATTR4_NUMLINKS", 35, 1, sizeof(fattr4_numlinks), FATTR4_ATTR_READ} 01066 , 01067 { 01068 "FATTR4_OWNER", 36, 1, sizeof(fattr4_owner), FATTR4_ATTR_READ_WRITE} 01069 , 01070 { 01071 "FATTR4_OWNER_GROUP", 37, 1, sizeof(fattr4_owner_group), FATTR4_ATTR_READ_WRITE} 01072 , 01073 { 01074 "FATTR4_QUOTA_AVAIL_HARD", 38, 0, sizeof(fattr4_quota_avail_hard), FATTR4_ATTR_READ} 01075 , 01076 { 01077 "FATTR4_QUOTA_AVAIL_SOFT", 39, 0, sizeof(fattr4_quota_avail_soft), FATTR4_ATTR_READ} 01078 , 01079 { 01080 "FATTR4_QUOTA_USED", 40, 0, sizeof(fattr4_quota_used), FATTR4_ATTR_READ} 01081 , 01082 { 01083 "FATTR4_RAWDEV", 41, 1, sizeof(fattr4_rawdev), FATTR4_ATTR_READ} 01085 , 01086 { 01087 "FATTR4_SPACE_AVAIL", 42, 1, sizeof(fattr4_space_avail), FATTR4_ATTR_READ} 01088 , 01089 { 01090 "FATTR4_SPACE_FREE", 43, 1, sizeof(fattr4_space_used), FATTR4_ATTR_READ} 01091 , 01092 { 01093 "FATTR4_SPACE_TOTAL", 44, 1, sizeof(fattr4_space_total), FATTR4_ATTR_READ} 01094 , 01095 { 01096 "FATTR4_SPACE_USED", 45, 1, sizeof(fattr4_space_used), FATTR4_ATTR_READ} 01097 , 01098 { 01099 "FATTR4_SYSTEM", 46, 1, sizeof(fattr4_system), FATTR4_ATTR_READ_WRITE} 01100 , 01101 { 01102 "FATTR4_TIME_ACCESS", 47, 1, 12, 01103 /*sizeof( fattr4_time_access ) not aligned on 32 bits */ FATTR4_ATTR_READ} 01104 , 01105 { 01106 "FATTR4_TIME_ACCESS_SET", 48, 1, sizeof(fattr4_time_access_set), FATTR4_ATTR_WRITE} 01107 , 01108 { 01109 "FATTR4_TIME_BACKUP", 49, 0, 12, 01110 /* sizeof( fattr4_time_backup ) not aligned on 32 bits */ FATTR4_ATTR_READ_WRITE} 01111 , 01112 { 01113 "FATTR4_TIME_CREATE", 50, 0, 12, 01114 /* sizeof( fattr4_time_create ) not aligned on 32 bits */ FATTR4_ATTR_READ_WRITE} 01115 , 01116 { 01117 "FATTR4_TIME_DELTA", 51, 1, 12, 01118 /* sizeof( fattr4_time_delta ) not aligned on 32 bits */ FATTR4_ATTR_READ} 01119 , 01120 { 01121 "FATTR4_TIME_METADATA", 52, 1, 12, 01122 /* sizeof( fattr4_time_metadata ) not aligned on 32 bits */ FATTR4_ATTR_READ} 01123 , 01124 { 01125 "FATTR4_TIME_MODIFY", 53, 1, 12, 01126 /* sizeof( fattr4_time_modify ) not aligned on 32 bits */ FATTR4_ATTR_READ} 01127 , 01128 { 01129 "FATTR4_TIME_MODIFY_SET", 54, 1, sizeof(fattr4_time_modify_set), FATTR4_ATTR_WRITE} 01130 , 01131 { 01132 "FATTR4_MOUNTED_ON_FILEID", 55, 1, sizeof(fattr4_mounted_on_fileid), FATTR4_ATTR_READ} 01133 #ifdef _USE_NFS4_1 01134 , 01135 { 01136 "FATTR4_DIR_NOTIF_DELAY", 56, 0, sizeof(fattr4_dir_notif_delay), 01137 FATTR4_ATTR_READ} 01138 , 01139 { 01140 "FATTR4_DIRENT_NOTIF_DELAY", 57, 0, sizeof(fattr4_dirent_notif_delay), 01141 FATTR4_ATTR_READ} 01142 , 01143 { 01144 "FATTR4_DACL", 58, 0, sizeof(fattr4_dacl), FATTR4_ATTR_READ_WRITE} 01145 , 01146 { 01147 "FATTR4_SACL", 59, 0, sizeof(fattr4_sacl), FATTR4_ATTR_READ_WRITE} 01148 , 01149 { 01150 "FATTR4_CHANGE_POLICY", 60, 0, sizeof(fattr4_change_policy), FATTR4_ATTR_READ} 01151 , 01152 { 01153 "FATTR4_FS_STATUS", 61, 0, sizeof(fattr4_fs_status), FATTR4_ATTR_READ} 01154 , 01155 { 01156 #ifdef _PNFS_MDS 01157 "FATTR4_FS_LAYOUT_TYPES", 62, 1, sizeof(fattr4_fs_layout_types), FATTR4_ATTR_READ} 01158 #else 01159 "FATTR4_FS_LAYOUT_TYPES", 62, 0, sizeof(fattr4_fs_layout_types), FATTR4_ATTR_READ} 01160 #endif /* _PNFS_MDS */ 01161 , 01162 { 01163 "FATTR4_LAYOUT_HINT", 63, 0, sizeof(fattr4_layout_hint), FATTR4_ATTR_WRITE} 01164 , 01165 { 01166 "FATTR4_LAYOUT_TYPES", 64, 0, sizeof(fattr4_layout_types), FATTR4_ATTR_READ} 01167 , 01168 { 01169 #ifdef _PNFS_MDS 01170 "FATTR4_LAYOUT_BLKSIZE", 65, 1, sizeof(fattr4_layout_blksize), FATTR4_ATTR_READ} 01171 #else 01172 "FATTR4_LAYOUT_BLKSIZE", 65, 0, sizeof(fattr4_layout_blksize), FATTR4_ATTR_READ} 01173 #endif /* _PNFS_MDS */ 01174 , 01175 { 01176 "FATTR4_LAYOUT_ALIGNMENT", 66, 0, sizeof(fattr4_layout_alignment), FATTR4_ATTR_READ} 01177 , 01178 { 01179 "FATTR4_FS_LOCATIONS_INFO", 67, 0, sizeof(fattr4_fs_locations_info), FATTR4_ATTR_READ} 01180 , 01181 { 01182 "FATTR4_MDSTHRESHOLD", 68, 0, sizeof(fattr4_mdsthreshold), FATTR4_ATTR_READ} 01183 , 01184 { 01185 "FATTR4_RETENTION_GET", 69, 0, sizeof(fattr4_retention_get), FATTR4_ATTR_READ} 01186 , 01187 { 01188 "FATTR4_RETENTION_SET", 70, 0, sizeof(fattr4_retention_set), FATTR4_ATTR_WRITE} 01189 , 01190 { 01191 "FATTR4_RETENTEVT_GET", 71, 0, sizeof(fattr4_retentevt_get), FATTR4_ATTR_READ} 01192 , 01193 { 01194 "FATTR4_RETENTEVT_SET", 72, 0, sizeof(fattr4_retentevt_set), FATTR4_ATTR_WRITE} 01195 , 01196 { 01197 "FATTR4_RETENTION_HOLD", 73, 0, sizeof(fattr4_retention_hold), FATTR4_ATTR_READ_WRITE} 01198 , 01199 { 01200 "FATTR4_MODE_SET_MASKED", 74, 0, sizeof(fattr4_mode_set_masked), FATTR4_ATTR_WRITE} 01201 , 01202 { 01203 "FATTR4_SUPPATTR_EXCLCREAT", 75, 1, sizeof(fattr4_suppattr_exclcreat), FATTR4_ATTR_READ} 01204 , 01205 { 01206 "FATTR4_FS_CHARSET_CAP", 76, 0, sizeof(fattr4_fs_charset_cap), FATTR4_ATTR_READ} 01207 #endif /* _USE_NFS4_1 */ 01208 }; 01209 01210 /* BUGAZOMEU: Some definitions to be removed. FSAL parameters to be used instead */ 01211 #define NFS4_LEASE_LIFETIME 120 01212 #define FSINFO_MAX_FILESIZE 0xFFFFFFFFFFFFFFFFll 01213 #define MAX_HARD_LINK_VALUE (0xffff) 01214 #define NFS4_PSEUDOFS_MAX_READ_SIZE 1048576 01215 #define NFS4_PSEUDOFS_MAX_WRITE_SIZE 1048576 01216 #define NFS4_ROOT_UID 0 01217 #define NFS_MAXPATHLEN MAXPATHLEN 01218 #define DEFAULT_DOMAIN "localdomain" 01219 #define DEFAULT_IDMAPCONF "/etc/idmapd.conf" 01220 #endif /* _NFS_PROTO_FUNCTIONS_H */ 01221 01222 #define NFS_REQ_OK 0 01223 #define NFS_REQ_DROP 1 01224 01225 /* Free functions */ 01226 void mnt1_Mnt_Free(nfs_res_t * pres); 01227 void mnt3_Mnt_Free(nfs_res_t * pres); 01228 01229 void mnt_Dump_Free(nfs_res_t * pres); 01230 void mnt_Export_Free(nfs_res_t * pres); 01231 void mnt_Null_Free(nfs_res_t * pres); 01232 void mnt_Umnt_Free(nfs_res_t * pres); 01233 void mnt_UmntAll_Free(nfs_res_t * pres); 01234 01235 void nlm_Null_Free(nfs_res_t * pres); 01236 void nlm4_Test_Free(nfs_res_t * pres); 01237 void nlm4_Lock_Free(nfs_res_t * pres); 01238 void nlm4_NM_Lock_Free(nfs_res_t * pres); 01239 void nlm4_Share_Free(nfs_res_t * pres); 01240 void nlm4_Unshare_Free(nfs_res_t * pres); 01241 void nlm4_Cancel_Free(nfs_res_t * pres); 01242 void nlm4_Unlock_Free(nfs_res_t * pres); 01243 void nlm4_Sm_Notify_Free(nfs_res_t * pres); 01244 void nlm4_Granted_Res_Free(nfs_res_t * pres); 01245 void nlm4_Free_All_Free(nfs_res_t * pres); 01246 01247 void rquota_Null_Free(nfs_res_t * pres); 01248 void rquota_getquota_Free(nfs_res_t * pres); 01249 void rquota_getactivequota_Free(nfs_res_t * pres); 01250 void rquota_setquota_Free(nfs_res_t * pres); 01251 void rquota_setactivequota_Free(nfs_res_t * pres); 01252 01253 void nfs_Null_Free(nfs_res_t * resp); 01254 void nfs_Getattr_Free(nfs_res_t * resp); 01255 void nfs_Setattr_Free(nfs_res_t * resp); 01256 void nfs2_Lookup_Free(nfs_res_t * resp); 01257 void nfs3_Lookup_Free(nfs_res_t * resp); 01258 void nfs3_Access_Free(nfs_res_t * pres); 01259 void nfs3_Readlink_Free(nfs_res_t * resp); 01260 void nfs2_Read_Free(nfs_res_t * resp); 01261 void nfs_Write_Free(nfs_res_t * resp); 01262 void nfs_Create_Free(nfs_res_t * resp); 01263 void nfs_Mkdir_Free(nfs_res_t * resp); 01264 void nfs_Symlink_Free(nfs_res_t * resp); 01265 void nfs3_Mknod_Free(nfs_res_t * pres); 01266 void nfs_Remove_Free(nfs_res_t * resp); 01267 void nfs_Rmdir_Free(nfs_res_t * resp); 01268 void nfs_Rename_Free(nfs_res_t * resp); 01269 void nfs_Link_Free(nfs_res_t * resp); 01270 void nfs3_Readdir_Free(nfs_res_t * resp); 01271 void nfs3_Readdirplus_Free(nfs_res_t * resp); 01272 void nfs_Fsstat_Free(nfs_res_t * resp); 01273 void nfs3_Fsinfo_Free(nfs_res_t * pres); 01274 void nfs3_Pathconf_Free(nfs_res_t * pres); 01275 void nfs3_Commit_Free(nfs_res_t * pres); 01276 void nfs2_Root_Free(nfs_res_t * pres); 01277 void nfs2_Writecache_Free(nfs_res_t * pres); 01278 void nfs2_Readdir_Free(nfs_res_t * resp); 01279 void nfs3_Read_Free(nfs_res_t * resp); 01280 void nfs2_Readlink_Free(nfs_res_t * resp); 01281 void nfs4_Compound_FreeOne(nfs_resop4 * pres); 01282 void nfs4_Compound_Free(nfs_res_t * pres); 01283 void nfs4_Compound_CopyResOne(nfs_resop4 * pres_dst, nfs_resop4 * pres_src); 01284 void nfs4_Compound_CopyRes(nfs_res_t * pres_dst, nfs_res_t * pres_src); 01285 01286 void nfs4_op_access_Free(ACCESS4res * resp); 01287 void nfs4_op_close_Free(CLOSE4res * resp); 01288 void nfs4_op_commit_Free(COMMIT4res * resp); 01289 void nfs4_op_create_Free(CREATE4res * resp); 01290 void nfs4_op_delegreturn_Free(DELEGRETURN4res * resp); 01291 void nfs4_op_delegpurge_Free(DELEGPURGE4res * resp); 01292 void nfs4_op_getattr_Free(GETATTR4res * resp); 01293 void nfs4_op_getfh_Free(GETFH4res * resp); 01294 void nfs4_op_illegal_Free(ILLEGAL4res * resp); 01295 void nfs4_op_link_Free(LINK4res * resp); 01296 void nfs4_op_lock_Free(LOCK4res * resp); 01297 void nfs4_op_lockt_Free(LOCKT4res * resp); 01298 void nfs4_op_locku_Free(LOCKU4res * resp); 01299 void nfs4_op_lookup_Free(LOOKUP4res * resp); 01300 void nfs4_op_lookupp_Free(LOOKUPP4res * resp); 01301 void nfs4_op_nverify_Free(NVERIFY4res * resp); 01302 void nfs4_op_open_Free(OPEN4res * resp); 01303 void nfs4_op_open_confirm_Free(OPEN_CONFIRM4res * resp); 01304 void nfs4_op_open_downgrade_Free(OPEN_DOWNGRADE4res * resp); 01305 void nfs4_op_openattr_Free(OPENATTR4res * resp); 01306 void nfs4_op_openattr_Free(OPENATTR4res * resp); 01307 void nfs4_op_putfh_Free(PUTFH4res * resp); 01308 void nfs4_op_putpubfh_Free(PUTPUBFH4res * resp); 01309 void nfs4_op_putrootfh_Free(PUTROOTFH4res * resp); 01310 void nfs4_op_read_Free(READ4res * resp); 01311 void nfs4_op_readdir_Free(READDIR4res * resp); 01312 void nfs4_op_readlink_Free(READLINK4res * resp); 01313 void nfs4_op_release_lockowner_Free(RELEASE_LOCKOWNER4res * resp); 01314 void nfs4_op_rename_Free(RENAME4res * resp); 01315 void nfs4_op_remove_Free(REMOVE4res * resp); 01316 void nfs4_op_renew_Free(RENEW4res * resp); 01317 void nfs4_op_restorefh_Free(RESTOREFH4res * resp); 01318 void nfs4_op_savefh_Free(SAVEFH4res * resp); 01319 void nfs4_op_secinfo_Free(SECINFO4res * resp); 01320 void nfs4_op_setattr_Free(SETATTR4res * resp); 01321 void nfs4_op_setclientid_Free(SETCLIENTID4res * resp); 01322 void nfs4_op_setclientid_confirm_Free(SETCLIENTID_CONFIRM4res * resp); 01323 void nfs4_op_verify_Free(VERIFY4res * resp); 01324 void nfs4_op_write_Free(WRITE4res * resp); 01325 01326 void nfs4_op_close_CopyRes(CLOSE4res * resp_dst, CLOSE4res * resp_src); 01327 void nfs4_op_lock_CopyRes(LOCK4res * resp_dst, LOCK4res * resp_src); 01328 void nfs4_op_locku_CopyRes(LOCKU4res * resp_dst, LOCKU4res * resp_src); 01329 void nfs4_op_open_CopyRes(OPEN4res * resp_dst, OPEN4res * resp_src); 01330 void nfs4_op_open_confirm_CopyRes(OPEN_CONFIRM4res * resp_dst, OPEN_CONFIRM4res * resp_src); 01331 void nfs4_op_open_downgrade_CopyRes(OPEN_DOWNGRADE4res * resp_dst, OPEN_DOWNGRADE4res * resp_src); 01332 01333 #ifdef _USE_NFS4_1 01334 void nfs41_op_exchange_id_Free(EXCHANGE_ID4res * resp); 01335 void nfs41_op_close_Free(CLOSE4res * resp); 01336 void nfs41_op_create_session_Free(CREATE_SESSION4res * resp); 01337 void nfs41_op_getdevicelist_Free(GETDEVICELIST4res * resp); 01338 void nfs41_op_getdeviceinfo_Free(GETDEVICEINFO4res * resp); 01339 void nfs41_op_free_stateid_Free(FREE_STATEID4res * resp); 01340 void nfs41_op_destroy_session_Free(DESTROY_SESSION4res * resp); 01341 void nfs41_op_lock_Free(LOCK4res * resp); 01342 void nfs41_op_lockt_Free(LOCKT4res * resp); 01343 void nfs41_op_locku_Free(LOCKU4res * resp); 01344 void nfs41_op_read_Free(READ4res * resp); 01345 void nfs41_op_sequence_Free(SEQUENCE4res * resp); 01346 void nfs41_op_set_ssv_Free(SET_SSV4res * resp); 01347 void nfs41_op_test_stateid_Free(TEST_STATEID4res * resp); 01348 void nfs41_op_write_Free(WRITE4res * resp); 01349 void nfs41_op_reclaim_complete_Free(RECLAIM_COMPLETE4res * resp); 01350 01351 void nfs41_op_close_CopyRes(CLOSE4res * resp_dst, CLOSE4res * resp_src); 01352 void nfs41_op_lock_CopyRes(LOCK4res * resp_dst, LOCK4res * resp_src); 01353 void nfs41_op_locku_CopyRes(LOCKU4res * resp_dst, LOCKU4res * resp_src); 01354 void nfs41_op_open_CopyRes(OPEN4res * resp_dst, OPEN4res * resp_src); 01355 void nfs41_op_open_confirm_CopyRes(OPEN_CONFIRM4res * resp_dst, OPEN_CONFIRM4res * resp_src); 01356 void nfs41_op_open_downgrade_CopyRes(OPEN_DOWNGRADE4res * resp_dst, OPEN_DOWNGRADE4res * resp_src); 01357 #endif /* _USE_NFS4_1 */ 01358 01359 void compound_data_Free(compound_data_t * data); 01360 01361 #ifndef _USE_SWIG 01362 /* Pseudo FS functions */ 01363 int nfs4_ExportToPseudoFS(exportlist_t * pexportlist); 01364 pseudofs_t *nfs4_GetPseudoFs(void); 01365 01366 int nfs4_SetCompoundExport(compound_data_t * data); 01367 int nfs4_MakeCred(compound_data_t * data); 01368 01369 int nfs4_fsal_attr_To_Fattr(fsal_attrib_list_t * pattr, fattr4 * Fattr, 01370 compound_data_t * data, bitmap4 * Bitmap); 01371 int nfs4_Fattr_To_fsal_attr(fsal_attrib_list_t * pattr, fattr4 * Fattr, 01372 compound_data_t * data, bitmap4 * Bitmap); 01373 int nfs4_Fattr_Check_Access(fattr4 * Fattr, int access); 01374 int nfs4_Fattr_Check_Access_Bitmap(bitmap4 * pbitmap, int access); 01375 int nfs4_Fattr_Supported(fattr4 * Fattr); 01376 int nfs4_Fattr_Supported_Bitmap(bitmap4 * pbitmap); 01377 int nfs4_Fattr_cmp(fattr4 * Fattr1, fattr4 * Fattr2); 01378 01379 int nfs4_referral_str_To_Fattr_fs_location(char *input_str, char *buff, u_int * plen); 01380 01381 /**** Glue related functions ****/ 01382 /* nfs4_stringid_split - split a 'user@domain' string in two separated parts 01383 * str2utf8 - convert a regular, zero terminated string to a UTF8 string, 01384 * utf82str - convert a utf8 string to a regular zero-terminated string 01385 * uid2utf8 - convert a uid to a utf8 string descriptor 01386 * gid2utf8 - convert a gid to a utf8 string descriptor 01387 * utf82uid - convert a utf8 string descriptor to a uid 01388 * uft82gid - convert a utf8 string descriptor to a gid 01389 * gid2str - convert a gid to a string 01390 * str2gid - convert a string to a gid 01391 * uid2str - convert a uid to a string 01392 * str2uid - convert a string to a uid 01393 * nfs4_bitmap4_to_list - convert an attribute's bitmap to a list of attributes 01394 * nfs4_list_to_bitmap4 - convert a list of attributes to an attributes's bitmap 01395 */ 01396 01397 int uid2name(char *name, uid_t * puid); 01398 int name2uid(char *name, uid_t * puid); 01399 #ifdef _HAVE_GSSAPI 01400 int principal2uid(char *principal, uid_t * puid); 01401 #endif 01402 01403 int gid2name(char *name, gid_t * pgid); 01404 int name2gid(char *name, gid_t * pgid); 01405 01406 void free_utf8(utf8string * utf8str); 01407 int utf8dup(utf8string * newstr, utf8string * oldstr); 01408 int utf82str(char *str, int size, utf8string * utf8str); 01409 int str2utf8(char *str, utf8string * utf8str); 01410 01411 int uid2utf8(uid_t uid, utf8string * utf8str); 01412 int utf82uid(utf8string * utf8str, uid_t * Uid); 01413 01414 int uid2str(uid_t uid, char *str); 01415 int str2uid(char *str, uid_t * Uid); 01416 01417 int gid2str(gid_t gid, char *str); 01418 int str2gid(char *str, gid_t * Gid); 01419 01420 int gid2utf8(gid_t gid, utf8string * utf8str); 01421 int utf82gid(utf8string * utf8str, gid_t * Gid); 01422 01423 void nfs4_stringid_split(char *buff, char *uidname, char *domainname); 01424 01425 seqid4 nfs4_NextSeqId(seqid4 seqid); 01426 01427 /* Attributes conversion */ 01428 int nfs2_Sattr_To_FSALattr(fsal_attrib_list_t * pFSAL_attr, /* Out: file attributes */ 01429 sattr2 * pFattr); /* In: file attributes */ 01430 01431 int nfs2_FSALattr_To_Fattr(exportlist_t * pexport, /* In: the related export entry */ 01432 fsal_attrib_list_t * pFSAL_attr, /* In: file attributes */ 01433 fattr2 * pFattr); /* Out: file attributes */ 01434 01435 int nfs3_FSALattr_To_Fattr(exportlist_t * pexport, /* In: the related export entry */ 01436 const fsal_attrib_list_t * pFSAL_attr, /* In: file attributes */ 01437 fattr3 * pFattr); /* Out: file attributes */ 01438 int nfs3_FSALattr_To_PartialFattr(const fsal_attrib_list_t *, 01439 fsal_attrib_mask_t, 01440 fattr3 *); 01441 int nfs3_Sattr_To_FSALattr(fsal_attrib_list_t * pFSAL_attr, /* Out: file attributes */ 01442 sattr3 * pFattr); /* In: file attributes */ 01443 01444 nfsstat3 nfs3_fh_to_xattrfh(nfs_fh3 * pfhin, nfs_fh3 * pfhout); 01445 01446 int nfs3_Access_Xattr(nfs_arg_t * parg, 01447 exportlist_t * pexport, 01448 fsal_op_context_t * pcontext, 01449 struct svc_req *preq, nfs_res_t * pres); 01450 01451 int nfs3_Getattr_Xattr(nfs_arg_t * parg, 01452 exportlist_t * pexport, 01453 fsal_op_context_t * pcontext, 01454 struct svc_req *preq, nfs_res_t * pres); 01455 01456 int nfs3_Lookup_Xattr(nfs_arg_t * parg, 01457 exportlist_t * pexport, 01458 fsal_op_context_t * pcontext, 01459 struct svc_req *preq, nfs_res_t * pres); 01460 01461 int nfs3_Read_Xattr(nfs_arg_t * parg, 01462 exportlist_t * pexport, 01463 fsal_op_context_t * pcontext, 01464 struct svc_req *preq, nfs_res_t * pres); 01465 01466 int nfs3_Create_Xattr(nfs_arg_t * parg, 01467 exportlist_t * pexport, 01468 fsal_op_context_t * pcontext, 01469 struct svc_req *preq, nfs_res_t * pres); 01470 01471 int nfs3_Write_Xattr(nfs_arg_t * parg, 01472 exportlist_t * pexport, 01473 fsal_op_context_t * pcontext, 01474 struct svc_req *preq, nfs_res_t * pres); 01475 01476 int nfs3_Readdir_Xattr(nfs_arg_t * parg, 01477 exportlist_t * pexport, 01478 fsal_op_context_t * pcontext, 01479 struct svc_req *preq, nfs_res_t * pres); 01480 01481 int nfs3_Readdirplus_Xattr(nfs_arg_t * parg, 01482 exportlist_t * pexport, 01483 fsal_op_context_t * pcontext, 01484 struct svc_req *preq, nfs_res_t * pres); 01485 01486 int nfs3_Remove_Xattr(nfs_arg_t * parg /* IN */ , 01487 exportlist_t * pexport /* IN */ , 01488 fsal_op_context_t * pcontext /* IN */ , 01489 struct svc_req *preq /* IN */ , 01490 nfs_res_t * pres /* OUT */ ); 01491 01492 int nfs4_PseudoToFattr(pseudofs_entry_t * psfsp, 01493 fattr4 * Fattr, 01494 compound_data_t * data, nfs_fh4 * objFH, bitmap4 * Bitmap); 01495 01496 int nfs4_PseudoToFhandle(nfs_fh4 * fh4p, pseudofs_entry_t * psfsentry); 01497 01498 int Fattr4_To_FSAL_attr(fsal_attrib_list_t * pFSAL_attr, /* Out: File attributes */ 01499 fattr4 * pFattr, /* In: File attributes */ 01500 nfs_fh4 *fh); 01501 int nfs4_Fattr_To_FSAL_attr(fsal_attrib_list_t * pFSAL_attr, /* Out: File attributes */ 01502 fattr4 * pFattr); /* In: File attributes */ 01503 01504 int nfs4_attrmap_to_FSAL_attrmask(bitmap4 attrmap, fsal_attrib_mask_t* attrmask); 01505 01506 int nfs4_Fattr_Fill(fattr4 *Fattr, int attrcnt, uint32_t *attrlist, 01507 int valsiz, char *attrvals); 01508 int nfs4_supported_attrs_to_fattr(char *outbuf); 01509 int nfs4_FSALattr_To_Fattr(exportlist_t *pexport, 01510 fsal_attrib_list_t *pattr, 01511 fattr4 *Fattr, 01512 compound_data_t *data, 01513 nfs_fh4 *objFH, 01514 bitmap4 *Bitmap); 01515 01516 void nfs4_list_to_bitmap4(bitmap4 * b, uint_t plen, uint32_t * pval); 01517 void nfs4_bitmap4_to_list(bitmap4 * b, uint_t * plen, uint32_t * pval); 01518 01519 int nfs4_bitmap4_Remove_Unsupported(bitmap4 * pbitmap) ; 01520 01521 01522 /* Error conversion routines */ 01523 nfsstat4 nfs4_Errno(cache_inode_status_t error); 01524 nfsstat3 nfs3_Errno(cache_inode_status_t error); 01525 nfsstat2 nfs2_Errno(cache_inode_status_t error); 01526 int nfs3_AllocateFH(nfs_fh3 * fh); 01527 int nfs4_AllocateFH(nfs_fh4 * fh); 01528 01529 uint64_t nfs_htonl64(uint64_t arg64); 01530 uint64_t nfs_ntohl64(uint64_t arg64); 01531 01532 int idmap_compute_hash_value(char *name, uint32_t * phashval); 01533 01534 int nfs4_Is_Fh_Referral(nfs_fh4 * pfh); 01535 int nfs4_Set_Fh_Referral(nfs_fh4 * pfh); 01536 #endif