Lines Matching defs:dfstab

30  * and file systems to be exported. This includes legacy dfstab/sharetab
154 * Look at the beginning of the current /etc/dfs/dfstab file and add
165 /* zero length dfstab */
195 * Returns an zfs_sharelist_t list of lines from the dfstab file
198 * dfstab file.
330 * remove it from dfstab when the file is rewritten.
400 * Add an entry to the dfstab list for share (relative to proto). This
401 * is used to update dfstab for legacy purposes.
446 * outdfstab(dfstab, list)
448 * Output the list to dfstab making sure the file is truncated.
453 outdfstab(FILE *dfstab, xfs_sharelist_t *list)
457 (void) ftruncate(fileno(dfstab), 0);
462 (void) fprintf(dfstab,
482 (void) fprintf(dfstab, "%s", item->origline);
486 (void) fprintf(dfstab, "%s", item->description);
488 (void) fprintf(dfstab, "%s", item->origline);
496 * Open the specified dfstab file. If the owner/group/perms are wrong,
507 FILE *dfstab;
509 dfstab = fopen(file, "r+");
510 if (dfstab == NULL) {
511 dfstab = fopen(file, "w+");
513 if (dfstab != NULL) {
521 (void) fchmod(fileno(dfstab), 0644);
522 (void) fchown(fileno(dfstab), 0,
526 rewind(dfstab);
528 return (dfstab);
534 * Add a comment to the dfstab file with err as a prefix to the
541 FILE *dfstab;
545 dfstab = open_dfstab(SA_LEGACY_DFSTAB);
546 if (dfstab != NULL) {
547 (void) setvbuf(dfstab, NULL, _IOLBF, BUFSIZ * 8);
549 (void) lockf(fileno(dfstab), F_LOCK, 0);
551 list = getdfstab(dfstab);
552 rewind(dfstab);
558 outdfstab(dfstab, list);
559 (void) fprintf(dfstab, "# Error: %s: %s", err, line);
560 (void) fsync(fileno(dfstab));
562 (void) lockf(fileno(dfstab), F_ULOCK, 0);
563 (void) fclose(dfstab);
579 FILE *dfstab;
596 dfstab = open_dfstab(SA_LEGACY_DFSTAB);
597 if (dfstab != NULL) {
598 (void) setvbuf(dfstab, NULL, _IOLBF, BUFSIZ * 8);
602 (void) lockf(fileno(dfstab), F_LOCK, 0);
604 list = getdfstab(dfstab);
605 rewind(dfstab);
624 * may want to only do the dfstab if
638 outdfstab(dfstab, list);
641 (void) fflush(dfstab);
643 (void) lockf(fileno(dfstab), F_ULOCK, 0);
645 (void) fsync(fileno(dfstab));
647 (void) fclose(dfstab);
664 * There is an assumption that dfstab will be the most common form of
666 * of that, dfstab handling is done in the main code with calls to
668 * options into dfstab/share compatible syntax. Since not everything
669 * will be dfstab, there is a provision for calling a protocol
671 * own legacy files and skip the dfstab update.
677 FILE *dfstab;
693 /* do the dfstab format */
705 dfstab = open_dfstab(SA_LEGACY_DFSTAB);
706 if (dfstab != NULL) {
707 (void) setvbuf(dfstab, NULL, _IOLBF, BUFSIZ * 8);
709 (void) lockf(fileno(dfstab), F_LOCK, 0);
711 list = getdfstab(dfstab);
712 rewind(dfstab);
716 outdfstab(dfstab, list);
717 (void) fflush(dfstab);
719 (void) lockf(fileno(dfstab), F_ULOCK, 0);
720 (void) fsync(fileno(dfstab));
722 (void) fclose(dfstab);
759 * todfstab is set, write it back to the dfstab file as well.
898 * /etc/dfs/dfstab). This adds a new optionset to the group (or
1089 * parse_dfstab(dfstab, root)
1091 * Open and read the existing dfstab, parsing each line and adding it
1097 parse_dfstab(sa_handle_t handle, char *dfstab, xmlNodePtr root)
1109 /* read the dfstab format file and fill in the doc tree */
1111 dfs = fopen(dfstab, "r");
1164 "No share specified in dfstab: "
1179 "Unknown group used in dfstab: line %d: %s\n"),
1212 "Error in dfstab: line %d: %s\n"),
1227 "dfstab: line %d: %s\n"),
1280 * a legacy app or the admin modified the dfstab file directly. We
1291 FILE *dfstab;
1293 dfstab = fopen(file, "r");
1294 if (dfstab != NULL) {
1295 list = getdfstab(dfstab);
1296 (void) fclose(dfstab);
1301 /* now see if the share is in the dfstab file */
1325 * Parse dfstab and build the legacy configuration. This only gets
1343 * code add/del via dfstab and we need to
1349 /* Parse the dfstab and add anything new */
1632 * in dfstab and sharetab