fs/adfs/dir_f.c

Source file repositories/reference/linux-study-clean/fs/adfs/dir_f.c

File Facts

System
Linux kernel
Corpus path
fs/adfs/dir_f.c
Extension
.c
Size
7330 bytes
Lines
325
Domain
Core OS
Bucket
VFS And Filesystem Core
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

if (ret) {
			adfs_error(dir->sb, "error reading directory entry");
			return -ENOENT;
		}
		if (!de.dirobname[0]) {
			adfs_error(dir->sb, "unable to locate entry to update");
			return -ENOENT;
		}
	} while (adfs_readval(de.dirinddiscadd, 3) != obj->indaddr);

	/* Update the directory entry with the new object state */
	adfs_obj2dir(&de, obj);

	/* Write the directory entry back to the directory */
	return adfs_dir_copyto(dir, offset, &de, 26);
}

static int adfs_f_commit(struct adfs_dir *dir)
{
	int ret;

	/* Increment directory sequence number */
	dir->dirhead->startmasseq += 1;
	dir->newtail->endmasseq += 1;

	/* Update directory check byte */
	dir->newtail->dircheckbyte = adfs_dir_checkbyte(dir);

	/* Make sure the directory still validates correctly */
	ret = adfs_f_validate(dir);
	if (ret)
		adfs_msg(dir->sb, KERN_ERR, "error: update broke directory");

	return ret;
}

const struct adfs_dir_ops adfs_f_dir_ops = {
	.read		= adfs_f_read,
	.iterate	= adfs_f_iterate,
	.setpos		= adfs_f_setpos,
	.getnext	= adfs_f_getnext,
	.update		= adfs_f_update,
	.commit		= adfs_f_commit,
};

Annotation

Implementation Notes