rem: status_t status = inode->CheckPermissions(oModeToAccess(omode));
add: status_t status = inode->CheckPermissions(openModeToAccess(omode));
context: bfs_open(void *_ns, void *_node, int omode, void **_cookie){	FUNCTION();	if (_ns == NULL || _node == NULL || _cookie == NULL)		RETURN_ERROR(B_BAD_VALUE);	Volume *volume = (Volume *)_ns;	Inode *inode = (Inode *)_node;	// we can't open a file which uses uncached access twice	if (inode->Flags() & INODE_NO_CACHE)		return B_BUSY;	// opening a directory read-only is allowed, although you can't read	// any data from it.	if (inode->IsDirectory() && omode & O_RWMASK) {		omode = omode & ~O_RWMASK;		// ToDo: for compatibility reasons, we don't return an error here...		// e.g. "copyattr" tries to do that		//return B_IS_A_DIRECTORY;	}	status_t status = inode->CheckPermissions(oModeToAccess(omode));	if (status < B_OK)		RETURN_ERROR(status);	// we could actually use the cookie to keep track of:	//	- the last block_run	//	- the location in the data_stream (indirect, double indirect,	//	  position in block_run array)	//	// This could greatly speed up continuous reads of big files, especially	// in the indirect block section.	file_cookie *cookie = (file_cookie *)malloc(sizeof(file_cookie));	if (cookie == NULL)		RETURN_ERROR(B_NO_MEMORY); 	// initialize the cookie	cookie->open_mode = omode;		// needed by e.g. bfs_write() for O_APPEND	cookie->last_size = inode->Size();	cookie->last_notification = system_time();	// Should we truncate the file?	if (omode & O_TRUNC) {		WriteLocked locked(inode->Lock());		Transaction transaction(volume, inode->BlockNumber());		status_t status = inode->SetFileSize(&transaction, 0);		if (status < B_OK) {			// bfs_free_cookie() is only called if this function is successful			free(cookie);			return status;		}		transaction.Done();	}	*_cookie = cookie;	return B_OK;}