/* the caller is responsible for holding the necessary locks.  */
static int adfs_dir_find_entry(struct adfs_dir *dir, unsigned long object_id)
/* the caller is responsible for holding the necessary locks.  */
static int adfs_dir_find_entry(struct adfs_dir *dir, unsigned long object_id)
{
	int pos, ret;
	ret = -ENOENT;
	for (pos = 5; pos < ADFS_NUM_DIR_ENTRIES * 26 + 5; pos += 26) {
		struct object_info obj;
		if (!__adfs_dir_get(dir, pos, &obj))
			break;
		if (obj.file_id == object_id) {
			ret = pos;
			break;
		}
	}
	return ret;
}