mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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
This commit is contained in:
commit
590dce2d49
72 changed files with 822 additions and 214 deletions
|
|
@ -347,7 +347,8 @@ static int ovl_copy_up_one(struct dentry *parent, struct dentry *dentry,
|
|||
ovl_path_upper(parent, &parentpath);
|
||||
upperdir = parentpath.dentry;
|
||||
|
||||
err = vfs_getattr(&parentpath, &pstat);
|
||||
err = vfs_getattr(&parentpath, &pstat,
|
||||
STATX_ATIME | STATX_MTIME, AT_STATX_SYNC_AS_STAT);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
|
|
@ -410,7 +411,8 @@ int ovl_copy_up_flags(struct dentry *dentry, int flags)
|
|||
}
|
||||
|
||||
ovl_path_lower(next, &lowerpath);
|
||||
err = vfs_getattr(&lowerpath, &stat);
|
||||
err = vfs_getattr(&lowerpath, &stat,
|
||||
STATX_BASIC_STATS, AT_STATX_SYNC_AS_STAT);
|
||||
/* maybe truncate regular file. this has no effect on dirs */
|
||||
if (flags & O_TRUNC)
|
||||
stat.size = 0;
|
||||
|
|
|
|||
|
|
@ -138,9 +138,10 @@ static int ovl_set_opaque(struct dentry *dentry, struct dentry *upperdentry)
|
|||
return err;
|
||||
}
|
||||
|
||||
static int ovl_dir_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
||||
struct kstat *stat)
|
||||
static int ovl_dir_getattr(const struct path *path, struct kstat *stat,
|
||||
u32 request_mask, unsigned int flags)
|
||||
{
|
||||
struct dentry *dentry = path->dentry;
|
||||
int err;
|
||||
enum ovl_path_type type;
|
||||
struct path realpath;
|
||||
|
|
@ -148,7 +149,7 @@ static int ovl_dir_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
|||
|
||||
type = ovl_path_real(dentry, &realpath);
|
||||
old_cred = ovl_override_creds(dentry->d_sb);
|
||||
err = vfs_getattr(&realpath, stat);
|
||||
err = vfs_getattr(&realpath, stat, request_mask, flags);
|
||||
revert_creds(old_cred);
|
||||
if (err)
|
||||
return err;
|
||||
|
|
@ -264,7 +265,8 @@ static struct dentry *ovl_clear_empty(struct dentry *dentry,
|
|||
goto out;
|
||||
|
||||
ovl_path_upper(dentry, &upperpath);
|
||||
err = vfs_getattr(&upperpath, &stat);
|
||||
err = vfs_getattr(&upperpath, &stat,
|
||||
STATX_BASIC_STATS, AT_STATX_SYNC_AS_STAT);
|
||||
if (err)
|
||||
goto out_unlock;
|
||||
|
||||
|
|
|
|||
|
|
@ -57,16 +57,17 @@ out:
|
|||
return err;
|
||||
}
|
||||
|
||||
static int ovl_getattr(struct vfsmount *mnt, struct dentry *dentry,
|
||||
struct kstat *stat)
|
||||
static int ovl_getattr(const struct path *path, struct kstat *stat,
|
||||
u32 request_mask, unsigned int flags)
|
||||
{
|
||||
struct dentry *dentry = path->dentry;
|
||||
struct path realpath;
|
||||
const struct cred *old_cred;
|
||||
int err;
|
||||
|
||||
ovl_path_real(dentry, &realpath);
|
||||
old_cred = ovl_override_creds(dentry->d_sb);
|
||||
err = vfs_getattr(&realpath, stat);
|
||||
err = vfs_getattr(&realpath, stat, request_mask, flags);
|
||||
revert_creds(old_cred);
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue