netfs_read_sizes(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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, the i_size_read/write must 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 a cmpxchg8b without 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 πŸ‘‘


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