Lines Matching +full:- +full:- +full:disk
11 * http://www.apache.org/licenses/LICENSE-2.0
29 #include "disk.h"
42 * vnode - reference to the vnode of a block driver opened by open_blockdriver
47 * EINVAL - vnode is NULL
48 * ENOTBLK - The vnode is not a block driver
56 los_disk *disk = NULL; in close_blockdriver() local
61 if (vnode_ptr == NULL || vnode_ptr->data == NULL) in close_blockdriver()
63 ret = -EINVAL; in close_blockdriver()
67 bop = (struct block_operations*)(((struct drv_data*)vnode_ptr->data)->ops); in close_blockdriver()
71 ret = -EINVAL; in close_blockdriver()
77 if (vnode_ptr->type != VNODE_TYPE_BLK) in close_blockdriver()
80 ret = -ENOTBLK; in close_blockdriver()
88 disk = get_disk(part->disk_id); in close_blockdriver()
89 if (disk == NULL) in close_blockdriver()
91 ret = -EINVAL; in close_blockdriver()
95 if (pthread_mutex_lock(&disk->disk_mutex) != ENOERR) in close_blockdriver()
98 return -EAGAIN; in close_blockdriver()
101 if (disk->disk_status == STAT_INUSED) in close_blockdriver()
108 if (bop->close != NULL) in close_blockdriver()
110 ret = bop->close(vnode_ptr); in close_blockdriver()
114 if (pthread_mutex_unlock(&disk->disk_mutex) != ENOERR) in close_blockdriver()
122 if (bop->close != NULL) in close_blockdriver()
124 ret = bop->close(vnode_ptr); in close_blockdriver()