Skip to content

Commit 590dce2

Browse files
committed
Merge branch 'rebased-statx' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs 'statx()' update from Al Viro. This adds the new extended stat() interface that internally subsumes our previous stat interfaces, and allows user mode to specify in more detail what kind of information it wants. It also allows for some explicit synchronization information to be passed to the filesystem, which can be relevant for network filesystems: is the cached value ok, or do you need open/close consistency, or what? From David Howells. Andreas Dilger points out that the first version of the extended statx interface was posted June 29, 2010: https://www.spinics.net/lists/linux-fsdevel/msg33831.html * 'rebased-statx' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: statx: Add a system call to make enhanced file info available
2 parents e0d0722 + a528d35 commit 590dce2

72 files changed

Lines changed: 822 additions & 214 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/filesystems/Locking‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ prototypes:
5858
int (*permission) (struct inode *, int, unsigned int);
5959
int (*get_acl)(struct inode *, int);
6060
int (*setattr) (struct dentry *, struct iattr *);
61-
int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *);
61+
int (*getattr) (const struct path *, struct dentry *, struct kstat *,
62+
u32, unsigned int);
6263
ssize_t (*listxattr) (struct dentry *, char *, size_t);
6364
int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len);
6465
void (*update_time)(struct inode *, struct timespec *, int);

‎Documentation/filesystems/vfs.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ struct inode_operations {
382382
int (*permission) (struct inode *, int);
383383
int (*get_acl)(struct inode *, int);
384384
int (*setattr) (struct dentry *, struct iattr *);
385-
int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
385+
int (*getattr) (const struct path *, struct dentry *, struct kstat *,
386+
u32, unsigned int);
386387
ssize_t (*listxattr) (struct dentry *, char *, size_t);
387388
void (*update_time)(struct inode *, struct timespec *, int);
388389
int (*atomic_open)(struct inode *, struct dentry *, struct file *,

‎arch/x86/entry/syscalls/syscall_32.tbl‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,3 +389,4 @@
389389
380 i386 pkey_mprotect sys_pkey_mprotect
390390
381 i386 pkey_alloc sys_pkey_alloc
391391
382 i386 pkey_free sys_pkey_free
392+
383 i386 statx sys_statx

‎arch/x86/entry/syscalls/syscall_64.tbl‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@
338338
329 common pkey_mprotect sys_pkey_mprotect
339339
330 common pkey_alloc sys_pkey_alloc
340340
331 common pkey_free sys_pkey_free
341+
332 common statx sys_statx
341342

342343
#
343344
# x32-specific system call numbers start at 512 to avoid cache impact

‎drivers/base/devtmpfs.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ static int handle_remove(const char *nodename, struct device *dev)
309309
if (d_really_is_positive(dentry)) {
310310
struct kstat stat;
311311
struct path p = {.mnt = parent.mnt, .dentry = dentry};
312-
err = vfs_getattr(&p, &stat);
312+
err = vfs_getattr(&p, &stat, STATX_TYPE | STATX_MODE,
313+
AT_STATX_SYNC_AS_STAT);
313314
if (!err && dev_mynode(dev, d_inode(dentry), &stat)) {
314315
struct iattr newattrs;
315316
/*

‎drivers/block/loop.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,8 @@ loop_get_status(struct loop_device *lo, struct loop_info64 *info)
11761176

11771177
if (lo->lo_state != Lo_bound)
11781178
return -ENXIO;
1179-
error = vfs_getattr(&file->f_path, &stat);
1179+
error = vfs_getattr(&file->f_path, &stat,
1180+
STATX_INO, AT_STATX_SYNC_AS_STAT);
11801181
if (error)
11811182
return error;
11821183
memset(info, 0, sizeof(*info));

‎drivers/mtd/ubi/build.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ static struct mtd_info * __init open_mtd_by_chdev(const char *mtd_dev)
11591159
if (err)
11601160
return ERR_PTR(err);
11611161

1162-
err = vfs_getattr(&path, &stat);
1162+
err = vfs_getattr(&path, &stat, STATX_TYPE, AT_STATX_SYNC_AS_STAT);
11631163
path_put(&path);
11641164
if (err)
11651165
return ERR_PTR(err);

‎drivers/mtd/ubi/kapi.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode)
314314
if (error)
315315
return ERR_PTR(error);
316316

317-
error = vfs_getattr(&path, &stat);
317+
error = vfs_getattr(&path, &stat, STATX_TYPE, AT_STATX_SYNC_AS_STAT);
318318
path_put(&path);
319319
if (error)
320320
return ERR_PTR(error);

‎drivers/staging/lustre/lustre/llite/file.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2952,15 +2952,16 @@ static int ll_inode_revalidate(struct dentry *dentry, __u64 ibits)
29522952
return rc;
29532953
}
29542954

2955-
int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat)
2955+
int ll_getattr(const struct path *path, struct kstat *stat,
2956+
u32 request_mask, unsigned int flags)
29562957
{
2957-
struct inode *inode = d_inode(de);
2958+
struct inode *inode = d_inode(path->dentry);
29582959
struct ll_sb_info *sbi = ll_i2sbi(inode);
29592960
struct ll_inode_info *lli = ll_i2info(inode);
29602961
int res;
29612962

2962-
res = ll_inode_revalidate(de, MDS_INODELOCK_UPDATE |
2963-
MDS_INODELOCK_LOOKUP);
2963+
res = ll_inode_revalidate(path->dentry,
2964+
MDS_INODELOCK_UPDATE | MDS_INODELOCK_LOOKUP);
29642965
ll_stats_ops_tally(sbi, LPROC_LL_GETATTR, 1);
29652966

29662967
if (res)

‎drivers/staging/lustre/lustre/llite/llite_internal.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,8 @@ int ll_file_open(struct inode *inode, struct file *file);
750750
int ll_file_release(struct inode *inode, struct file *file);
751751
int ll_release_openhandle(struct inode *, struct lookup_intent *);
752752
int ll_md_real_close(struct inode *inode, fmode_t fmode);
753-
int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat);
753+
int ll_getattr(const struct path *path, struct kstat *stat,
754+
u32 request_mask, unsigned int flags);
754755
struct posix_acl *ll_get_acl(struct inode *inode, int type);
755756
int ll_migrate(struct inode *parent, struct file *file, int mdtidx,
756757
const char *name, int namelen);

0 commit comments

Comments
 (0)