@@ -896,9 +896,18 @@ static struct attribute *orangefs_default_attrs[] = {
896
896
};
897
897
ATTRIBUTE_GROUPS (orangefs_default );
898
898
899
+ static struct kobject * orangefs_obj ;
900
+
901
+ static void orangefs_obj_release (struct kobject * kobj )
902
+ {
903
+ kfree (orangefs_obj );
904
+ orangefs_obj = NULL ;
905
+ }
906
+
899
907
static struct kobj_type orangefs_ktype = {
900
908
.sysfs_ops = & orangefs_sysfs_ops ,
901
909
.default_groups = orangefs_default_groups ,
910
+ .release = orangefs_obj_release ,
902
911
};
903
912
904
913
static struct orangefs_attribute acache_hard_limit_attribute =
@@ -934,9 +943,18 @@ static struct attribute *acache_orangefs_default_attrs[] = {
934
943
};
935
944
ATTRIBUTE_GROUPS (acache_orangefs_default );
936
945
946
+ static struct kobject * acache_orangefs_obj ;
947
+
948
+ static void acache_orangefs_obj_release (struct kobject * kobj )
949
+ {
950
+ kfree (acache_orangefs_obj );
951
+ acache_orangefs_obj = NULL ;
952
+ }
953
+
937
954
static struct kobj_type acache_orangefs_ktype = {
938
955
.sysfs_ops = & orangefs_sysfs_ops ,
939
956
.default_groups = acache_orangefs_default_groups ,
957
+ .release = acache_orangefs_obj_release ,
940
958
};
941
959
942
960
static struct orangefs_attribute capcache_hard_limit_attribute =
@@ -972,9 +990,18 @@ static struct attribute *capcache_orangefs_default_attrs[] = {
972
990
};
973
991
ATTRIBUTE_GROUPS (capcache_orangefs_default );
974
992
993
+ static struct kobject * capcache_orangefs_obj ;
994
+
995
+ static void capcache_orangefs_obj_release (struct kobject * kobj )
996
+ {
997
+ kfree (capcache_orangefs_obj );
998
+ capcache_orangefs_obj = NULL ;
999
+ }
1000
+
975
1001
static struct kobj_type capcache_orangefs_ktype = {
976
1002
.sysfs_ops = & orangefs_sysfs_ops ,
977
1003
.default_groups = capcache_orangefs_default_groups ,
1004
+ .release = capcache_orangefs_obj_release ,
978
1005
};
979
1006
980
1007
static struct orangefs_attribute ccache_hard_limit_attribute =
@@ -1010,9 +1037,18 @@ static struct attribute *ccache_orangefs_default_attrs[] = {
1010
1037
};
1011
1038
ATTRIBUTE_GROUPS (ccache_orangefs_default );
1012
1039
1040
+ static struct kobject * ccache_orangefs_obj ;
1041
+
1042
+ static void ccache_orangefs_obj_release (struct kobject * kobj )
1043
+ {
1044
+ kfree (ccache_orangefs_obj );
1045
+ ccache_orangefs_obj = NULL ;
1046
+ }
1047
+
1013
1048
static struct kobj_type ccache_orangefs_ktype = {
1014
1049
.sysfs_ops = & orangefs_sysfs_ops ,
1015
1050
.default_groups = ccache_orangefs_default_groups ,
1051
+ .release = ccache_orangefs_obj_release ,
1016
1052
};
1017
1053
1018
1054
static struct orangefs_attribute ncache_hard_limit_attribute =
@@ -1048,9 +1084,18 @@ static struct attribute *ncache_orangefs_default_attrs[] = {
1048
1084
};
1049
1085
ATTRIBUTE_GROUPS (ncache_orangefs_default );
1050
1086
1087
+ static struct kobject * ncache_orangefs_obj ;
1088
+
1089
+ static void ncache_orangefs_obj_release (struct kobject * kobj )
1090
+ {
1091
+ kfree (ncache_orangefs_obj );
1092
+ ncache_orangefs_obj = NULL ;
1093
+ }
1094
+
1051
1095
static struct kobj_type ncache_orangefs_ktype = {
1052
1096
.sysfs_ops = & orangefs_sysfs_ops ,
1053
1097
.default_groups = ncache_orangefs_default_groups ,
1098
+ .release = ncache_orangefs_obj_release ,
1054
1099
};
1055
1100
1056
1101
static struct orangefs_attribute pc_acache_attribute =
@@ -1079,9 +1124,18 @@ static struct attribute *pc_orangefs_default_attrs[] = {
1079
1124
};
1080
1125
ATTRIBUTE_GROUPS (pc_orangefs_default );
1081
1126
1127
+ static struct kobject * pc_orangefs_obj ;
1128
+
1129
+ static void pc_orangefs_obj_release (struct kobject * kobj )
1130
+ {
1131
+ kfree (pc_orangefs_obj );
1132
+ pc_orangefs_obj = NULL ;
1133
+ }
1134
+
1082
1135
static struct kobj_type pc_orangefs_ktype = {
1083
1136
.sysfs_ops = & orangefs_sysfs_ops ,
1084
1137
.default_groups = pc_orangefs_default_groups ,
1138
+ .release = pc_orangefs_obj_release ,
1085
1139
};
1086
1140
1087
1141
static struct orangefs_attribute stats_reads_attribute =
@@ -1103,19 +1157,20 @@ static struct attribute *stats_orangefs_default_attrs[] = {
1103
1157
};
1104
1158
ATTRIBUTE_GROUPS (stats_orangefs_default );
1105
1159
1160
+ static struct kobject * stats_orangefs_obj ;
1161
+
1162
+ static void stats_orangefs_obj_release (struct kobject * kobj )
1163
+ {
1164
+ kfree (stats_orangefs_obj );
1165
+ stats_orangefs_obj = NULL ;
1166
+ }
1167
+
1106
1168
static struct kobj_type stats_orangefs_ktype = {
1107
1169
.sysfs_ops = & orangefs_sysfs_ops ,
1108
1170
.default_groups = stats_orangefs_default_groups ,
1171
+ .release = stats_orangefs_obj_release ,
1109
1172
};
1110
1173
1111
- static struct kobject * orangefs_obj ;
1112
- static struct kobject * acache_orangefs_obj ;
1113
- static struct kobject * capcache_orangefs_obj ;
1114
- static struct kobject * ccache_orangefs_obj ;
1115
- static struct kobject * ncache_orangefs_obj ;
1116
- static struct kobject * pc_orangefs_obj ;
1117
- static struct kobject * stats_orangefs_obj ;
1118
-
1119
1174
int orangefs_sysfs_init (void )
1120
1175
{
1121
1176
int rc = - EINVAL ;
0 commit comments