Lines Matching refs:pdata
584 static void init_empty_persist_data(struct crypt_persist_data* pdata, int len) { in init_empty_persist_data() argument
585 memset(pdata, 0, len); in init_empty_persist_data()
586 pdata->persist_magic = PERSIST_DATA_MAGIC; in init_empty_persist_data()
587 pdata->persist_valid_entries = 0; in init_empty_persist_data()
600 struct crypt_persist_data* pdata; in upgrade_crypt_ftr() local
605 pdata = (crypt_persist_data*)malloc(CRYPT_PERSIST_DATA_SIZE); in upgrade_crypt_ftr()
606 if (pdata == NULL) { in upgrade_crypt_ftr()
610 memset(pdata, 0, CRYPT_PERSIST_DATA_SIZE); in upgrade_crypt_ftr()
615 free(pdata); in upgrade_crypt_ftr()
619 unix_write(fd, pdata, CRYPT_PERSIST_DATA_SIZE); in upgrade_crypt_ftr()
622 init_empty_persist_data(pdata, CRYPT_PERSIST_DATA_SIZE); in upgrade_crypt_ftr()
623 unix_write(fd, pdata, CRYPT_PERSIST_DATA_SIZE); in upgrade_crypt_ftr()
630 free(pdata); in upgrade_crypt_ftr()
764 struct crypt_persist_data* pdata = NULL; in load_persistent_data() local
780 pdata = (crypt_persist_data*)malloc(CRYPT_PERSIST_DATA_SIZE); in load_persistent_data()
781 if (pdata) { in load_persistent_data()
782 init_empty_persist_data(pdata, CRYPT_PERSIST_DATA_SIZE); in load_persistent_data()
783 persist_data = pdata; in load_persistent_data()
814 pdata = (crypt_persist_data*)malloc(crypt_ftr.persist_data_size); in load_persistent_data()
815 if (pdata == NULL) { in load_persistent_data()
825 if (unix_read(fd, pdata, crypt_ftr.persist_data_size) < 0) { in load_persistent_data()
829 if (pdata->persist_magic == PERSIST_DATA_MAGIC) { in load_persistent_data()
837 init_empty_persist_data(pdata, crypt_ftr.persist_data_size); in load_persistent_data()
841 persist_data = pdata; in load_persistent_data()
846 free(pdata); in load_persistent_data()
855 struct crypt_persist_data* pdata; in save_persistent_data() local
892 pdata = (crypt_persist_data*)malloc(crypt_ftr.persist_data_size); in save_persistent_data()
893 if (pdata == NULL) { in save_persistent_data()
903 if (unix_read(fd, pdata, crypt_ftr.persist_data_size) < 0) { in save_persistent_data()
908 if (pdata->persist_magic == PERSIST_DATA_MAGIC) { in save_persistent_data()
932 memset(pdata, 0, crypt_ftr.persist_data_size); in save_persistent_data()
933 … if (unix_write(fd, pdata, crypt_ftr.persist_data_size) != (int)crypt_ftr.persist_data_size) { in save_persistent_data()
944 free(pdata); in save_persistent_data()
949 free(pdata); in save_persistent_data()
2160 struct crypt_persist_data* pdata; in cryptfs_enable_internal() local
2333 pdata = (crypt_persist_data*)malloc(CRYPT_PERSIST_DATA_SIZE); in cryptfs_enable_internal()
2334 if (pdata) { in cryptfs_enable_internal()
2335 init_empty_persist_data(pdata, CRYPT_PERSIST_DATA_SIZE); in cryptfs_enable_internal()
2336 persist_data = pdata; in cryptfs_enable_internal()