linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* =?y?q?=5BRFC=5D=5BPATCH=200/2=5D=20debugfs=3A=20Allow=20debugfs=5Fcreate=5Fdir=28=29=20to=20take=20data=20from=20caller?=
@ 2012-08-08  6:24 Hiroshi Doyu
       [not found] ` <1344407073-12030-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Hiroshi Doyu @ 2012-08-08  6:24 UTC (permalink / raw)
  To: Hiroshi Doyu
  Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA, Al Viro

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 2025 bytes --]

The commit c3b1a35 "debugfs: make sure that debugfs_create_file() gets
used only for regulars" doesn't allow to use debugfs_create_file() for
creating directory, and the current debugfs_create_dir() cannot take
the private data from caller. There are some cases that we want to pass some
client data to dir, especially when dir is nested deeply. We can work
around to pass all necessary data with some invented data structure to
the end files, but if directory itself had private data, we could
avoid to introduce new structures just to pass data to end files.

For example, tegra iommu(smmu) case, debugfs structure could be as
below.

sys/
└── kernel
    └── debug
        ├── smmu.0
        │   ├── mc
        │   │   ├── ptc
        │   │   └── tlb
        │   └── mc0
        │       ├── ptc
        │       └── tlb
        └── smmu.1
            ├── mc
            │   ├── ptc
            │   └── tlb
            ├── mc0
            │   ├── ptc
            │   └── tlb
            └── mc1
                ├── ptc
                └── tlb

The end files, {ptc,tlb} depend on which mc? to belong to, and
which smmu.? to belong to. The parent data can be accessed from those
end files if necessary.

  dent = d_find_alias(s->private);
  cache = (int)dent->d_inode->i_private;
  mc = (int)dent->d_parent->d_inode->i_private;
  smmu = dent->d_parent->d_parent->d_inode->i_private;

The original tegra smmu debugfs patch is:
  http://lists.linuxfoundation.org/pipermail/iommu/2012-August/004507.html

Hiroshi Doyu (2):
  debugfs: Allow debugfs_create_dir() to take data
  iommu/tegra: smmu: Use __debugfs_create_dir

 drivers/iommu/tegra-smmu.c |    4 +---
 fs/debugfs/inode.c         |    7 ++++---
 include/linux/debugfs.h    |    9 ++++++++-
 3 files changed, 13 insertions(+), 7 deletions(-)

--
1.7.5.4

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-09-17 16:28 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-08  6:24 =?y?q?=5BRFC=5D=5BPATCH=200/2=5D=20debugfs=3A=20Allow=20debugfs=5Fcreate=5Fdir=28=29=20to=20take=20data=20from=20caller?= Hiroshi Doyu
     [not found] ` <1344407073-12030-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-08-08  6:24   ` [PATCH 1/2] debugfs: Allow debugfs_create_dir() to take data Hiroshi Doyu
     [not found]     ` <1344407073-12030-2-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-08-08 13:34       ` Greg Kroah-Hartman
     [not found]         ` <20120808133427.GA14417-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2012-08-09 12:56           ` Hiroshi Doyu
     [not found]             ` <20120809155624.b781edae9efa7c51faf6c31c-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-08-15  5:40               ` Hiroshi Doyu
     [not found]                 ` <20120815084008.3d8f4ac20af5dc3372cd7681-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-08-15 13:40                   ` Greg Kroah-Hartman
2012-08-15  5:47               ` [v2 1/1] iommu/tegra: smmu: Use debugfs_create_dir for directory Hiroshi Doyu
     [not found]                 ` <1345009652-13408-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-08-15 16:13                   ` Stephen Warren
     [not found]                     ` <502BCA9E.5090206-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-09-04  6:51                       ` Hiroshi Doyu
     [not found]                         ` <20120904.095134.292349834288373260.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-09-10 18:24                           ` Stephen Warren
     [not found]                             ` <504E3046.9080103-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-09-17 16:28                               ` joerg.roedel-5C7GfCeVMHo
2012-08-08  6:24   ` [PATCH 2/2] iommu/tegra: smmu: Use __debugfs_create_dir Hiroshi Doyu
     [not found]     ` <1344407073-12030-3-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-08-08 15:11       ` Felipe Balbi
     [not found]         ` <20120808151128.GC9091-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-08-08 15:31           ` Felipe Balbi
     [not found]             ` <20120808153100.GE9091-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-08-15  6:34               ` Hiroshi Doyu
     [not found]                 ` <20120815093421.c08fdbbf4d7ce6c3986861f2-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-08-15  7:07                   ` Felipe Balbi
2012-08-08  6:28   ` [RFC][PATCH 0/2] debugfs: Allow debugfs_create_dir() to take data from caller Hiroshi Doyu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).