Skip to content

Commit 75c5e0c

Browse files
fs/ntfs3: Changed ntfs_get_acl() to use dentry
ntfs_get_acl changed to match new interface in struct inode_operations. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent 1a6be5f commit 75c5e0c

4 files changed

Lines changed: 15 additions & 22 deletions

File tree

fs/ntfs3/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ const struct inode_operations ntfs_file_inode_operations = {
11431143
.getattr = ntfs_getattr,
11441144
.setattr = ntfs3_setattr,
11451145
.listxattr = ntfs_listxattr,
1146-
.get_inode_acl = ntfs_get_acl,
1146+
.get_acl = ntfs_get_acl,
11471147
.set_acl = ntfs_set_acl,
11481148
.fiemap = ntfs_fiemap,
11491149
};

fs/ntfs3/namei.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ const struct inode_operations ntfs_dir_inode_operations = {
607607
.rmdir = ntfs_rmdir,
608608
.mknod = ntfs_mknod,
609609
.rename = ntfs_rename,
610-
.get_inode_acl = ntfs_get_acl,
610+
.get_acl = ntfs_get_acl,
611611
.set_acl = ntfs_set_acl,
612612
.setattr = ntfs3_setattr,
613613
.getattr = ntfs_getattr,
@@ -620,7 +620,7 @@ const struct inode_operations ntfs_special_inode_operations = {
620620
.setattr = ntfs3_setattr,
621621
.getattr = ntfs_getattr,
622622
.listxattr = ntfs_listxattr,
623-
.get_inode_acl = ntfs_get_acl,
623+
.get_acl = ntfs_get_acl,
624624
.set_acl = ntfs_set_acl,
625625
};
626626

fs/ntfs3/ntfs_fs.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,11 +857,12 @@ unsigned long ntfs_names_hash(const u16 *name, size_t len, const u16 *upcase,
857857

858858
/* globals from xattr.c */
859859
#ifdef CONFIG_NTFS3_FS_POSIX_ACL
860-
struct posix_acl *ntfs_get_acl(struct inode *inode, int type, bool rcu);
860+
struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap,
861+
struct dentry *dentry, int type);
861862
int ntfs_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
862863
struct posix_acl *acl, int type);
863864
int ntfs_init_acl(struct mnt_idmap *idmap, struct inode *inode,
864-
struct inode *dir);
865+
struct inode *dir);
865866
#else
866867
#define ntfs_get_acl NULL
867868
#define ntfs_set_acl NULL

fs/ntfs3/xattr.c

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,14 @@ static noinline int ntfs_set_ea(struct inode *inode, const char *name,
520520
}
521521

522522
#ifdef CONFIG_NTFS3_FS_POSIX_ACL
523-
static struct posix_acl *ntfs_get_acl_ex(struct inode *inode, int type,
524-
int locked)
523+
524+
/*
525+
* ntfs_get_acl - inode_operations::get_acl
526+
*/
527+
struct posix_acl *ntfs_get_acl(struct mnt_idmap *idmap,
528+
struct dentry *dentry, int type)
525529
{
530+
struct inode *inode = d_inode(dentry);
526531
struct ntfs_inode *ni = ntfs_i(inode);
527532
const char *name;
528533
size_t name_len;
@@ -545,13 +550,11 @@ static struct posix_acl *ntfs_get_acl_ex(struct inode *inode, int type,
545550
name_len = sizeof(XATTR_NAME_POSIX_ACL_DEFAULT) - 1;
546551
}
547552

548-
if (!locked)
549-
ni_lock(ni);
553+
ni_lock(ni);
550554

551555
err = ntfs_get_ea(inode, name, name_len, buf, PATH_MAX, &req);
552556

553-
if (!locked)
554-
ni_unlock(ni);
557+
ni_unlock(ni);
555558

556559
/* Translate extended attribute to acl. */
557560
if (err >= 0) {
@@ -570,17 +573,6 @@ static struct posix_acl *ntfs_get_acl_ex(struct inode *inode, int type,
570573
return acl;
571574
}
572575

573-
/*
574-
* ntfs_get_acl - inode_operations::get_acl
575-
*/
576-
struct posix_acl *ntfs_get_acl(struct inode *inode, int type, bool rcu)
577-
{
578-
if (rcu)
579-
return ERR_PTR(-ECHILD);
580-
581-
return ntfs_get_acl_ex(inode, type, 0);
582-
}
583-
584576
static noinline int ntfs_set_acl_ex(struct mnt_idmap *idmap,
585577
struct inode *inode, struct posix_acl *acl,
586578
int type, bool init_acl)

0 commit comments

Comments
 (0)