Lines Matching refs:global
228 struct fuse_global* global; member
492 node->graft_path = fuse->global->obb_path; in derive_permissions_locked()
493 node->graft_pathlen = strlen(fuse->global->obb_path); in derive_permissions_locked()
502 appid = (appid_t) (uintptr_t) hashmapGet(fuse->global->package_to_appid, node->name); in derive_permissions_locked()
558 if (fuse->global->inode_ctr == 0) { in create_node_locked()
584 node->ino = fuse->global->inode_ctr++; in create_node_locked()
585 node->gen = fuse->global->next_generation++; in create_node_locked()
639 return &fuse->global->root; in lookup_node_by_id_locked()
724 pthread_mutex_lock(&fuse->global->lock); in fuse_reply_entry()
727 pthread_mutex_unlock(&fuse->global->lock); in fuse_reply_entry()
736 pthread_mutex_unlock(&fuse->global->lock); in fuse_reply_entry()
796 pthread_mutex_lock(&fuse->global->lock); in handle_lookup()
801 pthread_mutex_unlock(&fuse->global->lock); in handle_lookup()
819 pthread_mutex_lock(&fuse->global->lock); in handle_forget()
829 pthread_mutex_unlock(&fuse->global->lock); in handle_forget()
839 pthread_mutex_lock(&fuse->global->lock); in handle_getattr()
843 pthread_mutex_unlock(&fuse->global->lock); in handle_getattr()
862 pthread_mutex_lock(&fuse->global->lock); in handle_setattr()
866 pthread_mutex_unlock(&fuse->global->lock); in handle_setattr()
926 pthread_mutex_lock(&fuse->global->lock); in handle_mknod()
931 pthread_mutex_unlock(&fuse->global->lock); in handle_mknod()
955 pthread_mutex_lock(&fuse->global->lock); in handle_mkdir()
960 pthread_mutex_unlock(&fuse->global->lock); in handle_mkdir()
985 snprintf(nomedia, PATH_MAX, "%s/.nomedia", fuse->global->obb_path); in handle_mkdir()
1003 pthread_mutex_lock(&fuse->global->lock); in handle_unlink()
1008 pthread_mutex_unlock(&fuse->global->lock); in handle_unlink()
1020 pthread_mutex_lock(&fuse->global->lock); in handle_unlink()
1025 pthread_mutex_unlock(&fuse->global->lock); in handle_unlink()
1030 if (fuse != fuse->global->fuse_default) { in handle_unlink()
1031 fuse_notify_delete(fuse->global->fuse_default, parent_node->nid, child_node->nid, name); in handle_unlink()
1033 if (fuse != fuse->global->fuse_read) { in handle_unlink()
1034 fuse_notify_delete(fuse->global->fuse_read, parent_node->nid, child_node->nid, name); in handle_unlink()
1036 if (fuse != fuse->global->fuse_write) { in handle_unlink()
1037 fuse_notify_delete(fuse->global->fuse_write, parent_node->nid, child_node->nid, name); in handle_unlink()
1051 pthread_mutex_lock(&fuse->global->lock); in handle_rmdir()
1056 pthread_mutex_unlock(&fuse->global->lock); in handle_rmdir()
1068 pthread_mutex_lock(&fuse->global->lock); in handle_rmdir()
1073 pthread_mutex_unlock(&fuse->global->lock); in handle_rmdir()
1078 if (fuse != fuse->global->fuse_default) { in handle_rmdir()
1079 fuse_notify_delete(fuse->global->fuse_default, parent_node->nid, child_node->nid, name); in handle_rmdir()
1081 if (fuse != fuse->global->fuse_read) { in handle_rmdir()
1082 fuse_notify_delete(fuse->global->fuse_read, parent_node->nid, child_node->nid, name); in handle_rmdir()
1084 if (fuse != fuse->global->fuse_write) { in handle_rmdir()
1085 fuse_notify_delete(fuse->global->fuse_write, parent_node->nid, child_node->nid, name); in handle_rmdir()
1105 pthread_mutex_lock(&fuse->global->lock); in handle_rename()
1133 pthread_mutex_unlock(&fuse->global->lock); in handle_rename()
1154 pthread_mutex_lock(&fuse->global->lock); in handle_rename()
1165 pthread_mutex_lock(&fuse->global->lock); in handle_rename()
1169 pthread_mutex_unlock(&fuse->global->lock); in handle_rename()
1192 pthread_mutex_lock(&fuse->global->lock); in handle_open()
1196 pthread_mutex_unlock(&fuse->global->lock); in handle_open()
1283 pthread_mutex_lock(&fuse->global->lock); in handle_statfs()
1285 res = get_node_path_locked(&fuse->global->root, path, sizeof(path)); in handle_statfs()
1286 pthread_mutex_unlock(&fuse->global->lock); in handle_statfs()
1290 if (statfs(fuse->global->root.name, &stat) < 0) { in handle_statfs()
1357 pthread_mutex_lock(&fuse->global->lock); in handle_opendir()
1361 pthread_mutex_unlock(&fuse->global->lock); in handle_opendir()
1651 static int read_package_list(struct fuse_global* global) { in read_package_list() argument
1652 pthread_mutex_lock(&global->lock); in read_package_list()
1654 hashmapForEach(global->package_to_appid, remove_str_to_int, global->package_to_appid); in read_package_list()
1659 pthread_mutex_unlock(&global->lock); in read_package_list()
1671 hashmapPut(global->package_to_appid, package_name_dup, (void*) (uintptr_t) appid); in read_package_list()
1676 hashmapSize(global->package_to_appid)); in read_package_list()
1680 derive_permissions_recursive_locked(global->fuse_default, &global->root); in read_package_list()
1682 pthread_mutex_unlock(&global->lock); in read_package_list()
1686 static void watch_package_list(struct fuse_global* global) { in watch_package_list() argument
1714 if (read_package_list(global) == -1) { in watch_package_list()
1772 fuse->fd, fuse->global->uid, fuse->global->gid); in fuse_setup()
1787 struct fuse_global global; in run() local
1798 memset(&global, 0, sizeof(global)); in run()
1806 pthread_mutex_init(&global.lock, NULL); in run()
1807 global.package_to_appid = hashmapCreate(256, str_hash, str_icase_equals); in run()
1808 global.uid = uid; in run()
1809 global.gid = gid; in run()
1810 global.multi_user = multi_user; in run()
1811 global.next_generation = 0; in run()
1812 global.inode_ctr = 1; in run()
1814 memset(&global.root, 0, sizeof(global.root)); in run()
1815 global.root.nid = FUSE_ROOT_ID; /* 1 */ in run()
1816 global.root.refcount = 2; in run()
1817 global.root.namelen = strlen(source_path); in run()
1818 global.root.name = strdup(source_path); in run()
1819 global.root.userid = userid; in run()
1820 global.root.uid = AID_ROOT; in run()
1821 global.root.under_android = false; in run()
1823 strcpy(global.source_path, source_path); in run()
1826 global.root.perm = PERM_PRE_ROOT; in run()
1827 snprintf(global.obb_path, sizeof(global.obb_path), "%s/obb", source_path); in run()
1829 global.root.perm = PERM_ROOT; in run()
1830 snprintf(global.obb_path, sizeof(global.obb_path), "%s/Android/obb", source_path); in run()
1833 fuse_default.global = &global; in run()
1834 fuse_read.global = &global; in run()
1835 fuse_write.global = &global; in run()
1837 global.fuse_default = &fuse_default; in run()
1838 global.fuse_read = &fuse_read; in run()
1839 global.fuse_write = &fuse_write; in run()
1891 fs_prepare_dir(global.obb_path, 0775, uid, gid); in run()
1901 watch_package_list(&global); in run()