rem: mount = get_mount(device); if (mount == NULL) return B_BAD_VALUE;
add: status_t status = get_mount(device, &mount); if (status < B_OK) return status;
context: query_open(dev_t device, const char *query, uint32 flags,	port_id port, int32 token, bool kernel){	struct fs_mount *mount;	fs_cookie cookie;	status_t status;	FUNCTION(("query_open(device = %ld, query = \"%s\", kernel = %d)\n", device, query, kernel));	mount = get_mount(device);	if (mount == NULL)		return B_BAD_VALUE;	if (FS_MOUNT_CALL(mount, open_query) == NULL) {		status = EOPNOTSUPP;		goto out;	}	status = FS_MOUNT_CALL(mount, open_query)(mount->cookie, query, flags, port, token, &cookie);	if (status < B_OK)		goto out;	// get fd for the index directory	status = get_new_fd(FDTYPE_QUERY, mount, NULL, cookie, 0, kernel);	if (status >= 0)		goto out;	// something went wrong	FS_MOUNT_CALL(mount, close_query)(mount->cookie, cookie);	FS_MOUNT_CALL(mount, free_query_cookie)(mount->cookie, cookie);out:	put_mount(mount);	return status;}