@@ -7698,6 +7698,55 @@ static bool nfs4_xattr_list_nfs4_acl(struct dentry *dentry)
7698
7698
return nfs4_server_supports_acls (NFS_SB (dentry -> d_sb ), NFS4ACL_ACL );
7699
7699
}
7700
7700
7701
+ #if defined(CONFIG_NFS_V4_1 )
7702
+ #define XATTR_NAME_NFSV4_DACL "system.nfs4_dacl"
7703
+
7704
+ static int nfs4_xattr_set_nfs4_dacl (const struct xattr_handler * handler ,
7705
+ struct user_namespace * mnt_userns ,
7706
+ struct dentry * unused , struct inode * inode ,
7707
+ const char * key , const void * buf ,
7708
+ size_t buflen , int flags )
7709
+ {
7710
+ return nfs4_proc_set_acl (inode , buf , buflen , NFS4ACL_DACL );
7711
+ }
7712
+
7713
+ static int nfs4_xattr_get_nfs4_dacl (const struct xattr_handler * handler ,
7714
+ struct dentry * unused , struct inode * inode ,
7715
+ const char * key , void * buf , size_t buflen )
7716
+ {
7717
+ return nfs4_proc_get_acl (inode , buf , buflen , NFS4ACL_DACL );
7718
+ }
7719
+
7720
+ static bool nfs4_xattr_list_nfs4_dacl (struct dentry * dentry )
7721
+ {
7722
+ return nfs4_server_supports_acls (NFS_SB (dentry -> d_sb ), NFS4ACL_DACL );
7723
+ }
7724
+
7725
+ #define XATTR_NAME_NFSV4_SACL "system.nfs4_sacl"
7726
+
7727
+ static int nfs4_xattr_set_nfs4_sacl (const struct xattr_handler * handler ,
7728
+ struct user_namespace * mnt_userns ,
7729
+ struct dentry * unused , struct inode * inode ,
7730
+ const char * key , const void * buf ,
7731
+ size_t buflen , int flags )
7732
+ {
7733
+ return nfs4_proc_set_acl (inode , buf , buflen , NFS4ACL_SACL );
7734
+ }
7735
+
7736
+ static int nfs4_xattr_get_nfs4_sacl (const struct xattr_handler * handler ,
7737
+ struct dentry * unused , struct inode * inode ,
7738
+ const char * key , void * buf , size_t buflen )
7739
+ {
7740
+ return nfs4_proc_get_acl (inode , buf , buflen , NFS4ACL_SACL );
7741
+ }
7742
+
7743
+ static bool nfs4_xattr_list_nfs4_sacl (struct dentry * dentry )
7744
+ {
7745
+ return nfs4_server_supports_acls (NFS_SB (dentry -> d_sb ), NFS4ACL_SACL );
7746
+ }
7747
+
7748
+ #endif
7749
+
7701
7750
#ifdef CONFIG_NFS_V4_SECURITY_LABEL
7702
7751
7703
7752
static int nfs4_xattr_set_nfs4_label (const struct xattr_handler * handler ,
@@ -10615,6 +10664,22 @@ static const struct xattr_handler nfs4_xattr_nfs4_acl_handler = {
10615
10664
.set = nfs4_xattr_set_nfs4_acl ,
10616
10665
};
10617
10666
10667
+ #if defined(CONFIG_NFS_V4_1 )
10668
+ static const struct xattr_handler nfs4_xattr_nfs4_dacl_handler = {
10669
+ .name = XATTR_NAME_NFSV4_DACL ,
10670
+ .list = nfs4_xattr_list_nfs4_dacl ,
10671
+ .get = nfs4_xattr_get_nfs4_dacl ,
10672
+ .set = nfs4_xattr_set_nfs4_dacl ,
10673
+ };
10674
+
10675
+ static const struct xattr_handler nfs4_xattr_nfs4_sacl_handler = {
10676
+ .name = XATTR_NAME_NFSV4_SACL ,
10677
+ .list = nfs4_xattr_list_nfs4_sacl ,
10678
+ .get = nfs4_xattr_get_nfs4_sacl ,
10679
+ .set = nfs4_xattr_set_nfs4_sacl ,
10680
+ };
10681
+ #endif
10682
+
10618
10683
#ifdef CONFIG_NFS_V4_2
10619
10684
static const struct xattr_handler nfs4_xattr_nfs4_user_handler = {
10620
10685
.prefix = XATTR_USER_PREFIX ,
@@ -10625,6 +10690,10 @@ static const struct xattr_handler nfs4_xattr_nfs4_user_handler = {
10625
10690
10626
10691
const struct xattr_handler * nfs4_xattr_handlers [] = {
10627
10692
& nfs4_xattr_nfs4_acl_handler ,
10693
+ #if defined(CONFIG_NFS_V4_1 )
10694
+ & nfs4_xattr_nfs4_dacl_handler ,
10695
+ & nfs4_xattr_nfs4_sacl_handler ,
10696
+ #endif
10628
10697
#ifdef CONFIG_NFS_V4_SECURITY_LABEL
10629
10698
& nfs4_xattr_nfs4_label_handler ,
10630
10699
#endif
0 commit comments