Lines Matching refs:pdata
738 static void init_empty_persist_data(struct crypt_persist_data* pdata, int len) { in init_empty_persist_data() argument
739 memset(pdata, 0, len); in init_empty_persist_data()
740 pdata->persist_magic = PERSIST_DATA_MAGIC; in init_empty_persist_data()
741 pdata->persist_valid_entries = 0; in init_empty_persist_data()
754 struct crypt_persist_data* pdata; in upgrade_crypt_ftr() local
759 pdata = (crypt_persist_data*)malloc(CRYPT_PERSIST_DATA_SIZE); in upgrade_crypt_ftr()
760 if (pdata == NULL) { in upgrade_crypt_ftr()
764 memset(pdata, 0, CRYPT_PERSIST_DATA_SIZE); in upgrade_crypt_ftr()
769 free(pdata); in upgrade_crypt_ftr()
773 unix_write(fd, pdata, CRYPT_PERSIST_DATA_SIZE); in upgrade_crypt_ftr()
776 init_empty_persist_data(pdata, CRYPT_PERSIST_DATA_SIZE); in upgrade_crypt_ftr()
777 unix_write(fd, pdata, CRYPT_PERSIST_DATA_SIZE); in upgrade_crypt_ftr()
784 free(pdata); in upgrade_crypt_ftr()
918 struct crypt_persist_data* pdata = NULL; in load_persistent_data() local
934 pdata = (crypt_persist_data*)malloc(CRYPT_PERSIST_DATA_SIZE); in load_persistent_data()
935 if (pdata) { in load_persistent_data()
936 init_empty_persist_data(pdata, CRYPT_PERSIST_DATA_SIZE); in load_persistent_data()
937 persist_data = pdata; in load_persistent_data()
968 pdata = (crypt_persist_data*)malloc(crypt_ftr.persist_data_size); in load_persistent_data()
969 if (pdata == NULL) { in load_persistent_data()
979 if (unix_read(fd, pdata, crypt_ftr.persist_data_size) < 0) { in load_persistent_data()
983 if (pdata->persist_magic == PERSIST_DATA_MAGIC) { in load_persistent_data()
991 init_empty_persist_data(pdata, crypt_ftr.persist_data_size); in load_persistent_data()
995 persist_data = pdata; in load_persistent_data()
1000 free(pdata); in load_persistent_data()
1009 struct crypt_persist_data* pdata; in save_persistent_data() local
1046 pdata = (crypt_persist_data*)malloc(crypt_ftr.persist_data_size); in save_persistent_data()
1047 if (pdata == NULL) { in save_persistent_data()
1057 if (unix_read(fd, pdata, crypt_ftr.persist_data_size) < 0) { in save_persistent_data()
1062 if (pdata->persist_magic == PERSIST_DATA_MAGIC) { in save_persistent_data()
1086 memset(pdata, 0, crypt_ftr.persist_data_size); in save_persistent_data()
1087 … if (unix_write(fd, pdata, crypt_ftr.persist_data_size) != (int)crypt_ftr.persist_data_size) { in save_persistent_data()
1098 free(pdata); in save_persistent_data()
1103 free(pdata); in save_persistent_data()
2147 struct crypt_persist_data* pdata; in cryptfs_enable_internal() local
2310 pdata = (crypt_persist_data*)malloc(CRYPT_PERSIST_DATA_SIZE); in cryptfs_enable_internal()
2311 if (pdata) { in cryptfs_enable_internal()
2312 init_empty_persist_data(pdata, CRYPT_PERSIST_DATA_SIZE); in cryptfs_enable_internal()
2313 persist_data = pdata; in cryptfs_enable_internal()