@@ -147,10 +147,10 @@ static inline long sc_su_task(const char *key, pid_t tid, struct su_profile *pro
147147 * @param dlen
148148 * @return long
149149 */
150- static inline long sc_kstorage_write (const char * key , int gid , long did , void * data , int offset , int dlen )
150+ static inline long sc_kstorage_write (const char * key , int gid , long did , struct data_item * data )
151151{
152152 if (!key || !key [0 ]) return - EINVAL ;
153- long ret = syscall (__NR_supercall , key , ver_and_cmd (key , SUPERCALL_KSTORAGE_WRITE ), gid , did , data , ((( long ) offset << 32 ) | dlen ) );
153+ long ret = syscall (__NR_supercall , key , ver_and_cmd (key , SUPERCALL_KSTORAGE_WRITE ), gid , did , data );
154154 return ret ;
155155}
156156
@@ -164,10 +164,10 @@ static inline long sc_kstorage_write(const char *key, int gid, long did, void *d
164164 * @param dlen
165165 * @return long
166166 */
167- static inline long sc_kstorage_read (const char * key , int gid , long did , void * out_data , int offset , int dlen )
167+ static inline long sc_kstorage_read (const char * key , int gid , long did , struct data_item * out_data )
168168{
169169 if (!key || !key [0 ]) return - EINVAL ;
170- long ret = syscall (__NR_supercall , key , ver_and_cmd (key , SUPERCALL_KSTORAGE_READ ), gid , did , out_data , ((( long ) offset << 32 ) | dlen ) );
170+ long ret = syscall (__NR_supercall , key , ver_and_cmd (key , SUPERCALL_KSTORAGE_READ ), gid , did , out_data );
171171 return ret ;
172172}
173173
@@ -216,7 +216,13 @@ static inline long sc_kstorage_remove(const char *key, int gid, long did)
216216static inline long sc_set_ap_mod_exclude (const char * key , uid_t uid , int exclude )
217217{
218218 if (exclude ) {
219- return sc_kstorage_write (key , KSTORAGE_EXCLUDE_LIST_GROUP , uid , & exclude , 0 , sizeof (exclude ));
219+ struct data_item data_item = {
220+ .data = & exclude ,
221+ .dlen = sizeof (exclude ),
222+ .offset = 0 ,
223+ };
224+
225+ return sc_kstorage_write (key , KSTORAGE_EXCLUDE_LIST_GROUP , uid , & data_item );
220226 } else {
221227 return sc_kstorage_remove (key , KSTORAGE_EXCLUDE_LIST_GROUP , uid );
222228 }
@@ -234,7 +240,12 @@ static inline long sc_set_ap_mod_exclude(const char *key, uid_t uid, int exclude
234240static inline int sc_get_ap_mod_exclude (const char * key , uid_t uid )
235241{
236242 int exclude = 0 ;
237- int rc = sc_kstorage_read (key , KSTORAGE_EXCLUDE_LIST_GROUP , uid , & exclude , 0 , sizeof (exclude ));
243+ struct data_item data_item = {
244+ .data = & exclude ,
245+ .dlen = sizeof (exclude ),
246+ .offset = 0 ,
247+ };
248+ int rc = sc_kstorage_read (key , KSTORAGE_EXCLUDE_LIST_GROUP , uid , & data_item );
238249 if (rc < 0 ) return 0 ;
239250 return exclude ;
240251}
0 commit comments