rem: volume->WriteCachedBlocksIfNecessary();
context: bfs_write(void *_ns, void *_node, void *_cookie, off_t pos, const void *buffer, size_t *_length){	//FUNCTION();	// uncomment to be more robust against a buggy vnode layer ;-)	//if (_ns == NULL || _node == NULL || _cookie == NULL)	//	return B_BAD_VALUE;	Volume *volume = (Volume *)_ns;	Inode *inode = (Inode *)_node;	if (!inode->HasUserAccessableStream()) {		*_length = 0;		RETURN_ERROR(B_BAD_VALUE);	}	file_cookie *cookie = (file_cookie *)_cookie;	if (cookie->open_mode & O_APPEND)		pos = inode->Size();	WriteLocked locked(inode->Lock());	if (locked.IsLocked() < B_OK)		RETURN_ERROR(B_ERROR);	Transaction transaction;		// We are not starting the transaction here, since		// it might not be needed at all (the contents of		// regular files aren't logged)	status_t status = inode->WriteAt(&transaction, pos, (const uint8 *)buffer, _length);	if (status == B_OK)		transaction.Done();	if (status == B_OK && (inode->Flags() & INODE_NO_CACHE) == 0) {		// uncached files don't cause notifications during access, and		// never want to write back any cached blocks		// periodically notify if the file size has changed		// ToDo: should we better test for a change in the last_modified time only?		if (cookie->last_size != inode->Size()			&& system_time() > cookie->last_notification + INODE_NOTIFICATION_INTERVAL) {			notify_listener(B_STAT_CHANGED, volume->ID(), 0, 0, inode->ID(), NULL);			cookie->last_size = inode->Size();			cookie->last_notification = system_time();		}		// This will flush the dirty blocks to disk from time to time.		// It's done here and not in Inode::WriteAt() so that it won't		// add to the duration of a transaction - it might even be a		// good idea to offload those calls to another thread		volume->WriteCachedBlocksIfNecessary();	}	return status;}