File tree Expand file tree Collapse file tree 5 files changed +11
-1
lines changed Expand file tree Collapse file tree 5 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -841,6 +841,9 @@ static int bch2_getattr(struct mnt_idmap *idmap,
841
841
stat -> blksize = block_bytes (c );
842
842
stat -> blocks = inode -> v .i_blocks ;
843
843
844
+ stat -> subvol = inode -> ei_subvol ;
845
+ stat -> result_mask |= STATX_SUBVOL ;
846
+
844
847
if (request_mask & STATX_BTIME ) {
845
848
stat -> result_mask |= STATX_BTIME ;
846
849
stat -> btime = bch2_time_to_timespec (c , inode -> ei_inode .bi_otime );
Original file line number Diff line number Diff line change @@ -8779,6 +8779,9 @@ static int btrfs_getattr(struct mnt_idmap *idmap,
8779
8779
generic_fillattr (idmap , request_mask , inode , stat );
8780
8780
stat -> dev = BTRFS_I (inode )-> root -> anon_dev ;
8781
8781
8782
+ stat -> subvol = BTRFS_I (inode )-> root -> root_key .objectid ;
8783
+ stat -> result_mask |= STATX_SUBVOL ;
8784
+
8782
8785
spin_lock (& BTRFS_I (inode )-> lock );
8783
8786
delalloc_bytes = BTRFS_I (inode )-> new_delalloc_bytes ;
8784
8787
inode_bytes = inode_get_bytes (inode );
Original file line number Diff line number Diff line change @@ -658,6 +658,7 @@ cp_statx(const struct kstat *stat, struct statx __user *buffer)
658
658
tmp .stx_mnt_id = stat -> mnt_id ;
659
659
tmp .stx_dio_mem_align = stat -> dio_mem_align ;
660
660
tmp .stx_dio_offset_align = stat -> dio_offset_align ;
661
+ tmp .stx_subvol = stat -> subvol ;
661
662
662
663
return copy_to_user (buffer , & tmp , sizeof (tmp )) ? - EFAULT : 0 ;
663
664
}
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ struct kstat {
53
53
u32 dio_mem_align ;
54
54
u32 dio_offset_align ;
55
55
u64 change_cookie ;
56
+ u64 subvol ;
56
57
};
57
58
58
59
/* These definitions are internal to the kernel for now. Mainly used by nfsd. */
Original file line number Diff line number Diff line change @@ -126,8 +126,9 @@ struct statx {
126
126
__u64 stx_mnt_id ;
127
127
__u32 stx_dio_mem_align ; /* Memory buffer alignment for direct I/O */
128
128
__u32 stx_dio_offset_align ; /* File offset alignment for direct I/O */
129
+ __u64 stx_subvol ; /* Subvolume identifier */
129
130
/* 0xa0 */
130
- __u64 __spare3 [12 ]; /* Spare space for future expansion */
131
+ __u64 __spare3 [11 ]; /* Spare space for future expansion */
131
132
/* 0x100 */
132
133
};
133
134
@@ -155,6 +156,7 @@ struct statx {
155
156
#define STATX_MNT_ID 0x00001000U /* Got stx_mnt_id */
156
157
#define STATX_DIOALIGN 0x00002000U /* Want/got direct I/O alignment info */
157
158
#define STATX_MNT_ID_UNIQUE 0x00004000U /* Want/got extended stx_mount_id */
159
+ #define STATX_SUBVOL 0x00008000U /* Want/got stx_subvol */
158
160
159
161
#define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */
160
162
You can’t perform that action at this time.
0 commit comments