496 "rfs4_op_setclient_confirm",
497 "rfs4_op_verify",
498 "rfs4_op_write",
499 "rfs4_op_release_lockowner",
500 "rfs4_op_illegal"
501 };
502 #endif
503
504 void rfs4_ss_chkclid(rfs4_client_t *);
505
506 extern size_t strlcpy(char *dst, const char *src, size_t dstsize);
507
508 extern void rfs4_free_fs_locations4(fs_locations4 *);
509
510 #ifdef nextdp
511 #undef nextdp
512 #endif
513 #define nextdp(dp) ((struct dirent64 *)((char *)(dp) + (dp)->d_reclen))
514
515 static const fs_operation_def_t nfs4_rd_deleg_tmpl[] = {
516 VOPNAME_OPEN, { .femop_open = deleg_rd_open },
517 VOPNAME_WRITE, { .femop_write = deleg_rd_write },
518 VOPNAME_SETATTR, { .femop_setattr = deleg_rd_setattr },
519 VOPNAME_RWLOCK, { .femop_rwlock = deleg_rd_rwlock },
520 VOPNAME_SPACE, { .femop_space = deleg_rd_space },
521 VOPNAME_SETSECATTR, { .femop_setsecattr = deleg_rd_setsecattr },
522 VOPNAME_VNEVENT, { .femop_vnevent = deleg_rd_vnevent },
523 NULL, NULL
524 };
525 static const fs_operation_def_t nfs4_wr_deleg_tmpl[] = {
526 VOPNAME_OPEN, { .femop_open = deleg_wr_open },
527 VOPNAME_READ, { .femop_read = deleg_wr_read },
528 VOPNAME_WRITE, { .femop_write = deleg_wr_write },
529 VOPNAME_SETATTR, { .femop_setattr = deleg_wr_setattr },
530 VOPNAME_RWLOCK, { .femop_rwlock = deleg_wr_rwlock },
531 VOPNAME_SPACE, { .femop_space = deleg_wr_space },
532 VOPNAME_SETSECATTR, { .femop_setsecattr = deleg_wr_setsecattr },
533 VOPNAME_VNEVENT, { .femop_vnevent = deleg_wr_vnevent },
534 NULL, NULL
535 };
536
537 int
538 rfs4_srvrinit(void)
539 {
540 timespec32_t verf;
541 int error;
542 extern void rfs4_attr_init();
543 extern krwlock_t rfs4_deleg_policy_lock;
544
545 /*
546 * The following algorithm attempts to find a unique verifier
547 * to be used as the write verifier returned from the server
548 * to the client. It is important that this verifier change
549 * whenever the server reboots. Of secondary importance, it
550 * is important for the verifier to be unique between two
551 * different servers.
552 *
553 * Thus, an attempt is made to use the system hostid and the
554 * current time in seconds when the nfssrv kernel module is
|
496 "rfs4_op_setclient_confirm",
497 "rfs4_op_verify",
498 "rfs4_op_write",
499 "rfs4_op_release_lockowner",
500 "rfs4_op_illegal"
501 };
502 #endif
503
504 void rfs4_ss_chkclid(rfs4_client_t *);
505
506 extern size_t strlcpy(char *dst, const char *src, size_t dstsize);
507
508 extern void rfs4_free_fs_locations4(fs_locations4 *);
509
510 #ifdef nextdp
511 #undef nextdp
512 #endif
513 #define nextdp(dp) ((struct dirent64 *)((char *)(dp) + (dp)->d_reclen))
514
515 static const fs_operation_def_t nfs4_rd_deleg_tmpl[] = {
516 { VOPNAME_OPEN, { .femop_open = deleg_rd_open } },
517 { VOPNAME_WRITE, { .femop_write = deleg_rd_write } },
518 { VOPNAME_SETATTR, { .femop_setattr = deleg_rd_setattr } },
519 { VOPNAME_RWLOCK, { .femop_rwlock = deleg_rd_rwlock } },
520 { VOPNAME_SPACE, { .femop_space = deleg_rd_space } },
521 { VOPNAME_SETSECATTR, { .femop_setsecattr = deleg_rd_setsecattr } },
522 { VOPNAME_VNEVENT, { .femop_vnevent = deleg_rd_vnevent } },
523 { NULL, { NULL } }
524 };
525 static const fs_operation_def_t nfs4_wr_deleg_tmpl[] = {
526 { VOPNAME_OPEN, { .femop_open = deleg_wr_open } },
527 { VOPNAME_READ, { .femop_read = deleg_wr_read } },
528 { VOPNAME_WRITE, { .femop_write = deleg_wr_write } },
529 { VOPNAME_SETATTR, { .femop_setattr = deleg_wr_setattr } },
530 { VOPNAME_RWLOCK, { .femop_rwlock = deleg_wr_rwlock } },
531 { VOPNAME_SPACE, { .femop_space = deleg_wr_space } },
532 { VOPNAME_SETSECATTR, { .femop_setsecattr = deleg_wr_setsecattr } },
533 { VOPNAME_VNEVENT, { .femop_vnevent = deleg_wr_vnevent } },
534 { NULL, { NULL } }
535 };
536
537 int
538 rfs4_srvrinit(void)
539 {
540 timespec32_t verf;
541 int error;
542 extern void rfs4_attr_init();
543 extern krwlock_t rfs4_deleg_policy_lock;
544
545 /*
546 * The following algorithm attempts to find a unique verifier
547 * to be used as the write verifier returned from the server
548 * to the client. It is important that this verifier change
549 * whenever the server reboots. Of secondary importance, it
550 * is important for the verifier to be unique between two
551 * different servers.
552 *
553 * Thus, an attempt is made to use the system hostid and the
554 * current time in seconds when the nfssrv kernel module is
|