Lines Matching defs:xattrs
89 * Check whether the inode allows writing xattrs. Specifically, we can never
467 * This function returns the names of all xattrs associated with the
474 * xattrs.
990 * @dentry: dentry to list the xattrs
1144 * @xattrs: the header of the xattr object
1157 int simple_xattr_get(struct simple_xattrs *xattrs, const char *name,
1164 read_lock(&xattrs->lock);
1165 rbp = rb_find(name, &xattrs->rb_root, rbtree_simple_xattr_cmp);
1176 read_unlock(&xattrs->lock);
1182 * @xattrs: the header of the xattr object
1206 struct simple_xattr *simple_xattr_set(struct simple_xattrs *xattrs,
1227 write_lock(&xattrs->lock);
1228 rbp = &xattrs->rb_root.rb_node;
1251 &new_xattr->rb_node, &xattrs->rb_root);
1253 rb_erase(&old_xattr->rb_node, &xattrs->rb_root);
1267 rb_insert_color(&new_xattr->rb_node, &xattrs->rb_root);
1277 write_unlock(&xattrs->lock);
1291 * @inode: inode from which to get the xattrs
1292 * @xattrs: the header of the xattr object
1293 * @buffer: the buffer to store all xattrs into
1296 * List all xattrs associated with @inode. If @buffer is NULL we returned
1298 * xattrs value into it provided it is big enough.
1305 * Return: On success the required size or the size of the copied xattrs is
1308 ssize_t simple_xattr_list(struct inode *inode, struct simple_xattrs *xattrs,
1321 read_lock(&xattrs->lock);
1322 for (rbp = rb_first(&xattrs->rb_root); rbp; rbp = rb_next(rbp)) {
1333 read_unlock(&xattrs->lock);
1356 * @xattrs: the header of the xattr object
1359 * Add an xattr object to @xattrs. This assumes no replacement or removal
1360 * of matching xattrs is wanted. Should only be called during inode
1361 * initialization when a few distinct initial xattrs are supposed to be set.
1363 void simple_xattr_add(struct simple_xattrs *xattrs,
1366 write_lock(&xattrs->lock);
1367 rb_add(&new_xattr->rb_node, &xattrs->rb_root, rbtree_simple_xattr_less);
1368 write_unlock(&xattrs->lock);
1373 * @xattrs: header to initialize
1377 void simple_xattrs_init(struct simple_xattrs *xattrs)
1379 xattrs->rb_root = RB_ROOT;
1380 rwlock_init(&xattrs->lock);
1384 * simple_xattrs_free - free xattrs
1385 * @xattrs: xattr header whose xattrs to destroy
1386 * @freed_space: approximate number of bytes of memory freed from @xattrs
1388 * Destroy all xattrs in @xattr. When this is called no one can hold a
1389 * reference to any of the xattrs anymore.
1391 void simple_xattrs_free(struct simple_xattrs *xattrs, size_t *freed_space)
1397 rbp = rb_first(&xattrs->rb_root);
1404 rb_erase(&xattr->rb_node, &xattrs->rb_root);