GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fs: expose frsize field in statfs · nodejs/node@db66a96

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • fs.md
  • lib/internal/fs
    • utils.js
  • src
    • node_file-inl.h
    • node_file.h
  • test/parallel
    • test-fs-promises.js
    • test-fs-statfs.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/fs.md‎

Copy file name to clipboardExpand all lines: doc/api/fs.md
+12Lines changed: 12 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -7895,6 +7895,7 @@ numeric values will be `bigint` instead of `number`.
78957895
StatFs {
78967896
type: 1397114950,
78977897
bsize: 4096,
7898+
frsize: 4096,
78987899
blocks: 121938943,
78997900
bfree: 61058895,
79007901
bavail: 61058895,
@@ -7909,6 +7910,7 @@ StatFs {
79097910
StatFs {
79107911
type: 1397114950n,
79117912
bsize: 4096n,
7913+
frsize: 4096n,
79127914
blocks: 121938943n,
79137915
bfree: 61058895n,
79147916
bavail: 61058895n,
@@ -7965,6 +7967,16 @@ added:
79657967
79667968
Optimal transfer block size.
79677969
7970+
#### `statfs.frsize`
7971+
7972+
<!-- YAML
7973+
added: REPLACEME
7974+
-->
7975+
7976+
* Type: {number|bigint}
7977+
7978+
Fundamental file system block size.
7979+
79687980
#### `statfs.ffree`
79697981
79707982
<!-- YAML
Collapse file

‎lib/internal/fs/utils.js‎

Copy file name to clipboardExpand all lines: lib/internal/fs/utils.js
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,10 @@ function getStatsFromBinding(stats, offset = 0) {
571571
}
572572

573573
class StatFs {
574-
constructor(type, bsize, blocks, bfree, bavail, files, ffree) {
574+
constructor(type, bsize, frsize, blocks, bfree, bavail, files, ffree) {
575575
this.type = type;
576576
this.bsize = bsize;
577+
this.frsize = frsize;
577578
this.blocks = blocks;
578579
this.bfree = bfree;
579580
this.bavail = bavail;
@@ -584,7 +585,7 @@ class StatFs {
584585

585586
function getStatFsFromBinding(stats) {
586587
return new StatFs(
587-
stats[0], stats[1], stats[2], stats[3], stats[4], stats[5], stats[6],
588+
stats[0], stats[1], stats[2], stats[3], stats[4], stats[5], stats[6], stats[7],
588589
);
589590
}
590591

Collapse file

‎src/node_file-inl.h‎

Copy file name to clipboardExpand all lines: src/node_file-inl.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ void FillStatFsArray(AliasedBufferBase<NativeT, V8T>* fields,
153153

154154
SET_FIELD(kType, s->f_type);
155155
SET_FIELD(kBSize, s->f_bsize);
156+
SET_FIELD(kFrSize, s->f_frsize);
156157
SET_FIELD(kBlocks, s->f_blocks);
157158
SET_FIELD(kBFree, s->f_bfree);
158159
SET_FIELD(kBAvail, s->f_bavail);
Collapse file

‎src/node_file.h‎

Copy file name to clipboardExpand all lines: src/node_file.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ constexpr size_t kFsStatsBufferLength =
4444
enum class FsStatFsOffset {
4545
kType = 0,
4646
kBSize,
47+
kFrSize,
4748
kBlocks,
4849
kBFree,
4950
kBAvail,
Collapse file

‎test/parallel/test-fs-promises.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-promises.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function verifyStatFsObject(stat, isBigint = false) {
8989
assert.strictEqual(typeof stat, 'object');
9090
assert.strictEqual(typeof stat.type, valueType);
9191
assert.strictEqual(typeof stat.bsize, valueType);
92+
assert.strictEqual(typeof stat.frsize, valueType);
9293
assert.strictEqual(typeof stat.blocks, valueType);
9394
assert.strictEqual(typeof stat.bfree, valueType);
9495
assert.strictEqual(typeof stat.bavail, valueType);
Collapse file

‎test/parallel/test-fs-statfs.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-fs-statfs.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function verifyStatFsObject(statfs, isBigint = false) {
77
const valueType = isBigint ? 'bigint' : 'number';
88

99
[
10-
'type', 'bsize', 'blocks', 'bfree', 'bavail', 'files', 'ffree',
10+
'type', 'bsize', 'frsize', 'blocks', 'bfree', 'bavail', 'files', 'ffree',
1111
].forEach((k) => {
1212
assert.ok(Object.hasOwn(statfs, k));
1313
assert.strictEqual(typeof statfs[k], valueType,

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.