archive mirror
 help / color / mirror / Atom feed
From: Aristeu Rozanski <>
Cc: Li Zefan <>, Tejun Heo <>,
	Hugh Dickins <>, Hillf Danton <>,
	Lennart Poettering <>
Subject: [PATCH 2/2] fs: add documentation to simple_xattr functions
Date: Wed, 05 Sep 2012 14:31:34 -0400	[thread overview]
Message-ID: <> (raw)

[-- Attachment #1: simple_xattr_doc.txt --]
[-- Type: text/plain, Size: 3349 bytes --]

Cc: Li Zefan <>
Cc: Tejun Heo <>
Cc: Hugh Dickins <>
Cc: Hillf Danton <>
Cc: Lennart Poettering <>
Signed-off-by: Aristeu Rozanski <>

 Documentation/filesystems/00-INDEX         |    3 ++
 Documentation/filesystems/simple_xattr.txt |   42 +++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+)

Index: github/Documentation/filesystems/00-INDEX
--- github.orig/Documentation/filesystems/00-INDEX	2012-09-05 11:51:50.870969722 -0400
+++ github/Documentation/filesystems/00-INDEX	2012-09-05 12:10:46.250211947 -0400
@@ -96,6 +96,9 @@
 	- how to use the seq_file API
 	- a description of shared subtrees for namespaces.
+	- description of extended attributes for memory backed filesystems
+	  like tmpfs and cgroup filesystem.
 	- info and mount options for the SPU filesystem used on Cell.
Index: github/Documentation/filesystems/simple_xattr.txt
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ github/Documentation/filesystems/simple_xattr.txt	2012-09-05 12:10:46.250211947 -0400
@@ -0,0 +1,42 @@
+Simple Extended Attributes for Memory Backed Filesystems Interface
+Implements extended attributes storage using kernel memory.  Users of these
+functions are strongly advised against allowing user or any other kind of
+extended attributes that can be manipulated by unprivileged users, since it'd
+be trivial to exhaust kernel memory.
+The filesystem implementation is responsible by storing a simple_xattrs
+structure for every directory and file and to implement setxattr() and
+getxattr() calls. Also, setxattr() should filter off by name the unsupported
+void simple_xattrs_init(struct simple_xattrs *xattrs)
+- Initializes a pre allocated structure
+void simple_xattrs_free(struct simple_xattrs *xattrs)
+- Frees up all the extended attributes and any resources allocated by
+  simple_xattrs_init
+struct simple_xattr *simple_xattr_alloc(const void *value, size_t size)
+- Allocates a extended attribute entry
+void simple_xattr_list_add(struct simple_xattrs *xattrs,
+                          struct simple_xattr *new_xattr)
+int simple_xattr_remove(struct simple_xattrs *xattrs, const char *name)
+- Adds and removes an extended attribute from the list
+int simple_xattr_get(struct simple_xattrs *xattrs, const char *name,
+                    void *buffer, size_t size);
+- Returns the value of an extended attribute searching by name
+int simple_xattr_set(struct simple_xattrs *xattrs, const char *name,
+                    const void *value, size_t size, int flags);
+- Sets a new value for a given extended attribute. Specifying value as
+  NULL will remove the entry.  If XATTR_CREATE is set in flags, no extended
+  attribute with the same name may exist.  If XATTR_REPLACE is set, the
+  extended attribute has to exist or the operation will fail
+ssize_t simple_xattr_list(struct simple_xattrs *xattrs, char *buffer,
+                         size_t size);
+- Lists the existing extended attributes names in a given buffer

  parent reply	other threads:[~2012-09-05 18:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 18:31 [PATCH 0/2] cgroups: add documentation on extended attributes and simple_xattr functions Aristeu Rozanski
2012-09-05 18:31 ` [PATCH 1/2] cgroups: add documentation on extended attributes usage Aristeu Rozanski
2012-09-05 22:49   ` Tejun Heo
2012-09-05 18:31 ` Aristeu Rozanski [this message]
2012-09-05 22:50   ` [PATCH 2/2] fs: add documentation to simple_xattr functions Tejun Heo

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).