fs/nfs/getroot.c

Source file repositories/reference/linux-study-clean/fs/nfs/getroot.c

File Facts

System
Linux kernel
Corpus path
fs/nfs/getroot.c
Extension
.c
Size
3522 bytes
Lines
134
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 (d_inode(fc->root)->i_fop != &nfs_dir_operations) {
			error = -ESTALE;
			goto error_splat_root;
		}
		/* clone lsm security options from the parent to the new sb */
		error = security_sb_clone_mnt_opts(ctx->clone_data.sb,
						   s, kflags, &kflags_out);
		if (error)
			goto error_splat_root;
		clone_server = NFS_SB(ctx->clone_data.sb);
		server->has_sec_mnt_opts = clone_server->has_sec_mnt_opts;
	} else {
		error = security_sb_set_mnt_opts(s, fc->security,
							kflags, &kflags_out);
	}
	if (error)
		goto error_splat_root;
	if (server->caps & NFS_CAP_SECURITY_LABEL &&
		!(kflags_out & SECURITY_LSM_NATIVE_LABELS))
		server->caps &= ~NFS_CAP_SECURITY_LABEL;

	nfs_setsecurity(inode, fsinfo.fattr);
	error = 0;

out_fattr:
	nfs_free_fattr(fsinfo.fattr);
out_name:
	kfree(name);
out:
	return error;
error_splat_root:
	dput(fc->root);
	fc->root = NULL;
	goto out_fattr;
}

Annotation

Implementation Notes