<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/sysfs/dir.c, branch v3.0.36</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/sysfs/dir.c?h=v3.0.36</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/sysfs/dir.c?h=v3.0.36'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-01-07T06:50:29Z</updated>
<entry>
<title>fs: rcu-walk aware d_revalidate method</title>
<updated>2011-01-07T06:50:29Z</updated>
<author>
<name>Nick Piggin</name>
<email>npiggin@kernel.dk</email>
</author>
<published>2011-01-07T06:49:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=34286d6662308d82aed891852d04c7c3a2649b16'/>
<id>urn:sha1:34286d6662308d82aed891852d04c7c3a2649b16</id>
<content type='text'>
Require filesystems be aware of .d_revalidate being called in rcu-walk
mode (nd-&gt;flags &amp; LOOKUP_RCU). For now do a simple push down, returning
-ECHILD from all implementations.

Signed-off-by: Nick Piggin &lt;npiggin@kernel.dk&gt;
</content>
</entry>
<entry>
<title>fs: dcache reduce branches in lookup path</title>
<updated>2011-01-07T06:50:28Z</updated>
<author>
<name>Nick Piggin</name>
<email>npiggin@kernel.dk</email>
</author>
<published>2011-01-07T06:49:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fb045adb99d9b7c562dc7fef834857f78249daa1'/>
<id>urn:sha1:fb045adb99d9b7c562dc7fef834857f78249daa1</id>
<content type='text'>
Reduce some branches and memory accesses in dcache lookup by adding dentry
flags to indicate common d_ops are set, rather than having to check them.
This saves a pointer memory access (dentry-&gt;d_op) in common path lookup
situations, and saves another pointer load and branch in cases where we
have d_op but not the particular operation.

Patched with:

git grep -E '[.&gt;]([[:space:]])*d_op([[:space:]])*=' | xargs sed -e 's/\([^\t ]*\)-&gt;d_op = \(.*\);/d_set_d_op(\1, \2);/' -e 's/\([^\t ]*\)\.d_op = \(.*\);/d_set_d_op(\&amp;\1, \2);/' -i

Signed-off-by: Nick Piggin &lt;npiggin@kernel.dk&gt;
</content>
</entry>
<entry>
<title>fs: change d_delete semantics</title>
<updated>2011-01-07T06:50:18Z</updated>
<author>
<name>Nick Piggin</name>
<email>npiggin@kernel.dk</email>
</author>
<published>2011-01-07T06:49:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fe15ce446beb3a33583af81ffe6c9d01a75314ed'/>
<id>urn:sha1:fe15ce446beb3a33583af81ffe6c9d01a75314ed</id>
<content type='text'>
Change d_delete from a dentry deletion notification to a dentry caching
advise, more like -&gt;drop_inode. Require it to be constant and idempotent,
and not take d_lock. This is how all existing filesystems use the callback
anyway.

This makes fine grained dentry locking of dput and dentry lru scanning
much simpler.

Signed-off-by: Nick Piggin &lt;npiggin@kernel.dk&gt;
</content>
</entry>
<entry>
<title>sysfs: Comment sysfs directory tagging logic</title>
<updated>2010-05-21T16:37:31Z</updated>
<author>
<name>Serge E. Hallyn</name>
<email>serue@us.ibm.com</email>
</author>
<published>2010-05-03T21:23:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=be867b194a3ae3c680c29521287ae49b4d44d420'/>
<id>urn:sha1:be867b194a3ae3c680c29521287ae49b4d44d420</id>
<content type='text'>
Add some in-line comments to explain the new infrastructure, which
was introduced to support sysfs directory tagging with namespaces.
I think an overall description someplace might be good too, but it
didn't really seem to fit into Documentation/filesystems/sysfs.txt,
which appears more geared toward users, rather than maintainers, of
sysfs.

(Tejun, please let me know if I can make anything clearer or failed
altogether to comment something that should be commented.)

Signed-off-by: Serge E. Hallyn &lt;serue@us.ibm.com&gt;
Cc: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>sysfs: Add support for tagged directories with untagged members.</title>
<updated>2010-05-21T16:37:31Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@maxwell.aristanetworks.com</email>
</author>
<published>2010-03-30T18:31:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=af10ec77b43335ab4e473e4087d85979caf02d65'/>
<id>urn:sha1:af10ec77b43335ab4e473e4087d85979caf02d65</id>
<content type='text'>
I had hopped to avoid this but the bonding driver adds a file
to /sys/class/net/  and the easiest way to handle that file is
to make it untagged and to register it only once.

So relax the rules on tagged directories, and make bonding work.

