Lines Matching refs:xce

93 static inline void xattr_cache_remove_entry(xattr_cache_entry *xce) {  in xattr_cache_remove_entry()  argument
94 if (xce->hashnext) { in xattr_cache_remove_entry()
95 xce->hashnext->hashprev = xce->hashprev; in xattr_cache_remove_entry()
97 *(xce->hashprev) = xce->hashnext; in xattr_cache_remove_entry()
98 if (xce->lrunext) { in xattr_cache_remove_entry()
99 xce->lrunext->lruprev = xce->lruprev; in xattr_cache_remove_entry()
101 lrutail = xce->lruprev; in xattr_cache_remove_entry()
103 *(xce->lruprev) = xce->lrunext; in xattr_cache_remove_entry()
104 if (xce->name) { in xattr_cache_remove_entry()
105 free((uint8_t*)(xce->name)); in xattr_cache_remove_entry()
107 xattr_cache_value_dec(xce->value); in xattr_cache_remove_entry()
108 free(xce); in xattr_cache_remove_entry()
112 xattr_cache_entry *xce; in xattr_cache_new() local
115 xce = malloc(sizeof(xattr_cache_entry)); in xattr_cache_new()
116 passert(xce); in xattr_cache_new()
117 xce->hash = hash; in xattr_cache_new()
118 xce->node = node; in xattr_cache_new()
119 xce->uid = uid; in xattr_cache_new()
120 xce->gid = gid; in xattr_cache_new()
121 xce->nleng = nleng; in xattr_cache_new()
123 xce->name = malloc(nleng); in xattr_cache_new()
124 passert(xce->name); in xattr_cache_new()
125 memcpy((uint8_t*)(xce->name),name,nleng); in xattr_cache_new()
127 xce->name = NULL; in xattr_cache_new()
129 xce->vleng = vleng; in xattr_cache_new()
130 xce->value = xattr_cache_value_alloc(); in xattr_cache_new()
132 xce->value->value = malloc(vleng); in xattr_cache_new()
133 passert(xce->value->value); in xattr_cache_new()
134 memcpy((uint8_t*)(xce->value->value),value,vleng); in xattr_cache_new()
136 xce->status = status; in xattr_cache_new()
137 xce->utimestamp = utimestamp; in xattr_cache_new()
138 xce->hashnext = hashtab[hash%HASHSIZE]; in xattr_cache_new()
139 xce->hashprev = hashtab+(hash%HASHSIZE); in xattr_cache_new()
140 if (xce->hashnext) { in xattr_cache_new()
141 xce->hashnext->hashprev = &(xce->hashnext); in xattr_cache_new()
143 hashtab[hash%HASHSIZE] = xce; in xattr_cache_new()
144 xce->lrunext = NULL; in xattr_cache_new()
145 xce->lruprev = lrutail; in xattr_cache_new()
146 *lrutail = xce; in xattr_cache_new()
147 lrutail = &(xce->lrunext); in xattr_cache_new()
152 xattr_cache_entry *xce; in xattr_cache_find() local
155 for (xce = hashtab[hash%HASHSIZE] ; xce!=NULL ; xce=xce->hashnext) { in xattr_cache_find()
156 …if (xce->hash == hash && xce->node == node && xce->uid == uid && xce->gid == gid && xce->nleng == … in xattr_cache_find()
157 return xce; in xattr_cache_find()
165 xattr_cache_entry *xce,*nxce; in xattr_cache_delete() local
167 xce = hashtab[hash%HASHSIZE]; in xattr_cache_delete()
168 while (xce) { in xattr_cache_delete()
169 nxce = xce->hashnext; in xattr_cache_delete()
170 …if (xce->hash == hash && xce->node == node && xce->nleng == nleng && memcmp(xce->name,name,nleng)=… in xattr_cache_delete()
171 xattr_cache_remove_entry(xce); in xattr_cache_delete()
173 xce = nxce; in xattr_cache_delete()
178 xattr_cache_entry *xce,*nxce; in xattr_cache_invalidate() local
179 xce = lruhead; in xattr_cache_invalidate()
180 while (xce!=NULL && xce->utimestamp < utimestamp) { in xattr_cache_invalidate()
181 nxce = xce->lrunext; in xattr_cache_invalidate()
182 xattr_cache_remove_entry(xce); in xattr_cache_invalidate()
183 xce = nxce; in xattr_cache_invalidate()
191 xattr_cache_entry *xce; in xattr_cache_get() local
196 xce = xattr_cache_find(node,uid,gid,nleng,name); in xattr_cache_get()
197 if (xce==NULL) { in xattr_cache_get()
201 *value = xce->value->value; in xattr_cache_get()
204 *vleng = xce->vleng; in xattr_cache_get()
207 *status = xce->status; in xattr_cache_get()
209 v = xce->value; in xattr_cache_get()
218 xattr_cache_entry *xce; in xattr_cache_set() local
220 xce = xattr_cache_find(node,uid,gid,nleng,name); in xattr_cache_set()
221 if (xce!=NULL) { in xattr_cache_set()
222 xattr_cache_remove_entry(xce); in xattr_cache_set()