Lines Matching defs:fd

105 static int openStmf(int, int *fd);
106 static int openSbd(int, int *fd);
107 static int openPppt(int, int *fd);
108 static int groupIoctl(int fd, int cmd, stmfGroupName *);
109 static int loadStore(int fd);
111 static int groupMemberIoctl(int fd, int cmd, stmfGroupName *, stmfDevid *);
113 static int addViewEntryIoctl(int fd, stmfGuid *, stmfViewEntry *);
114 static int loadHostGroups(int fd, stmfGroupList *);
115 static int loadTargetGroups(int fd, stmfGroupList *);
117 static int setStmfState(int fd, stmf_state_desc_t *, int);
118 static int setProviderData(int fd, char *, nvlist_t *, int, uint64_t *);
141 static int removeViewEntryIoctl(int fd, stmfGuid *lu, uint32_t viewEntryIndex);
149 static int loadStmfProp(int fd);
160 * fd - pointer to integer. On success, contains the stmf file descriptor
163 openStmf(int flag, int *fd)
167 if ((*fd = open(STMF_PATH, O_NDELAY | O_RDONLY | flag)) != -1) {
188 * fd - pointer to integer. On success, contains the stmf file descriptor
191 openSbd(int flag, int *fd)
195 if ((*fd = open(SBD_PATH, O_NDELAY | O_RDONLY | flag)) != -1) {
216 * fd - pointer to integer. On success, contains the stmf file descriptor
219 openPppt(int flag, int *fd)
223 if ((*fd = open(PPPT_PATH, O_RDONLY | flag)) != -1) {
298 groupIoctl(int fd, int cmd, stmfGroupName *groupName)
318 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
423 groupListMemberIoctl(int fd, int cmd, stmfGroupList *groupList,
466 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
496 groupMemberIoctl(int fd, int cmd, stmfGroupName *groupName, stmfDevid *devid)
519 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
654 int fd;
671 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
674 if ((ret = groupMemberIoctl(fd, STMF_IOCTL_ADD_HG_ENTRY, hostGroupName,
713 (void) close(fd);
732 int ret, fd;
757 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
760 if ((ret = groupListMemberIoctl(fd, STMF_IOCTL_ADD_HG_LIST_ENTRY,
810 (void) groupMemberIoctl(fd, STMF_IOCTL_REMOVE_HG_ENTRY,
815 (void) close(fd);
831 int fd;
848 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
851 if ((ret = groupMemberIoctl(fd, STMF_IOCTL_ADD_TG_ENTRY,
890 (void) close(fd);
903 addViewEntryListIoctl(int fd, stmfGuid *lu, stmfViewEntryList *viewEntryList,
967 if ((tmpret = ioctl(fd, STMF_IOCTL_ADD_VIEW_LIST, &stmfIoctl)) == 0) {
1037 addViewEntryIoctl(int fd, stmfGuid *lu, stmfViewEntry *viewEntry)
1083 ioctlRet = ioctl(fd, STMF_IOCTL_ADD_VIEW_ENTRY, &stmfIoctl);
1160 int i, fd, tmpret, ret;
1201 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
1207 ret = addViewEntryListIoctl(fd, lu, viewEntryList, opData);
1257 tmpret = removeViewEntryIoctl(fd, lu,
1266 (void) close(fd);
1282 int fd;
1332 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
1338 ret = addViewEntryIoctl(fd, lu, &iViewEntry);
1376 (void) close(fd);
1400 int fd;
1424 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
1449 ioctlRet = ioctl(fd, STMF_IOCTL_CLEAR_PP_DATA, &stmfIoctl);
1502 (void) close(fd);
1517 int fd;
1539 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
1542 if ((ret = groupIoctl(fd, STMF_IOCTL_CREATE_HOST_GROUP,
1577 (void) close(fd);
1661 int fd = 0;
1672 if ((ret = openSbd(OPEN_SBD, &fd)) != STMF_STATUS_SUCCESS)
1679 (void) close(fd);
1823 ioctlRet = ioctl(fd, SBD_IOCTL_CREATE_AND_REGISTER_LU, &sbdIoctl);
1867 (void) close(fd);
1911 int fd = 0;
1927 if ((ret = openSbd(OPEN_SBD, &fd)) != STMF_STATUS_SUCCESS)
1940 (void) close(fd);
1960 ioctlRet = ioctl(fd, SBD_IOCTL_IMPORT_LU, &sbdIoctl);
2010 (void) close(fd);
2133 int fd;
2143 if ((ret = openSbd(OPEN_SBD, &fd)) != STMF_STATUS_SUCCESS)
2157 ioctlRet = ioctl(fd, SBD_IOCTL_DELETE_LU, &sbdIoctl);
2181 (void) close(fd);
2228 int fd = 0;
2233 if ((ret = openSbd(OPEN_SBD, &fd)) != STMF_STATUS_SUCCESS)
2242 ioctlRet = ioctl(fd, SBD_IOCTL_SET_LU_STANDBY, &sbdIoctl);
2264 (void) close(fd);
2392 int fd = 0;
2412 if ((ret = openSbd(OPEN_SBD, &fd)) != STMF_STATUS_SUCCESS)
2432 (void) close(fd);
2494 ioctlRet = ioctl(fd, SBD_IOCTL_MODIFY_LU, &sbdIoctl);
2523 (void) close(fd);
2745 int fd;
2758 if ((ret = openSbd(OPEN_SBD, &fd)) != STMF_STATUS_SUCCESS)
2764 (void) close(fd);
2771 (void) close(fd);
2779 (void) close(fd);
2794 ioctlRet = ioctl(fd, SBD_IOCTL_GET_LU_PROPS, &sbdIoctl);
2847 (void) close(fd);
2989 int fd;
3010 if ((ret = openSbd(OPEN_SBD, &fd)) != STMF_STATUS_SUCCESS)
3015 (void) close(fd);
3025 ioctlRet = ioctl(fd, SBD_IOCTL_GET_GLOBAL_LU, &sbdIoctl);
3092 (void) close(fd);
3131 int fd;
3148 if ((ret = openSbd(OPEN_SBD, &fd)) != STMF_STATUS_SUCCESS)
3161 (void) close(fd);
3182 ioctlRet = ioctl(fd, SBD_IOCTL_SET_GLOBAL_LU, &sbdIoctl);
3207 (void) close(fd);
3801 int fd;
3823 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
3829 if ((ret = groupIoctl(fd, STMF_IOCTL_CREATE_TARGET_GROUP,
3868 (void) close(fd);
3883 int fd;
3903 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
3909 if ((ret = groupIoctl(fd, STMF_IOCTL_REMOVE_HOST_GROUP,
3948 (void) close(fd);
3963 int fd;
3983 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
3989 if ((ret = groupIoctl(fd, STMF_IOCTL_REMOVE_TARGET_GROUP,
4028 (void) close(fd);
4047 int fd;
4060 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS) {
4080 ioctlRet = ioctl(fd, STMF_IOCTL_CHECK_TARGET_GROUP_INUSE, &stmfIoctl);
4105 (void) close(fd);
4123 int fd;
4136 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS) {
4156 ioctlRet = ioctl(fd, STMF_IOCTL_CHECK_HOST_GROUP_INUSE, &stmfIoctl);
4181 (void) close(fd);
4269 int fd;
4299 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
4320 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
4352 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
4388 (void) close(fd);
4404 int fd;
4435 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
4464 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
4498 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
4537 (void) close(fd);
4785 int fd;
4807 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
4835 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
4868 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
4919 (void) close(fd);
4981 int fd;
5002 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
5023 ioctlRet = ioctl(fd, STMF_IOCTL_TARGET_PORT_LIST, &stmfIoctl);
5055 ioctlRet = ioctl(fd, STMF_IOCTL_TARGET_PORT_LIST,
5095 (void) close(fd);
5114 int fd;
5133 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
5149 ioctlRet = ioctl(fd, STMF_IOCTL_GET_TARGET_PORT_PROPERTIES,
5191 (void) close(fd);
5208 int fd;
5230 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
5251 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
5284 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
5336 (void) close(fd);
5358 int fd;
5380 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
5392 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
5441 (void) close(fd);
5584 int fd;
5606 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
5629 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
5662 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
5731 (void) close(fd);
5799 int fd, ret, ioctlRet;
5815 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
5840 ioctlRet = ioctl(fd, STMF_IOCTL_GET_LU_NBR_LIST, &stmfIoctl);
5878 (void) close(fd);
5994 int fd;
6017 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
6040 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
6072 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
6147 (void) close(fd);
6177 * fd - file descriptor for the control node of stmf.
6181 loadHostGroups(int fd, stmfGroupList *groupList)
6190 if ((ret = groupIoctl(fd, STMF_IOCTL_CREATE_HOST_GROUP,
6208 if ((ret = groupListMemberIoctl(fd,
6229 * fd - file descriptor for the control node of stmf.
6233 loadTargetGroups(int fd, stmfGroupList *groupList)
6240 if ((ret = groupIoctl(fd, STMF_IOCTL_CREATE_TARGET_GROUP,
6247 if ((ret = groupMemberIoctl(fd, STMF_IOCTL_ADD_TG_ENTRY,
6269 * fd - file descriptor of control node for stmf.
6272 loadStore(int fd)
6290 ret = loadHostGroups(fd, groupList);
6305 ret = loadTargetGroups(fd, groupList);
6374 ret = addViewEntryListIoctl(fd, &guidList->guid[i],
6442 ret = setProviderData(fd, providerList->provider[i].name, nvl,
6502 int fd;
6514 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
6523 ioctlRet = ioctl(fd, STMF_IOCTL_GET_ALUA_STATE, &stmfIoctl);
6525 (void) close(fd);
6564 int fd;
6582 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
6591 ioctlRet = ioctl(fd, STMF_IOCTL_SET_ALUA_STATE, &stmfIoctl);
6593 (void) close(fd);
6668 int fd;
6675 if ((ret = openStmf(OPEN_EXCL_STMF, &fd))
6708 if ((ret = openStmf(OPEN_EXCL_STMF, &fd)) != STMF_STATUS_SUCCESS)
6711 ret = setStmfState(fd, &stmfStateSet, STMF_SERVICE_TYPE);
6717 ret = loadStore(fd);
6727 ret = setStmfState(fd, &stmfStateSet, STMF_SERVICE_TYPE);
6729 (void) close(fd);
6744 int fd;
6751 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
6763 ioctlRet = ioctl(fd, STMF_IOCTL_GET_STMF_STATE, &stmfIoctl);
6765 (void) close(fd);
6797 setStmfState(int fd, stmf_state_desc_t *stmfState, int objectType)
6826 ioctlRet = ioctl(fd, cmd, &stmfIoctl);
6977 loadStmfProp(int fd)
7001 ioctlRet = ioctl(fd, STMF_IOCTL_SET_STMF_PROPS,
7035 int fd;
7037 if ((ret = openStmf(OPEN_EXCL_STMF, &fd))
7041 ret = loadStmfProp(fd);
7043 (void) close(fd);
7062 int fd;
7080 if ((ret = openStmf(OPEN_EXCL_STMF, &fd)) != STMF_STATUS_SUCCESS)
7082 ret = setStmfState(fd, &iState, STMF_SERVICE_TYPE);
7083 (void) close(fd);
7097 int fd;
7116 if ((ret = openStmf(OPEN_EXCL_STMF, &fd)) != STMF_STATUS_SUCCESS)
7118 ret = setStmfState(fd, &iState, STMF_SERVICE_TYPE);
7119 (void) close(fd);
7136 int fd;
7151 if ((ret = openStmf(OPEN_EXCL_STMF, &fd)) != STMF_STATUS_SUCCESS)
7153 ret = setStmfState(fd, &targetState, TARGET_TYPE);
7154 (void) close(fd);
7170 int fd;
7184 if ((ret = openStmf(OPEN_EXCL_STMF, &fd)) != STMF_STATUS_SUCCESS)
7186 ret = setStmfState(fd, &luState, LOGICAL_UNIT_TYPE);
7187 (void) close(fd);
7203 int fd;
7218 if ((ret = openStmf(OPEN_EXCL_STMF, &fd)) != STMF_STATUS_SUCCESS)
7220 ret = setStmfState(fd, &targetState, TARGET_TYPE);
7221 (void) close(fd);
7237 int fd;
7251 if ((ret = openStmf(OPEN_EXCL_STMF, &fd)) != STMF_STATUS_SUCCESS)
7253 ret = setStmfState(fd, &luState, LOGICAL_UNIT_TYPE);
7254 (void) close(fd);
7270 int fd;
7287 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
7290 if ((ret = groupMemberIoctl(fd, STMF_IOCTL_REMOVE_HG_ENTRY,
7329 (void) close(fd);
7345 int fd;
7362 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
7365 if ((ret = groupMemberIoctl(fd, STMF_IOCTL_REMOVE_TG_ENTRY,
7404 (void) close(fd);
7408 removeViewEntryIoctl(int fd, stmfGuid *lu, uint32_t viewEntryIndex)
7426 ioctlRet = ioctl(fd, STMF_IOCTL_REMOVE_VIEW_ENTRY, &stmfIoctl);
7473 int fd;
7488 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
7494 ret = removeViewEntryIoctl(fd, lu, viewEntryIndex);
7523 (void) close(fd);
7563 int fd;
7583 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
7586 ret = setProviderData(fd, providerName, nvl, providerType, setToken);
7588 (void) close(fd);
7646 int fd;
7662 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
7705 ioctlRet = ioctl(fd, STMF_IOCTL_GET_PP_DATA, &stmfIoctl);
7764 (void) close(fd);
7779 setProviderData(int fd, char *providerName, nvlist_t *nvl, int providerType,
7845 ioctlRet = ioctl(fd, STMF_IOCTL_LOAD_PP_DATA, &stmfIoctl);
8017 * fd - door from door_create()
8024 int fd;
8034 if ((ret = openPppt(OPEN_PPPT, &fd)) != STMF_STATUS_SUCCESS) {
8043 ioctlRet = ioctl(fd, PPPT_INSTALL_DOOR, &ppptIoctl);
8062 /* return driver fd to caller */
8063 *hdl = fd;
8081 validateLunNumIoctl(int fd, stmfViewEntry *viewEntry)
8125 ioctlRet = ioctl(fd, STMF_IOCTL_VALIDATE_VIEW, &stmfIoctl);
8192 int fd;
8242 if ((ret = openStmf(OPEN_STMF, &fd)) != STMF_STATUS_SUCCESS)
8248 ret = validateLunNumIoctl(fd, &iViewEntry);
8249 (void) close(fd);