From: "Theodore Ts'o" <tytso@mit.edu>
To: Jinliang Zheng <alexjlzheng@gmail.com>
Cc: viro@zeniv.linux.org.uk, adobriyan@gmail.com,
alexjlzheng@tencent.com, brauner@kernel.org,
flyingpeng@tencent.com, jack@suse.cz, joel.granados@kernel.org,
kees@kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, mcgrof@kernel.org
Subject: Re: [PATCH 0/6] Maintain the relative size of fs.file-max and fs.nr_open
Date: Sun, 24 Nov 2024 05:59:55 -1000 [thread overview]
Message-ID: <20241124155955.GD3874922@mit.edu> (raw)
In-Reply-To: <20241124094813.1021293-1-alexjlzheng@tencent.com>
On Sun, Nov 24, 2024 at 05:48:13PM +0800, Jinliang Zheng wrote:
> >
> > Short version: there are 3 different notions -
> > 1) file as a collection of data kept by filesystem. Such things as
> > contents, ownership, permissions, timestamps belong there.
> > 2) IO channel used to access one of (1). open(2) creates such;
> > things like current position in file, whether it's read-only or read-write
> > open, etc. belong there. It does not belong to a process - after fork(),
> > ...
>
> I'm sorry that I don't know much about the implementation of UNIX, but
> specific to the implementation of Linux, struct file is more like a
> combination of what you said 1) and 2).
This is incorrect. In Linux (and historical implementations of Unix)
struct file is precisely (2). The struct file has a pointer to a
struct dentry, which in turn has a pointer to a struct inode. So a
struct file *refers* to (1), but it is *not* (1).
- Ted
prev parent reply other threads:[~2024-11-24 16:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-23 18:08 [PATCH 0/6] Maintain the relative size of fs.file-max and fs.nr_open Jinliang Zheng
2024-11-23 18:11 ` [PATCH 1/6] fs: fix proc_handler for sysctl_nr_open Jinliang Zheng
2024-11-23 18:11 ` [PATCH 2/6] fs: make files_stat globally visible Jinliang Zheng
2024-11-23 18:12 ` [PATCH 3/6] sysctl: refactor __do_proc_doulongvec_minmax() Jinliang Zheng
2024-11-23 18:12 ` [PATCH 4/6] sysctl: ensure files_stat.max_files is not less than sysctl_nr_open Jinliang Zheng
2024-11-23 18:13 ` [PATCH 5/6] sysctl: ensure sysctl_nr_open is not greater than files_stat.max_files Jinliang Zheng
2024-11-23 18:13 ` [PATCH 6/6] fs: synchronize the access of fs.file-max and fs.nr_open Jinliang Zheng
2024-11-23 18:27 ` [PATCH 0/6] Maintain the relative size " Al Viro
2024-11-23 19:32 ` Al Viro
2024-11-24 2:30 ` Theodore Ts'o
2024-11-24 9:48 ` Jinliang Zheng
2024-11-24 15:59 ` Theodore Ts'o [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241124155955.GD3874922@mit.edu \
--to=tytso@mit.edu \
--cc=adobriyan@gmail.com \
--cc=alexjlzheng@gmail.com \
--cc=alexjlzheng@tencent.com \
--cc=brauner@kernel.org \
--cc=flyingpeng@tencent.com \
--cc=jack@suse.cz \
--cc=joel.granados@kernel.org \
--cc=kees@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox