Source
38
38
stat->nlink = inode->i_nlink;
39
39
stat->uid = inode->i_uid;
40
40
stat->gid = inode->i_gid;
41
41
stat->rdev = inode->i_rdev;
42
42
stat->size = i_size_read(inode);
43
43
stat->atime = inode->i_atime;
44
44
stat->mtime = inode->i_mtime;
45
45
stat->ctime = inode->i_ctime;
46
46
stat->blksize = i_blocksize(inode);
47
47
stat->blocks = inode->i_blocks;
48
-
49
-
if (IS_NOATIME(inode))
50
-
stat->result_mask &= ~STATX_ATIME;
51
-
if (IS_AUTOMOUNT(inode))
52
-
stat->attributes |= STATX_ATTR_AUTOMOUNT;
53
48
}
54
49
EXPORT_SYMBOL(generic_fillattr);
55
50
56
51
/**
57
52
* vfs_getattr_nosec - getattr without security checks
58
53
* @path: file to get attributes from
59
54
* @stat: structure to return attributes in
60
55
* @request_mask: STATX_xxx flags indicating what the caller wants
61
56
* @query_flags: Query mode (KSTAT_QUERY_FLAGS)
62
57
*
68
63
*/
69
64
int vfs_getattr_nosec(const struct path *path, struct kstat *stat,
70
65
u32 request_mask, unsigned int query_flags)
71
66
{
72
67
struct inode *inode = d_backing_inode(path->dentry);
73
68
74
69
memset(stat, 0, sizeof(*stat));
75
70
stat->result_mask |= STATX_BASIC_STATS;
76
71
request_mask &= STATX_ALL;
77
72
query_flags &= KSTAT_QUERY_FLAGS;
73
+
74
+
/* allow the fs to override these if it really wants to */
75
+
if (IS_NOATIME(inode))
76
+
stat->result_mask &= ~STATX_ATIME;
77
+
if (IS_AUTOMOUNT(inode))
78
+
stat->attributes |= STATX_ATTR_AUTOMOUNT;
79
+
78
80
if (inode->i_op->getattr)
79
81
return inode->i_op->getattr(path, stat, request_mask,
80
82
query_flags);
81
83
82
84
generic_fillattr(inode, stat);
83
85
return 0;
84
86
}
85
87
EXPORT_SYMBOL(vfs_getattr_nosec);
86
88
87
89
/*