geom_util.c (f805f204b63aaab5b49c7371deb8c2fd015bd894) geom_util.c (35daa28f3031346789031e54a5ab494452634cfc)
1/*-
2 * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 100 unchanged lines hidden (view full) ---

109 u_int sectorsize;
110
111 if (g_ioctl_arg(fd, DIOCGSECTORSIZE, &sectorsize) == -1)
112 return (-1);
113 return ((ssize_t)sectorsize);
114}
115
116/*
1/*-
2 * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 100 unchanged lines hidden (view full) ---

109 u_int sectorsize;
110
111 if (g_ioctl_arg(fd, DIOCGSECTORSIZE, &sectorsize) == -1)
112 return (-1);
113 return ((ssize_t)sectorsize);
114}
115
116/*
117 * Return stripe size of the given provider.
118 */
119off_t
120g_stripesize(int fd)
121{
122 off_t stripesize;
123
124 if (g_ioctl_arg(fd, DIOCGSTRIPESIZE, &stripesize) == -1)
125 return (-1);
126 return (stripesize);
127}
128
129/*
130 * Return stripe size of the given provider.
131 */
132off_t
133g_stripeoffset(int fd)
134{
135 off_t stripeoffset;
136
137 if (g_ioctl_arg(fd, DIOCGSTRIPEOFFSET, &stripeoffset) == -1)
138 return (-1);
139 return (stripeoffset);
140}
141
142/*
117 * Return the correct provider name.
118 */
119char *
120g_providername(int fd)
121{
122 char name[MAXPATHLEN];
123
124 if (g_ioctl_arg(fd, DIOCGPROVIDERNAME, name) == -1)

--- 192 unchanged lines hidden ---
143 * Return the correct provider name.
144 */
145char *
146g_providername(int fd)
147{
148 char name[MAXPATHLEN];
149
150 if (g_ioctl_arg(fd, DIOCGPROVIDERNAME, name) == -1)

--- 192 unchanged lines hidden ---