netfs_read_sizes(9)
π netfs_read_sizes β the Kernel API Manual, bestie edition π
Okay so picture this: you're in the kernel, you're poking at an inode, and you need the sizes β but you need them safely, no cap. That's this function. It lives in the netfs squad of the Kernel API Manual and it's giving "quietly essential" β¨
πΈ NAME πΈ
netfs_read_sizes β read remote_i_size and zero_point safely π«Ά
β¨ SYNOPSIS β¨
void netfs_read_sizes (const struct inode *inode , unsigned long long
*i_size , unsigned long long *remote_i_size , unsigned long long
*zero_point );
π¦ ARGUMENTS π¦
inodeβ the inode you wanna access, bestie. That's the whole vibe.i_sizeβ where to return the local file size πremote_i_sizeβ where to return the size of the file on the server βzero_pointβ where to return the the point beyond which the server has no data π (yes, "the the" β that's literally how it's written, I'm not touching it, it's iconic)
π₯ DESCRIPTION π₯
So what it do? It reads remote_i_size and zero_point safely, without the potential for tearing on 32-bit arches. Literally that's the whole job. No tearing. No drama. Periodt π
π NOTE π
Okay this is the part where I need you to focus, because it's a whole paragraph of realness:
In a 32bit arch with a preemptable kernel and an UP compile, thei_size_read/writemust be atomic with respect to the local cpu (unlike with preempt disabled), but they don't need to be atomic with respect to other cpus like in true SMP (so they need either to either locally disable irq around the read or for example on x86 they can be still implemented as acmpxchg8bwithout the need of the lock prefix). For SMP compiles and 64bit archs it makes no difference if preempt is enabled or not.
Read it twice, it's a lot π« but it's literally all there, I promise.
π SEE ALSO π
- Kernel file
./include/linux/netfs.h folio_start_private_2(9)netfs_inode(9)netfs_read_remote_i_size(9)netfs_read_zero_point(9)netfs_inode_init(9)netfs_resize_file(9)netfs_i_cookie(9)netfs_wait_for_outstanding_io(9)
And that's the page, bestie π§ This lil' icon is shipped from ./include/linux, dated October 2026, and it's part of the gen netfs_read_sizes(9) of the Kernel API Manual. Go read some sizes safely, you absolute main character ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms