mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: linux-mtd@lists.infradead.org
Cc: kernel@pengutronix.de, artem.bityutskiy@linux.intel.com,
	linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	Subodh Nijsure <snijsure@grid-net.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH RFC 3/5] UBIFS: Add xattr support for symlinks
Date: Wed, 13 Feb 2013 11:23:16 +0100	[thread overview]
Message-ID: <1360750998-15191-4-git-send-email-mkl@pengutronix.de> (raw)
In-Reply-To: <1360750998-15191-1-git-send-email-mkl@pengutronix.de>

From: Subodh Nijsure <snijsure@grid-net.com>

Signed-off-by: Subodh Nijsure <snijsure@grid-net.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 fs/ubifs/file.c  |    4 ++++
 fs/ubifs/xattr.c |   18 +++++++++++++-----
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index 5bc7781..ed9655c 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -1574,6 +1574,10 @@ const struct inode_operations ubifs_symlink_inode_operations = {
 	.follow_link = ubifs_follow_link,
 	.setattr     = ubifs_setattr,
 	.getattr     = ubifs_getattr,
+	.setxattr    = ubifs_setxattr,
+	.getxattr    = ubifs_getxattr,
+	.listxattr   = ubifs_listxattr,
+	.removexattr = ubifs_removexattr,
 };
 
 const struct file_operations ubifs_file_operations = {
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c
index 1395307..d496aa4 100644
--- a/fs/ubifs/xattr.c
+++ b/fs/ubifs/xattr.c
@@ -293,18 +293,16 @@ static struct inode *iget_xattr(struct ubifs_info *c, ino_t inum)
 	return ERR_PTR(-EINVAL);
 }
 
-int ubifs_setxattr(struct dentry *dentry, const char *name,
-		   const void *value, size_t size, int flags)
+static int __ubifs_setxattr(struct inode *host, const char *name,
+			    const void *value, size_t size, int flags)
 {
-	struct inode *inode, *host = dentry->d_inode;
+	struct inode *inode;
 	struct ubifs_info *c = host->i_sb->s_fs_info;
 	struct qstr nm = QSTR_INIT(name, strlen(name));
 	struct ubifs_dent_node *xent;
 	union ubifs_key key;
 	int err, type;
 
-	dbg_gen("xattr '%s', host ino %lu ('%.*s'), size %zd", name,
-		host->i_ino, dentry->d_name.len, dentry->d_name.name, size);
 	ubifs_assert(mutex_is_locked(&host->i_mutex));
 
 	if (size > UBIFS_MAX_INO_DATA)
@@ -356,6 +354,16 @@ out_free:
 	return err;
 }
 
+int ubifs_setxattr(struct dentry *dentry, const char *name,
+		     const void *value, size_t size, int flags)
+{
+	dbg_gen("xattr '%s', host ino %lu ('%.*s'), size %zd",
+		name, dentry->d_inode->i_ino, dentry->d_name.len,
+		dentry->d_name.name, size);
+
+	return __ubifs_setxattr(dentry->d_inode, name, value, size, flags);
+}
+
 ssize_t ubifs_getxattr(struct dentry *dentry, const char *name, void *buf,
 		       size_t size)
 {
-- 
1.7.10.4


  parent reply	other threads:[~2013-02-13 10:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-13 10:23 [RFC PATCH 0/5] UBIFS: improve xattr and add support for security.* XATTR Marc Kleine-Budde
2013-02-13 10:23 ` [PATCH RFC 1/5] UBIFS: xattr: protect ui_size and data_len by ui_mutex Marc Kleine-Budde
2013-02-14  7:23   ` Artem Bityutskiy
2013-02-14 11:57     ` Marc Kleine-Budde
2013-02-13 10:23 ` [PATCH RFC 2/5] UBIFS: fix couple bugs in UBIFS extended attribute length calculation Marc Kleine-Budde
2013-02-13 10:23 ` Marc Kleine-Budde [this message]
2013-02-13 10:23 ` [PATCH RFC 4/5] UBIFS: Add security.* XATTR support for the UBIFS Marc Kleine-Budde
2013-02-14  7:28   ` Artem Bityutskiy
2013-02-14 12:05     ` Marc Kleine-Budde
2013-02-22  7:10   ` Artem Bityutskiy
2013-02-13 10:23 ` [PATCH RFC 5/5] UBIFS: add ubifs_err() to print error reason Marc Kleine-Budde
2013-02-14  7:29   ` Artem Bityutskiy

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=1360750998-15191-4-git-send-email-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=snijsure@grid-net.com \
    /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

all inboxes | Powered by JetHome®