Signed-off-by: Eric W. Biederman &lt;ebiederm@aristanetworks.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>sysfs: Implement sysfs tagged directory support.</title>
<updated>2010-05-21T16:37:31Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2010-03-30T18:31:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3ff195b011d7decf501a4d55aeed312731094796'/>
<id>urn:sha1:3ff195b011d7decf501a4d55aeed312731094796</id>
<content type='text'>
The problem.  When implementing a network namespace I need to be able
to have multiple network devices with the same name.  Currently this
is a problem for /sys/class/net/*, /sys/devices/virtual/net/*, and
potentially a few other directories of the form /sys/ ... /net/*.

What this patch does is to add an additional tag field to the
sysfs dirent structure.  For directories that should show different
contents depending on the context such as /sys/class/net/, and
/sys/devices/virtual/net/ this tag field is used to specify the
context in which those directories should be visible.  Effectively
this is the same as creating multiple distinct directories with
the same name but internally to sysfs the result is nicer.

I am calling the concept of a single directory that looks like multiple
directories all at the same path in the filesystem tagged directories.

For the networking namespace the set of directories whose contents I need
to filter with tags can depend on the presence or absence of hotplug
hardware or which modules are currently loaded.  Which means I need
a simple race free way to setup those directories as tagged.

To achieve a reace free design all tagged directories are created
and managed by sysfs itself.

Users of this interface:
- define a type in the sysfs_tag_type enumeration.
- call sysfs_register_ns_types with the type and it's operations
- sysfs_exit_ns when an individual tag is no longer valid

- Implement mount_ns() which returns the ns of the calling process
  so we can attach it to a sysfs superblock.
- Implement ktype.namespace() which returns the ns of a syfs kobject.

Everything else is left up to sysfs and the driver layer.

For the network namespace mount_ns and namespace() are essentially
one line functions, and look to remain that.

Tags are currently represented a const void * pointers as that is
both generic, prevides enough information for equality comparisons,
and is trivial to create for current users, as it is just the
existing namespace pointer.

The work needed in sysfs is more extensive.  At each directory
or symlink creating I need to check if the directory it is being
created in is a tagged directory and if so generate the appropriate
tag to place on the sysfs_dirent.  Likewise at each symlink or
directory removal I need to check if the sysfs directory it is
being removed from is a tagged directory and if so figure out
which tag goes along with the name I am deleting.

Currently only directories which hold kobjects, and
symlinks are supported.  There is not enough information
in the current file attribute interfaces to give us anything
to discriminate on which makes it useless, and there are
no potential users which makes it an uninteresting problem
to solve.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Benjamin Thery &lt;benjamin.thery@bull.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>sysfs: Pass super_block to sysfs_get_inode</title>
<updated>2010-03-08T01:04:52Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2010-02-13T03:22:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fac2622bbad4d7e3a32c53e631e018b80ec631dc'/>
<id>urn:sha1:fac2622bbad4d7e3a32c53e631e018b80ec631dc</id>
<content type='text'>
Currently sysfs_get_inode magically returns an inode on
sysfs_sb.  Make the super_block parameter explicit and
the code becomes clearer.

Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Serge Hallyn &lt;serue@us.ibm.com&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@aristanetworks.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>sysfs: Only take active references on attributes.</title>
<updated>2010-03-08T01:04:51Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2010-02-11T23:20:00Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a2db6842873c8e5a70652f278d469128cb52db70'/>
<id>urn:sha1:a2db6842873c8e5a70652f278d469128cb52db70</id>
<content type='text'>
If we exclude directories and symlinks from the set of sysfs
dirents where we need active references we are left with
sysfs attributes (binary or not).

- Tweak sysfs_deactivate to only do something on attributes
- Move lockdep initialization into sysfs_file_add_mode to
  limit it to just attributes.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Acked-by: WANG Cong &lt;xiyou.wangcong@gmail.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>sysfs: Remove sysfs_get/put_active_two</title>
<updated>2010-03-08T01:04:51Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2010-02-11T23:18:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e72ceb8ccac5f770b3e696e09bb673dca7024b20'/>
<id>urn:sha1:e72ceb8ccac5f770b3e696e09bb673dca7024b20</id>
<content type='text'>
It turns out that holding an active reference on a directory is
pointless.  The purpose of the active references are to allows us to
block when removing sysfs entries that have custom methods so we don't
remove modules while running modular code and to keep those custom
methods from accessing data structures after the files have been
removed.  Further sysfs_remove_dir remove all elements in the
directory before removing the directory itself, so there is no chance
we will remove a directory with active children.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>sysfs: Cache the last sysfs_dirent to improve readdir scalability v2</title>
<updated>2010-03-08T01:04:48Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2010-01-01T22:43:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1e5289c97bba2d8ee7239a416bc3f28743362cd9'/>
<id>urn:sha1:1e5289c97bba2d8ee7239a416bc3f28743362cd9</id>
<content type='text'>
When sysfs_readdir stops short we now cache the next
sysfs_dirent to return to user space in filp-&gt;private_data.
There is no impact on the rest of sysfs by doing this and
in the common case it allows us to pick up exactly where
we left off with no seeking.

Additionally I drop and regrab the sysfs_mutex around
filldir to avoid a page fault abritrarily increasing the
hold time on the sysfs_mutex.

v2: Returned to using INT_MAX as the EOF condition.
    seekdir is ambiguous unless all directory entries have
    a unique f_pos value.

Fixes http://bugzilla.kernel.org/show_bug.cgi?id=14949

Signed-off-by: Eric W. Biederman &lt;ebiederm@aristanetworks.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
</feed>
