aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/dir.c
diff options
context:
space:
mode:
authorSubodh Nijsure <snijsure@grid-net.com>2014-10-31 14:50:30 -0400
committerRichard Weinberger <richard@nod.at>2015-01-28 10:08:54 -0500
commitd7f0b70d30ffb9bbe6b8a3e1035cf0b79965ef53 (patch)
treea903ee476aad8a9dcff9ef5cd9d4a4626e679990 /fs/ubifs/dir.c
parent895d9db253a0b0b1f8a6e635fb2460d80bf72d5a (diff)
UBIFS: Add security.* XATTR support for the UBIFS
Artem: rename static functions so that they do not use the "ubifs_" prefix - we only use this prefix for non-static functions. Artem: remove few junk white-space changes in file.c Signed-off-by: Subodh Nijsure <snijsure@grid-net.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Ben Shelton <ben.shelton@ni.com> Acked-by: Brad Mouring <brad.mouring@ni.com> Acked-by: Terry Wilcox <terry.wilcox@ni.com> Acked-by: Gratian Crisan <gratian.crisan@ni.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'fs/ubifs/dir.c')
-rw-r--r--fs/ubifs/dir.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index ea41649e4ca5..f7e8f765b36f 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -272,6 +272,10 @@ static int ubifs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
272 goto out_budg; 272 goto out_budg;
273 } 273 }
274 274
275 err = ubifs_init_security(dir, inode, &dentry->d_name);
276 if (err)
277 goto out_cancel;
278
275 mutex_lock(&dir_ui->ui_mutex); 279 mutex_lock(&dir_ui->ui_mutex);
276 dir->i_size += sz_change; 280 dir->i_size += sz_change;
277 dir_ui->ui_size = dir->i_size; 281 dir_ui->ui_size = dir->i_size;
@@ -728,6 +732,10 @@ static int ubifs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
728 goto out_budg; 732 goto out_budg;
729 } 733 }
730 734
735 err = ubifs_init_security(dir, inode, &dentry->d_name);
736 if (err)
737 goto out_cancel;
738
731 mutex_lock(&dir_ui->ui_mutex); 739 mutex_lock(&dir_ui->ui_mutex);
732 insert_inode_hash(inode); 740 insert_inode_hash(inode);
733 inc_nlink(inode); 741 inc_nlink(inode);
@@ -808,6 +816,10 @@ static int ubifs_mknod(struct inode *dir, struct dentry *dentry,
808 ui->data = dev; 816 ui->data = dev;
809 ui->data_len = devlen; 817 ui->data_len = devlen;
810 818
819 err = ubifs_init_security(dir, inode, &dentry->d_name);
820 if (err)
821 goto out_cancel;
822
811 mutex_lock(&dir_ui->ui_mutex); 823 mutex_lock(&dir_ui->ui_mutex);
812 dir->i_size += sz_change; 824 dir->i_size += sz_change;
813 dir_ui->ui_size = dir->i_size; 825 dir_ui->ui_size = dir->i_size;
@@ -884,6 +896,10 @@ static int ubifs_symlink(struct inode *dir, struct dentry *dentry,
884 ui->data_len = len; 896 ui->data_len = len;
885 inode->i_size = ubifs_inode(inode)->ui_size = len; 897 inode->i_size = ubifs_inode(inode)->ui_size = len;
886 898
899 err = ubifs_init_security(dir, inode, &dentry->d_name);
900 if (err)
901 goto out_cancel;
902
887 mutex_lock(&dir_ui->ui_mutex); 903 mutex_lock(&dir_ui->ui_mutex);
888 dir->i_size += sz_change; 904 dir->i_size += sz_change;
889 dir_ui->ui_size = dir->i_size; 905 dir_ui->ui_size = dir->i_size;