Lines Matching +full:- +full:- +full:disk
11 * http://www.apache.org/licenses/LICENSE-2.0
29 #include "disk.h"
43 * pathname - the full path to the block driver to be opened
44 * mountflags - if MS_RDONLY is not set, then driver must support write
46 * ppvnode - address of the location to return the vnode reference
51 * EINVAL - pathname or pvnode is NULL
52 * ENOENT - No block driver of this name is registered
53 * ENOTBLK - The vnode associated with the pathname is not a block driver
54 * EACCESS - The MS_RDONLY option was not set but this driver does not
67 los_disk *disk = NULL; in open_blockdriver() local
75 ret = -EINVAL; in open_blockdriver()
96 struct drv_data* drv = (struct drv_data*)vnode_ptr->data; in open_blockdriver()
97 struct block_operations *ops = (struct block_operations *)drv->ops; in open_blockdriver()
102 disk = get_disk(part->disk_id); in open_blockdriver()
103 if (disk == NULL) in open_blockdriver()
105 ret = -EINVAL; in open_blockdriver()
109 if (pthread_mutex_lock(&disk->disk_mutex) != ENOERR) in open_blockdriver()
112 return -1; in open_blockdriver()
114 if (disk->disk_status == STAT_INUSED) in open_blockdriver()
117 if (ops->open != NULL) in open_blockdriver()
119 ret = ops->open(vnode_ptr); in open_blockdriver()
123 (void)pthread_mutex_unlock(&disk->disk_mutex); in open_blockdriver()
129 if (pthread_mutex_unlock(&disk->disk_mutex) != ENOERR) in open_blockdriver()
132 return -1; in open_blockdriver()
138 if (ops->open != NULL) in open_blockdriver()
140 ret = ops->open(vnode_ptr); in open_blockdriver()