vdev_file.c (226617) | vdev_file.c (236155) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 6 unchanged lines hidden (view full) --- 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* 22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 6 unchanged lines hidden (view full) --- 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* 22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
23 * Copyright (c) 2012 by Delphix. All rights reserved. |
|
23 */ 24 25#include <sys/zfs_context.h> 26#include <sys/spa.h> 27#include <sys/vdev_file.h> 28#include <sys/vdev_impl.h> 29#include <sys/zio.h> 30#include <sys/fs/zfs.h> --- 11 unchanged lines hidden (view full) --- 42 43static void 44vdev_file_rele(vdev_t *vd) 45{ 46 ASSERT(vd->vdev_path != NULL); 47} 48 49static int | 24 */ 25 26#include <sys/zfs_context.h> 27#include <sys/spa.h> 28#include <sys/vdev_file.h> 29#include <sys/vdev_impl.h> 30#include <sys/zio.h> 31#include <sys/fs/zfs.h> --- 11 unchanged lines hidden (view full) --- 43 44static void 45vdev_file_rele(vdev_t *vd) 46{ 47 ASSERT(vd->vdev_path != NULL); 48} 49 50static int |
50vdev_file_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift) | 51vdev_file_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, 52 uint64_t *ashift) |
51{ 52 vdev_file_t *vf; 53 vnode_t *vp; 54 vattr_t vattr; 55 int error, vfslocked; 56 57 /* 58 * We must have a pathname, and it must be absolute. --- 61 unchanged lines hidden (view full) --- 120 if (error) { 121 (void) VOP_CLOSE(vp, spa_mode(vd->vdev_spa), 1, 0, kcred, NULL); 122 vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; 123 kmem_free(vd->vdev_tsd, sizeof (vdev_file_t)); 124 vd->vdev_tsd = NULL; 125 return (error); 126 } 127 | 53{ 54 vdev_file_t *vf; 55 vnode_t *vp; 56 vattr_t vattr; 57 int error, vfslocked; 58 59 /* 60 * We must have a pathname, and it must be absolute. --- 61 unchanged lines hidden (view full) --- 122 if (error) { 123 (void) VOP_CLOSE(vp, spa_mode(vd->vdev_spa), 1, 0, kcred, NULL); 124 vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED; 125 kmem_free(vd->vdev_tsd, sizeof (vdev_file_t)); 126 vd->vdev_tsd = NULL; 127 return (error); 128 } 129 |
128 *psize = vattr.va_size; | 130 *max_psize = *psize = vattr.va_size; |
129 *ashift = SPA_MINBLOCKSHIFT; 130 131 return (0); 132} 133 134static void 135vdev_file_close(vdev_t *vd) 136{ --- 94 unchanged lines hidden --- | 131 *ashift = SPA_MINBLOCKSHIFT; 132 133 return (0); 134} 135 136static void 137vdev_file_close(vdev_t *vd) 138{ --- 94 unchanged lines hidden --- |