inet6: Add missing ifioctl credential checks
[dragonfly.git] / sys / vfs / hammer2 / hammer2_ioctl.c
CommitLineData
2910a90c 1/*
0dea3156 2 * Copyright (c) 2011-2013 The DragonFly Project. All rights reserved.
2910a90c
MD
3 *
4 * This code is derived from software contributed to The DragonFly Project
5 * by Matthew Dillon <dillon@dragonflybsd.org>
6 * by Venkatesh Srinivas <vsrinivas@dragonflybsd.org>
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
17 * distribution.
18 * 3. Neither the name of The DragonFly Project nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific, prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
30 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 */
35/*
36 * Ioctl Functions.
37 *
38 * WARNING! The ioctl functions which manipulate the connection state need
39 * to be able to run without deadlock on the volume's chain lock.
40 * Most of these functions use a separate lock.
41 */
42
43#include "hammer2.h"
44
ae183399 45static int hammer2_ioctl_version_get(hammer2_inode_t *ip, void *data);
1a34728c
MD
46static int hammer2_ioctl_recluster(hammer2_inode_t *ip, void *data);
47static int hammer2_ioctl_remote_scan(hammer2_inode_t *ip, void *data);
ae183399
MD
48static int hammer2_ioctl_remote_add(hammer2_inode_t *ip, void *data);
49static int hammer2_ioctl_remote_del(hammer2_inode_t *ip, void *data);
50static int hammer2_ioctl_remote_rep(hammer2_inode_t *ip, void *data);
51static int hammer2_ioctl_socket_get(hammer2_inode_t *ip, void *data);
52static int hammer2_ioctl_socket_set(hammer2_inode_t *ip, void *data);
53static int hammer2_ioctl_pfs_get(hammer2_inode_t *ip, void *data);
458ecb1b 54static int hammer2_ioctl_pfs_lookup(hammer2_inode_t *ip, void *data);
ae183399 55static int hammer2_ioctl_pfs_create(hammer2_inode_t *ip, void *data);
a864c5d9 56static int hammer2_ioctl_pfs_snapshot(hammer2_inode_t *ip, void *data);
ae183399 57static int hammer2_ioctl_pfs_delete(hammer2_inode_t *ip, void *data);
344d4f82
MD
58static int hammer2_ioctl_inode_get(hammer2_inode_t *ip, void *data);
59static int hammer2_ioctl_inode_set(hammer2_inode_t *ip, void *data);
2910a90c
MD
60
61int
62hammer2_ioctl(hammer2_inode_t *ip, u_long com, void *data, int fflag,
63 struct ucred *cred)
64{
65 int error;
66
67 /*
68 * Standard root cred checks, will be selectively ignored below
69 * for ioctls that do not require root creds.
70 */
71 error = priv_check_cred(cred, PRIV_HAMMER_IOCTL, 0);
72
73 switch(com) {
ae183399
MD
74 case HAMMER2IOC_VERSION_GET:
75 error = hammer2_ioctl_version_get(ip, data);
2910a90c 76 break;
1a34728c 77 case HAMMER2IOC_RECLUSTER:
2910a90c 78 if (error == 0)
1a34728c
MD
79 error = hammer2_ioctl_recluster(ip, data);
80 break;
81 case HAMMER2IOC_REMOTE_SCAN:
82 if (error == 0)
83 error = hammer2_ioctl_remote_scan(ip, data);
2910a90c 84 break;
ae183399 85 case HAMMER2IOC_REMOTE_ADD:
2910a90c 86 if (error == 0)
ae183399 87 error = hammer2_ioctl_remote_add(ip, data);
2910a90c 88 break;
ae183399 89 case HAMMER2IOC_REMOTE_DEL:
2910a90c 90 if (error == 0)
ae183399 91 error = hammer2_ioctl_remote_del(ip, data);
2910a90c 92 break;
ae183399 93 case HAMMER2IOC_REMOTE_REP:
2910a90c 94 if (error == 0)
ae183399 95 error = hammer2_ioctl_remote_rep(ip, data);
2910a90c 96 break;
ae183399 97 case HAMMER2IOC_SOCKET_GET:
2910a90c 98 if (error == 0)
ae183399 99 error = hammer2_ioctl_socket_get(ip, data);
2910a90c 100 break;
ae183399
MD
101 case HAMMER2IOC_SOCKET_SET:
102 if (error == 0)
103 error = hammer2_ioctl_socket_set(ip, data);
104 break;
105 case HAMMER2IOC_PFS_GET:
2910a90c 106 if (error == 0)
ae183399
MD
107 error = hammer2_ioctl_pfs_get(ip, data);
108 break;
458ecb1b
MD
109 case HAMMER2IOC_PFS_LOOKUP:
110 if (error == 0)
111 error = hammer2_ioctl_pfs_lookup(ip, data);
112 break;
ae183399
MD
113 case HAMMER2IOC_PFS_CREATE:
114 if (error == 0)
115 error = hammer2_ioctl_pfs_create(ip, data);
116 break;
117 case HAMMER2IOC_PFS_DELETE:
118 if (error == 0)
119 error = hammer2_ioctl_pfs_delete(ip, data);
2910a90c 120 break;
a864c5d9
MD
121 case HAMMER2IOC_PFS_SNAPSHOT:
122 if (error == 0)
123 error = hammer2_ioctl_pfs_snapshot(ip, data);
124 break;
344d4f82
MD
125 case HAMMER2IOC_INODE_GET:
126 error = hammer2_ioctl_inode_get(ip, data);
127 break;
128 case HAMMER2IOC_INODE_SET:
129 if (error == 0)
130 error = hammer2_ioctl_inode_set(ip, data);
131 break;
2910a90c
MD
132 default:
133 error = EOPNOTSUPP;
134 break;
135 }
136 return (error);
137}
138
139/*
140 * Retrieve version and basic info
141 */
142static int
ae183399 143hammer2_ioctl_version_get(hammer2_inode_t *ip, void *data)
2910a90c 144{
a5913bdf 145 hammer2_mount_t *hmp = ip->pmp->mount_cluster->hmp;
2910a90c
MD
146 hammer2_ioc_version_t *version = data;
147
148 version->version = hmp->voldata.version;
149 return 0;
150}
151
1a34728c
MD
152static int
153hammer2_ioctl_recluster(hammer2_inode_t *ip, void *data)
154{
155 hammer2_ioc_recluster_t *recl = data;
156 struct file *fp;
157
158 fp = holdfp(curproc->p_fd, recl->fd, -1);
159 if (fp) {
160 kprintf("reconnect to cluster\n");
161 hammer2_cluster_reconnect(ip->pmp, fp);
162 return 0;
163 } else {
164 return EINVAL;
165 }
166}
167
2910a90c
MD
168/*
169 * Retrieve information about a remote
170 */
171static int
1a34728c 172hammer2_ioctl_remote_scan(hammer2_inode_t *ip, void *data)
2910a90c 173{
a5913bdf 174 hammer2_mount_t *hmp = ip->pmp->mount_cluster->hmp;
2910a90c
MD
175 hammer2_ioc_remote_t *remote = data;
176 int copyid = remote->copyid;
177
178 if (copyid < 0 || copyid >= HAMMER2_COPYID_COUNT)
179 return (EINVAL);
180
181 hammer2_voldata_lock(hmp);
182 remote->copy1 = hmp->voldata.copyinfo[copyid];
0dea3156 183 hammer2_voldata_unlock(hmp, 0);
2910a90c
MD
184
185 /*
186 * Adjust nextid (GET only)
187 */
188 while (++copyid < HAMMER2_COPYID_COUNT &&
189 hmp->voldata.copyinfo[copyid].copyid == 0) {
1a34728c 190 ;
2910a90c
MD
191 }
192 if (copyid == HAMMER2_COPYID_COUNT)
193 remote->nextid = -1;
194 else
195 remote->nextid = copyid;
196
197 return(0);
198}
199
200/*
201 * Add new remote entry
202 */
203static int
ae183399 204hammer2_ioctl_remote_add(hammer2_inode_t *ip, void *data)
2910a90c 205{
2910a90c 206 hammer2_ioc_remote_t *remote = data;
a5913bdf
MD
207 hammer2_pfsmount_t *pmp = ip->pmp;
208 hammer2_mount_t *hmp;
2910a90c
MD
209 int copyid = remote->copyid;
210 int error = 0;
211
212 if (copyid >= HAMMER2_COPYID_COUNT)
213 return (EINVAL);
214
a5913bdf 215 hmp = pmp->mount_cluster->hmp;
2910a90c
MD
216 hammer2_voldata_lock(hmp);
217 if (copyid < 0) {
218 for (copyid = 1; copyid < HAMMER2_COPYID_COUNT; ++copyid) {
219 if (hmp->voldata.copyinfo[copyid].copyid == 0)
220 break;
221 }
222 if (copyid == HAMMER2_COPYID_COUNT) {
223 error = ENOSPC;
224 goto failed;
225 }
226 }
227 hammer2_modify_volume(hmp);
2910a90c
MD
228 remote->copy1.copyid = copyid;
229 hmp->voldata.copyinfo[copyid] = remote->copy1;
1a34728c 230 hammer2_volconf_update(pmp, copyid);
2910a90c 231failed:
0dea3156 232 hammer2_voldata_unlock(hmp, 1);
2910a90c
MD
233 return (error);
234}
235
236/*
237 * Delete existing remote entry
238 */
239static int
ae183399 240hammer2_ioctl_remote_del(hammer2_inode_t *ip, void *data)
2910a90c 241{
2910a90c 242 hammer2_ioc_remote_t *remote = data;
a5913bdf
MD
243 hammer2_pfsmount_t *pmp = ip->pmp;
244 hammer2_mount_t *hmp;
2910a90c
MD
245 int copyid = remote->copyid;
246 int error = 0;
247
a5913bdf 248 hmp = pmp->mount_cluster->hmp;
2910a90c
MD
249 if (copyid >= HAMMER2_COPYID_COUNT)
250 return (EINVAL);
251 remote->copy1.path[sizeof(remote->copy1.path) - 1] = 0;
252 hammer2_voldata_lock(hmp);
253 if (copyid < 0) {
254 for (copyid = 1; copyid < HAMMER2_COPYID_COUNT; ++copyid) {
255 if (hmp->voldata.copyinfo[copyid].copyid == 0)
256 continue;
257 if (strcmp(remote->copy1.path,
258 hmp->voldata.copyinfo[copyid].path) == 0) {
259 break;
260 }
261 }
262 if (copyid == HAMMER2_COPYID_COUNT) {
263 error = ENOENT;
264 goto failed;
265 }
266 }
267 hammer2_modify_volume(hmp);
268 hmp->voldata.copyinfo[copyid].copyid = 0;
1a34728c 269 hammer2_volconf_update(pmp, copyid);
2910a90c 270failed:
0dea3156 271 hammer2_voldata_unlock(hmp, 1);
2910a90c
MD
272 return (error);
273}
274
275/*
276 * Replace existing remote entry
277 */
278static int
ae183399 279hammer2_ioctl_remote_rep(hammer2_inode_t *ip, void *data)
2910a90c 280{
2910a90c 281 hammer2_ioc_remote_t *remote = data;
a5913bdf 282 hammer2_mount_t *hmp;
2910a90c
MD
283 int copyid = remote->copyid;
284
a5913bdf
MD
285 hmp = ip->pmp->mount_cluster->hmp;
286
2910a90c
MD
287 if (copyid < 0 || copyid >= HAMMER2_COPYID_COUNT)
288 return (EINVAL);
289
290 hammer2_voldata_lock(hmp);
1a34728c 291 /*hammer2_volconf_update(pmp, copyid);*/
0dea3156 292 hammer2_voldata_unlock(hmp, 1);
2910a90c
MD
293
294 return(0);
295}
296
297/*
298 * Retrieve communications socket
299 */
300static int
ae183399 301hammer2_ioctl_socket_get(hammer2_inode_t *ip, void *data)
2910a90c
MD
302{
303 return (EOPNOTSUPP);
304}
305
306/*
307 * Set communications socket for connection
308 */
309static int
ae183399 310hammer2_ioctl_socket_set(hammer2_inode_t *ip, void *data)
2910a90c 311{
2910a90c 312 hammer2_ioc_remote_t *remote = data;
a5913bdf 313 hammer2_mount_t *hmp;
2910a90c
MD
314 int copyid = remote->copyid;
315
a5913bdf 316 hmp = ip->pmp->mount_cluster->hmp;
2910a90c
MD
317 if (copyid < 0 || copyid >= HAMMER2_COPYID_COUNT)
318 return (EINVAL);
319
320 hammer2_voldata_lock(hmp);
0dea3156 321 hammer2_voldata_unlock(hmp, 0);
2910a90c
MD
322
323 return(0);
324}
ae183399
MD
325
326/*
a864c5d9
MD
327 * Used to scan and retrieve PFS information. PFS's are directories under
328 * the super-root.
329 *
330 * To scan PFSs pass name_key=0. The function will scan for the next
331 * PFS and set all fields, as well as set name_next to the next key.
332 * When no PFSs remain, name_next is set to (hammer2_key_t)-1.
333 *
334 * To retrieve the PFS associated with the file descriptor, pass
335 * name_key set to (hammer2_key_t)-1.
ae183399
MD
336 */
337static int
338hammer2_ioctl_pfs_get(hammer2_inode_t *ip, void *data)
339{
476d2aad
MD
340 hammer2_inode_data_t *ipdata;
341 hammer2_mount_t *hmp;
342 hammer2_ioc_pfs_t *pfs;
ae183399
MD
343 hammer2_chain_t *parent;
344 hammer2_chain_t *chain;
a864c5d9 345 hammer2_chain_t *rchain;
476d2aad 346 int error;
ae183399 347
476d2aad 348 error = 0;
a5913bdf 349 hmp = ip->pmp->mount_cluster->hmp;
476d2aad 350 pfs = data;
0dea3156 351 parent = hammer2_chain_lookup_init(hmp->schain, 0);
a5913bdf 352 rchain = ip->pmp->mount_cluster->rchain;
ae183399
MD
353
354 /*
355 * Search for the first key or specific key. Remember that keys
356 * can be returned in any order.
357 */
358 if (pfs->name_key == 0) {
0dea3156 359 chain = hammer2_chain_lookup(&parent,
ae183399 360 0, (hammer2_key_t)-1, 0);
a864c5d9
MD
361 } else if (pfs->name_key == (hammer2_key_t)-1) {
362 chain = hammer2_chain_lookup(&parent,
363 rchain->data->ipdata.name_key,
364 rchain->data->ipdata.name_key,
365 0);
ae183399 366 } else {
0dea3156 367 chain = hammer2_chain_lookup(&parent,
ae183399
MD
368 pfs->name_key, pfs->name_key, 0);
369 }
370 while (chain && chain->bref.type != HAMMER2_BREF_TYPE_INODE) {
0dea3156
MD
371 chain = hammer2_chain_next(&parent, chain,
372 0, (hammer2_key_t)-1, 0);
ae183399
MD
373 }
374 if (chain) {
375 /*
376 * Load the data being returned by the ioctl.
377 */
476d2aad
MD
378 ipdata = &chain->data->ipdata;
379 pfs->name_key = ipdata->name_key;
380 pfs->pfs_type = ipdata->pfs_type;
381 pfs->pfs_clid = ipdata->pfs_clid;
382 pfs->pfs_fsid = ipdata->pfs_fsid;
383 KKASSERT(ipdata->name_len < sizeof(pfs->name));
384 bcopy(ipdata->filename, pfs->name, ipdata->name_len);
385 pfs->name[ipdata->name_len] = 0;
386 ipdata = NULL; /* safety */
ae183399
MD
387
388 /*
389 * Calculate the next field
390 */
391 do {
0dea3156
MD
392 chain = hammer2_chain_next(&parent, chain,
393 0, (hammer2_key_t)-1, 0);
ae183399
MD
394 } while (chain && chain->bref.type != HAMMER2_BREF_TYPE_INODE);
395 if (chain) {
476d2aad 396 pfs->name_next = chain->data->ipdata.name_key;
0dea3156 397 hammer2_chain_unlock(chain);
ae183399
MD
398 } else {
399 pfs->name_next = (hammer2_key_t)-1;
400 }
401 } else {
402 pfs->name_next = (hammer2_key_t)-1;
403 error = ENOENT;
404 }
0dea3156
MD
405 hammer2_chain_lookup_done(parent);
406
ae183399
MD
407 return (error);
408}
409
458ecb1b
MD
410/*
411 * Find a specific PFS by name
412 */
413static int
414hammer2_ioctl_pfs_lookup(hammer2_inode_t *ip, void *data)
415{
476d2aad
MD
416 hammer2_inode_data_t *ipdata;
417 hammer2_mount_t *hmp;
418 hammer2_ioc_pfs_t *pfs;
458ecb1b
MD
419 hammer2_chain_t *parent;
420 hammer2_chain_t *chain;
458ecb1b 421 hammer2_key_t lhc;
476d2aad 422 int error;
458ecb1b
MD
423 size_t len;
424
476d2aad 425 error = 0;
a5913bdf 426 hmp = ip->pmp->mount_cluster->hmp;
476d2aad 427 pfs = data;
0dea3156 428 parent = hammer2_chain_lookup_init(hmp->schain, HAMMER2_LOOKUP_SHARED);
458ecb1b
MD
429
430 pfs->name[sizeof(pfs->name) - 1] = 0;
431 len = strlen(pfs->name);
432 lhc = hammer2_dirhash(pfs->name, len);
433
0dea3156 434 chain = hammer2_chain_lookup(&parent,
458ecb1b
MD
435 lhc, lhc + HAMMER2_DIRHASH_LOMASK,
436 HAMMER2_LOOKUP_SHARED);
437 while (chain) {
438 if (chain->bref.type == HAMMER2_BREF_TYPE_INODE &&
458ecb1b
MD
439 len == chain->data->ipdata.name_len &&
440 bcmp(pfs->name, chain->data->ipdata.filename, len) == 0) {
441 break;
442 }
0dea3156 443 chain = hammer2_chain_next(&parent, chain,
458ecb1b
MD
444 lhc, lhc + HAMMER2_DIRHASH_LOMASK,
445 HAMMER2_LOOKUP_SHARED);
446 }
447
448 /*
449 * Load the data being returned by the ioctl.
450 */
451 if (chain) {
476d2aad
MD
452 ipdata = &chain->data->ipdata;
453 pfs->name_key = ipdata->name_key;
454 pfs->pfs_type = ipdata->pfs_type;
455 pfs->pfs_clid = ipdata->pfs_clid;
456 pfs->pfs_fsid = ipdata->pfs_fsid;
457 ipdata = NULL;
458ecb1b 458
0dea3156 459 hammer2_chain_unlock(chain);
458ecb1b
MD
460 } else {
461 error = ENOENT;
462 }
0dea3156 463 hammer2_chain_lookup_done(parent);
458ecb1b
MD
464 return (error);
465}
466
ae183399
MD
467/*
468 * Create a new PFS under the super-root
469 */
470static int
471hammer2_ioctl_pfs_create(hammer2_inode_t *ip, void *data)
472{
476d2aad
MD
473 hammer2_inode_data_t *nipdata;
474 hammer2_mount_t *hmp;
475 hammer2_ioc_pfs_t *pfs;
476 hammer2_inode_t *nip;
9596b8c4 477 hammer2_chain_t *nchain;
0dea3156 478 hammer2_trans_t trans;
ae183399
MD
479 int error;
480
a5913bdf 481 hmp = ip->pmp->mount_cluster->hmp;
476d2aad
MD
482 pfs = data;
483 nip = NULL;
484
a864c5d9
MD
485 if (pfs->name[0] == 0)
486 return(EINVAL);
ae183399 487 pfs->name[sizeof(pfs->name) - 1] = 0; /* ensure 0-termination */
10252dc7 488
a5913bdf 489 hammer2_trans_init(&trans, ip->pmp, 0);
0dea3156 490 nip = hammer2_inode_create(&trans, hmp->sroot, NULL, NULL,
ae183399 491 pfs->name, strlen(pfs->name),
9596b8c4 492 &nchain, &error);
ae183399 493 if (error == 0) {
9596b8c4 494 nipdata = hammer2_chain_modify_ip(&trans, nip, &nchain,
4a59bd3e 495 HAMMER2_MODIFY_ASSERTNOCOPY);
476d2aad
MD
496 nipdata->pfs_type = pfs->pfs_type;
497 nipdata->pfs_clid = pfs->pfs_clid;
498 nipdata->pfs_fsid = pfs->pfs_fsid;
9596b8c4 499 hammer2_inode_unlock_ex(nip, nchain);
ae183399 500 }
0dea3156 501 hammer2_trans_done(&trans);
ae183399
MD
502 return (error);
503}
504
505/*
506 * Destroy an existing PFS under the super-root
507 */
508static int
509hammer2_ioctl_pfs_delete(hammer2_inode_t *ip, void *data)
510{
a5913bdf 511 hammer2_mount_t *hmp;
ae183399 512 hammer2_ioc_pfs_t *pfs = data;
0dea3156 513 hammer2_trans_t trans;
ae183399
MD
514 int error;
515
a5913bdf
MD
516 hmp = ip->pmp->mount_cluster->hmp;
517 hammer2_trans_init(&trans, ip->pmp, 0);
0dea3156 518 error = hammer2_unlink_file(&trans, hmp->sroot,
9797e933 519 pfs->name, strlen(pfs->name),
a864c5d9
MD
520 2, NULL);
521 hammer2_trans_done(&trans);
522
523 return (error);
524}
525
526static int
527hammer2_ioctl_pfs_snapshot(hammer2_inode_t *ip, void *data)
528{
a864c5d9
MD
529 hammer2_ioc_pfs_t *pfs = data;
530 hammer2_trans_t trans;
9596b8c4 531 hammer2_chain_t *parent;
a864c5d9
MD
532 int error;
533
534 if (pfs->name[0] == 0)
535 return(EINVAL);
536 if (pfs->name[sizeof(pfs->name)-1] != 0)
537 return(EINVAL);
538
a5913bdf 539 hammer2_trans_init(&trans, ip->pmp, 0);
9596b8c4 540 parent = hammer2_inode_lock_ex(ip);
a864c5d9 541 error = hammer2_chain_snapshot(&trans, ip, pfs);
9596b8c4 542 hammer2_inode_unlock_ex(ip, parent);
0dea3156
MD
543 hammer2_trans_done(&trans);
544
ae183399
MD
545 return (error);
546}
344d4f82
MD
547
548/*
549 * Retrieve the raw inode structure
550 */
551static int
552hammer2_ioctl_inode_get(hammer2_inode_t *ip, void *data)
553{
554 hammer2_ioc_inode_t *ino = data;
9596b8c4 555 hammer2_chain_t *parent;
344d4f82 556
9596b8c4 557 parent = hammer2_inode_lock_sh(ip);
0dea3156 558 ino->ip_data = ip->chain->data->ipdata;
26b047fa 559 ino->kdata = ip;
9596b8c4 560 hammer2_inode_unlock_sh(ip, parent);
0dea3156 561
344d4f82
MD
562 return (0);
563}
564
565static int
566hammer2_ioctl_inode_set(hammer2_inode_t *ip, void *data)
567{
568 hammer2_ioc_inode_t *ino = data;
9596b8c4 569 hammer2_chain_t *parent;
344d4f82
MD
570 int error = EINVAL;
571
9596b8c4 572 parent = hammer2_inode_lock_ex(ip);
344d4f82
MD
573 if (ino->flags & HAMMER2IOC_INODE_FLAG_IQUOTA) {
574 }
575 if (ino->flags & HAMMER2IOC_INODE_FLAG_DQUOTA) {
576 }
577 if (ino->flags & HAMMER2IOC_INODE_FLAG_COPIES) {
578 }
9596b8c4 579 hammer2_inode_unlock_ex(ip, parent);
0dea3156 580
344d4f82
MD
581 return (error);
582}