Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1361589
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Miklos Szeredi <miklos@szeredi.hu> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/4] vfs: add file_dentry() |
| Date | Mon, 21 Mar 2016 09:20:02 +0100 |
| Message-ID | <rf3ea-2Ra-29@gated-at.bofh.it> (permalink) |
| References | <rdC6l-5mE-7@gated-at.bofh.it> <rf0zD-15e-3@gated-at.bofh.it> |
| X-Original-To | Al Viro <viro@zeniv.linux.org.uk> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=A6n8XZ78busEM6ri5OUSWFb2q4g9sg+ad8n0nTkUYSI=; b=atkGrTXvRHzllqzgy4IC6GIZEhPMHWbrKhEZJOK83kBuljFgqQmWMiVi7dQG1MYhFN 7vaOKODieKZRBZkgPGixUQOOnVRIrOEfyZUIX6rZ8Saug+e+7nSdfuYAzB9nFpn/WtY6 aPm6WL7zJbU4YyJrDqCVRw3Q0HLiVYIJnom9k= |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=A6n8XZ78busEM6ri5OUSWFb2q4g9sg+ad8n0nTkUYSI=; b=YgKWd9A+YQVWRmrrdDRqmrgOdKAsxoTtAuJ+D1szd9JZYwvuSMwBJoJBmKUAldUVMQ sclmadANDvwjwQfhXZHtVgpzeGipzLStqmlYgTWcQ7Qfg0vawxE+z3urwc1f8AzxN+io U5rsmC10qfmlV2LcSE61JZSODN8EV+curtPnAwDJ9GlUmOvS7ps2A4yCSIUuIeVnXgLt l6/RQvq/DAdy9w1yh9LZXQJg1ixxk6pgEpVnrcwExaRFrVBYm1Krkq85mOg+L74sjctd E4GOBQT7d6AeFb2ME3WDnP4Q3xGWZD0Qqkh12YU0RU4S8SGBSJXV1GTllHkBmu5siZ6O s4HA== |
| X-Gm-Message-State | AD7BkJKma8GGKnuxj+CP6Y9uWe2w0loKZLgHVJuOvu1qyFocXPPLPqi/Xdi31Y1kAfrskvdr/RiFj0b1LXH+Vw== |
| MIME-Version | 1.0 |
| X-Received | by 10.182.56.161 with SMTP id b1mr16394761obq.14.1458548215115; Mon, 21 Mar 2016 01:16:55 -0700 (PDT) |
| X-Originating-IP | [217.173.44.24] |
| Content-Type | text/plain; charset=UTF-8 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 34 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Kernel Mailing List <linux-kernel@vger.kernel.org>, Linux-Fsdevel <linux-fsdevel@vger.kernel.org>, David Howells <dhowells@redhat.com>, Goldwyn Rodrigues <rgoldwyn@suse.com>, Trond Myklebust <trond.myklebust@primarydata.com>, stable@vger.kernel.org, "Theodore Ts'o" <tytso@mit.edu>, Daniel Axtens <dja@axtens.net> |
| X-Original-Date | Mon, 21 Mar 2016 09:16:55 +0100 |
| X-Original-Message-ID | <CAJfpegtm0V3qMwnDzi_k+Ppx8KK5wpEs_SWZ0nkKth2yuDiRqg@mail.gmail.com> |
| X-Original-References | <1458205323-25685-1-git-send-email-miklos@szeredi.hu> <20160321052808.GH17997@ZenIV.linux.org.uk> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1361589 |
Show key headers only | View raw
On Mon, Mar 21, 2016 at 6:28 AM, Al Viro <viro@zeniv.linux.org.uk> wrote: > On Thu, Mar 17, 2016 at 10:02:00AM +0100, Miklos Szeredi wrote: >> Add a new helper, file_dentry() [*], to get the filesystem's own dentry >> from the file. This simply compares file_inode(file->f_path.dentry) to >> file_inode(file) and if they are equal returns file->f_path.dentry (this is >> the common, non-overlayfs case). >> >> In the uncommon case (regular file on overlayfs) it will call into >> overlayfs's ->d_native_dentry() to get the underlying dentry matching >> file_inode(file). > > What's wrong with making ovl_dentry_real() an instance of optional > ->d_real() method and having a flag (DCACHE_OP_REAL) controlling its > calls? With d_real(dentry) returning either that or dentry itself, > and file_dentry(file) being simply d_real(file->f_path.dentry)... > > Why do we need to look at the inode at all? d_set_d_op() dereferences > ->d_op anyway, as well as setting ->d_flags, so there's no extra cost > there, and "test bit in ->d_flags + branch not taken" is all it would > cost in normal case... Checking DCACHE_OP_REAL insted of inode would be fine. But d_real() needs inode as well. Consider the case where 1) file opened on lower layer 2) copied up 3) file_dentry() called d_real(file->f_path.dentry) would return the upper dentry but that's not what we want. Thanks, Miklos
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH 1/4] vfs: add file_dentry() Al Viro <viro@ZenIV.linux.org.uk> - 2016-03-21 06:30 +0100 Re: [PATCH 1/4] vfs: add file_dentry() Miklos Szeredi <miklos@szeredi.hu> - 2016-03-21 09:20 +0100
csiph-web