Merge of master-melb:xfs-cmds:24371a by kenmcd.
char *rtname,
int unwritten,
int dirversion,
- int logversion)
+ int logversion,
+ int attrversion)
{
printf(_(
"meta-data=%-22s isize=%-6u agcount=%u, agsize=%u blks\n"
- " =%-22s sectsz=%-5u\n"
+ " =%-22s sectsz=%-5u attr=%u\n"
"data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n"
" =%-22s sunit=%-6u swidth=%u blks, unwritten=%u\n"
"naming =version %-14u bsize=%-6u\n"
"realtime =%-22s extsz=%-6u blocks=%llu, rtextents=%llu\n"),
mntpoint, geo.inodesize, geo.agcount, geo.agblocks,
- "", geo.sectsize,
+ "", geo.sectsize, attrversion,
"", geo.blocksize, (unsigned long long)geo.datablocks,
geo.imaxpct,
"", geo.sunit, geo.swidth, unwritten,
int c; /* current option character */
long long ddsize; /* device size in 512-byte blocks */
int dflag; /* -d flag */
+ int attrversion;/* attribute version number */
int dirversion; /* directory version number */
int logversion; /* log version number */
long long dlsize; /* device size in 512-byte blocks */
unwritten = geo.flags & XFS_FSOP_GEOM_FLAGS_EXTFLG ? 1 : 0;
dirversion = geo.flags & XFS_FSOP_GEOM_FLAGS_DIRV2 ? 2 : 1;
logversion = geo.flags & XFS_FSOP_GEOM_FLAGS_LOGV2 ? 2 : 1;
+ attrversion = geo.flags & XFS_FSOP_GEOM_FLAGS_ATTR2 ? 2 : \
+ (geo.flags & XFS_FSOP_GEOM_FLAGS_ATTR ? 1 : 0);
if (nflag) {
report_info(geo, datadev, isint, logdev, rtdev,
- unwritten, dirversion, logversion);
+ unwritten, dirversion, logversion, attrversion);
exit(0);
}
}
report_info(geo, datadev, isint, logdev, rtdev,
- unwritten, dirversion, logversion);
+ unwritten, dirversion, logversion, attrversion);
ddsize = xi.dsize;
dlsize = ( xi.logBBsize? xi.logBBsize :
(XFS_SB_VERSION_NUMBITS | \
XFS_SB_VERSION_OKREALFBITS | \
XFS_SB_VERSION_OKSASHFBITS)
-#define XFS_SB_VERSION_MKFS(ia,dia,extflag,dirv2,na,sflag,morebits) \
- (((ia) || (dia) || (extflag) || (dirv2) || (na) || (sflag) || \
- (morebits)) ? \
+#define XFS_SB_VERSION_MKFS(ia,dia,extflag,dirv2,logv2,attrv1,sflag,morebits) \
+ (((ia) || (dia) || (extflag) || (dirv2) || (logv2) || (attrv1) || \
+ (sflag) || (morebits)) ? \
(XFS_SB_VERSION_4 | \
((ia) ? XFS_SB_VERSION_ALIGNBIT : 0) | \
((dia) ? XFS_SB_VERSION_DALIGNBIT : 0) | \
((extflag) ? XFS_SB_VERSION_EXTFLGBIT : 0) | \
((dirv2) ? XFS_SB_VERSION_DIRV2BIT : 0) | \
- ((na) ? XFS_SB_VERSION_LOGV2BIT : 0) | \
+ ((logv2) ? XFS_SB_VERSION_LOGV2BIT : 0) | \
+ ((attrv1) ? XFS_SB_VERSION_ATTRBIT : 0) | \
((sflag) ? XFS_SB_VERSION_SECTORBIT : 0) | \
((morebits) ? XFS_SB_VERSION_MOREBITSBIT : 0)) : \
XFS_SB_VERSION_1)
/*
* mkfs macro to set up sb_features2 word
*/
-#define XFS_SB_VERSION2_MKFS(resvd1, sbcntr) 0
+#define XFS_SB_VERSION2_MKFS(resvd1, sbcntr, attrv2) \
+ (((attrv2) ? XFS_SB_VERSION2_ATTR2BIT : 0))
typedef struct xfs_sb
{
significant bits in an inode number
is affected by filesystem geometry. In
practice, filesystem size and inode size are the predominant factors.
-The Linux kernel and most applications cannot currently handle
-inode numbers greater than 32 significant bits, so if no
-inode size is given on the command line,
+The Linux kernel (on 32 bit hardware platforms) and most applications
+cannot currently handle inode numbers greater than 32 significant bits,
+so if no inode size is given on the command line,
.I mkfs.xfs
will attempt to choose a size
such that inode numbers will be < 32 bits. If an inode size
filesystem needs to be mountable by a version of IRIX
that does not have the inode alignment feature
(any release of IRIX before 6.2, and IRIX 6.2 without XFS patches).
+.IP
+The option
+.BI attr[= value ]
+is used to specify the version of extended attribute inline allocation
+policy to be used.
+By default, this is zero. Once extended attributes are used for the
+first time, the version will be set to either one or two.
+The current version (two) uses a more efficient algorithm for managing
+the available inline inode space than version one does, however, for
+backward compatibility reasons (and in the absence of the \f3attr\f1=\f22\f1
+mkfs option, or the \f2attr2\f1 mount option), version one will be selected
+by default when attributes are first used on a filesystem.
.TP
.B \-l
Log section options.
"perblock",
#define I_SIZE 4
"size",
+#define I_ATTR 5
+ "attr",
NULL
};
xfs_agnumber_t agno;
__uint64_t agsize;
xfs_alloc_rec_t *arec;
+ int attrversion;
xfs_btree_sblock_t *block;
int blflag;
int blocklog;
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+ attrversion = 0;
blflag = bsflag = slflag = ssflag = lslflag = lssflag = 0;
blocklog = blocksize = 0;
sectorlog = lsectorlog = XFS_MIN_SECTORSIZE_LOG;
inodelog = libxfs_highbit32(isize);
isflag = 1;
break;
+ case I_ATTR:
+ if (!value)
+ reqval('i', iopts, I_ATTR);
+ c = atoi(value);
+ if (c < 0 || c > 2)
+ illegal(value, "i attr");
+ attrversion = c;
+ break;
default:
unknown('i', value);
}
if (!qflag || Nflag) {
printf(_(
"meta-data=%-22s isize=%-6d agcount=%lld, agsize=%lld blks\n"
- " =%-22s sectsz=%-5u\n"
+ " =%-22s sectsz=%-5u attr=%u\n"
"data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n"
" =%-22s sunit=%-6u swidth=%u blks, unwritten=%u\n"
"naming =version %-14u bsize=%-6u\n"
" =%-22s sectsz=%-5u sunit=%d blks\n"
"realtime =%-22s extsz=%-6d blocks=%lld, rtextents=%lld\n"),
dfile, isize, (long long)agcount, (long long)agsize,
- "", sectorsize,
+ "", sectorsize, attrversion,
"", blocksize, (long long)dblocks,
imflag ? imaxpct : XFS_DFL_IMAXIMUM_PCT,
"", dsunit, dswidth, extent_flagging,
}
sbp->sb_versionnum =
XFS_SB_VERSION_MKFS(iaflag, dsunit != 0, extent_flagging,
- dirversion == 2, logversion == 2,
+ dirversion == 2, logversion == 2, attrversion == 1,
(sectorsize != BBSIZE || lsectorsize != BBSIZE),
- (0 /*mmr*/ || 0 /*lazy_sb_counters*/));
- sbp->sb_features2 = XFS_SB_VERSION2_MKFS(0 /*mmr*/, 0);
+ (0/*mmr*/|| 0/*lazy_sb_counters*/ || attrversion == 2));
+ sbp->sb_features2 = XFS_SB_VERSION2_MKFS(0/*mmr*/,0/*lazy_sb_counters*/,
+ attrversion == 2);
/*
* Zero out the beginning of the device, to obliterate any old