fs/afs/fsclient.c
Source file repositories/reference/linux-study-clean/fs/afs/fsclient.c
File Facts
- System
- Linux kernel
- Corpus path
fs/afs/fsclient.c- Extension
.c- Size
- 50818 bytes
- Lines
- 2135
- 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.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/slab.hlinux/sched.hlinux/circ_buf.hlinux/iversion.hlinux/netfs.hinternal.hafs_fs.hxdr_fs.h
Detected Declarations
function Copyrightfunction xdr_dump_badfunction xdr_decode_AFSFetchStatusfunction xdr_decode_expiryfunction xdr_decode_AFSCallBackfunction xdr_decode_AFSVolSyncfunction xdr_encode_AFS_StoreStatusfunction xdr_decode_AFSFetchVolumeStatusfunction afs_deliver_fs_fetch_statusfunction afs_fs_fetch_statusfunction afs_deliver_fs_fetch_datafunction afs_fs_fetch_data64function afs_fs_fetch_datafunction afs_deliver_fs_create_vnodefunction afs_fs_create_filefunction afs_fs_make_dirfunction afs_deliver_fs_file_status_and_volfunction afs_fs_remove_filefunction afs_fs_remove_dirfunction afs_deliver_fs_linkfunction afs_fs_linkfunction afs_deliver_fs_symlinkfunction afs_fs_symlinkfunction afs_deliver_fs_renamefunction afs_fs_renamefunction afs_deliver_fs_store_datafunction afs_fs_store_data64function afs_fs_store_datafunction afs_fs_setattr_size64function afs_fs_setattr_sizefunction afs_fs_setattrfunction afs_deliver_fs_get_volume_statusfunction afs_fs_get_volume_statusfunction afs_deliver_fs_xxxx_lockfunction afs_fs_set_lockfunction afs_fs_extend_lockfunction afs_fs_release_lockfunction afs_deliver_fs_give_up_all_callbacksfunction afs_fs_give_up_all_callbacksfunction afs_deliver_fs_get_capabilitiesfunction afs_fs_get_capabilities_destructorfunction afs_fs_get_capabilitiesfunction afs_deliver_fs_inline_bulk_statusfunction afs_done_fs_inline_bulk_statusfunction afs_fs_inline_bulk_statusfunction afs_deliver_fs_fetch_aclfunction afs_fs_fetch_aclfunction afs_fs_store_acl
Annotated Snippet
if (call->operation_ID == FSFETCHDATA64) {
afs_extract_to_tmp64(call);
} else {
call->tmp_u = htonl(0);
afs_extract_to_tmp(call);
}
fallthrough;
/* Extract the returned data length into ->remaining.
* This may indicate more or less data than was
* requested will be returned.
*/
case 1:
_debug("extract data length");
ret = afs_extract_data(call, true);
if (ret < 0)
return ret;
call->remaining = be64_to_cpu(call->tmp64);
_debug("DATA length: %llu", call->remaining);
if (call->remaining == 0)
goto no_more_data;
call->iter = &subreq->io_iter;
call->iov_len = umin(call->remaining, subreq->len - subreq->transferred);
call->unmarshall++;
fallthrough;
/* extract the returned data */
case 2:
count_before = call->iov_len;
_debug("extract data %zu/%llu", count_before, call->remaining);
ret = afs_extract_data(call, true);
subreq->transferred += count_before - call->iov_len;
call->remaining -= count_before - call->iov_len;
if (ret < 0)
return ret;
call->iter = &call->def_iter;
if (call->remaining)
goto no_more_data;
/* Discard any excess data the server gave us */
afs_extract_discard(call, call->remaining);
call->unmarshall = 3;
fallthrough;
case 3:
_debug("extract discard %zu/%llu",
iov_iter_count(call->iter), call->remaining);
ret = afs_extract_data(call, true);
if (ret < 0)
return ret;
no_more_data:
call->unmarshall = 4;
afs_extract_to_buf(call, (21 + 3 + 6) * 4);
fallthrough;
/* extract the metadata */
case 4:
ret = afs_extract_data(call, false);
if (ret < 0)
return ret;
bp = call->buffer;
xdr_decode_AFSFetchStatus(&bp, call, &vp->scb);
xdr_decode_AFSCallBack(&bp, call, &vp->scb);
xdr_decode_AFSVolSync(&bp, &op->volsync);
if (subreq->start + subreq->transferred >= vp->scb.status.size)
__set_bit(NETFS_SREQ_HIT_EOF, &subreq->flags);
call->unmarshall++;
fallthrough;
case 5:
break;
}
_leave(" = 0 [done]");
return 0;
}
/*
* FS.FetchData operation type
*/
Annotation
- Immediate include surface: `linux/init.h`, `linux/slab.h`, `linux/sched.h`, `linux/circ_buf.h`, `linux/iversion.h`, `linux/netfs.h`, `internal.h`, `afs_fs.h`.
- Detected declarations: `function Copyright`, `function xdr_dump_bad`, `function xdr_decode_AFSFetchStatus`, `function xdr_decode_expiry`, `function xdr_decode_AFSCallBack`, `function xdr_decode_AFSVolSync`, `function xdr_encode_AFS_StoreStatus`, `function xdr_decode_AFSFetchVolumeStatus`, `function afs_deliver_fs_fetch_status`, `function afs_fs_fetch_status`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.