History

GFS2: Allocate block for xattr at inode alloc time, if required

This is another step towards improving the allocation of xattr blocks at inode allocation time. Here we take advantage of Christoph's recent work on ACLs to allocate a block for the xattrs early if we know that we will be adding ACLs to the inode later on. The advantage of that is that it is much more likely that we'll get a contiguous run of two blocks where the first is the inode and the second is the xattr block. We still have to fall back to the original system in case we don't get the requested two contiguous blocks, or in case the ACLs are too large to fit into the block. Future patches will move more of the ACL setting code further up the gfs2_inode_create() function. Also, I'd like to be able to do the same thing with the xattrs from LSMs in due course, too. That way we should be able to slowly reduce the number of independent transactions, at least in the most common cases.

Steven Whitehouse committed 12 years ago

Commit b2c8b3e1 parent 885bcec3 files · +46 −10Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/gfs2_ondisk.h+2−2
@@ -347,9 +347,9 @@ struct gfs2_leaf { · 346 unmodified lines
347347 * metadata header. Each inode, if it has extended attributes, will
348348 * have either a single block containing the extended attribute headers
349349 * or a single indirect block pointing to blocks containing the
350− * extended attribure headers.
350+ * extended attribute headers.
351351 *
352− * The maximim size of the data part of an extended attribute is 64k
352+ * The maximum size of the data part of an extended attribute is 64k
353353 * so the number of blocks required depends upon block size. Since the
354354 * block size also determines the number of pointers in an indirect
355355 * block, its a fairly complicated calculation to work out the maximum