inode.c (16aac5ad1fa94894b798dd522c5c3a6a0628d7f0) inode.c (f01d08899fd7fa808ff9b8d33ca4882ab44d42fa)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 *
4 * Copyright (C) 2011 Novell Inc.
5 */
6
7#include <linux/fs.h>
8#include <linux/slab.h>

--- 327 unchanged lines hidden (view full) ---

336 old_cred = ovl_override_creds(dentry->d_sb);
337 p = vfs_get_link(ovl_dentry_real(dentry), done);
338 revert_creds(old_cred);
339 return p;
340}
341
342bool ovl_is_private_xattr(struct super_block *sb, const char *name)
343{
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 *
4 * Copyright (C) 2011 Novell Inc.
5 */
6
7#include <linux/fs.h>
8#include <linux/slab.h>

--- 327 unchanged lines hidden (view full) ---

336 old_cred = ovl_override_creds(dentry->d_sb);
337 p = vfs_get_link(ovl_dentry_real(dentry), done);
338 revert_creds(old_cred);
339 return p;
340}
341
342bool ovl_is_private_xattr(struct super_block *sb, const char *name)
343{
344 struct ovl_fs *ofs = sb->s_fs_info;
344 struct ovl_fs *ofs = OVL_FS(sb);
345
346 if (ofs->config.userxattr)
347 return strncmp(name, OVL_XATTR_USER_PREFIX,
348 sizeof(OVL_XATTR_USER_PREFIX) - 1) == 0;
349 else
350 return strncmp(name, OVL_XATTR_TRUSTED_PREFIX,
351 sizeof(OVL_XATTR_TRUSTED_PREFIX) - 1) == 0;
352}

--- 338 unchanged lines hidden (view full) ---

691
692 return ovl_set_or_remove_acl(dentry, inode, acl, type);
693}
694#endif
695
696int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags)
697{
698 if (flags & S_ATIME) {
345
346 if (ofs->config.userxattr)
347 return strncmp(name, OVL_XATTR_USER_PREFIX,
348 sizeof(OVL_XATTR_USER_PREFIX) - 1) == 0;
349 else
350 return strncmp(name, OVL_XATTR_TRUSTED_PREFIX,
351 sizeof(OVL_XATTR_TRUSTED_PREFIX) - 1) == 0;
352}

--- 338 unchanged lines hidden (view full) ---

691
692 return ovl_set_or_remove_acl(dentry, inode, acl, type);
693}
694#endif
695
696int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags)
697{
698 if (flags & S_ATIME) {
699 struct ovl_fs *ofs = inode->i_sb->s_fs_info;
699 struct ovl_fs *ofs = OVL_FS(inode->i_sb);
700 struct path upperpath = {
701 .mnt = ovl_upper_mnt(ofs),
702 .dentry = ovl_upperdentry_dereference(OVL_I(inode)),
703 };
704
705 if (upperpath.dentry) {
706 touch_atime(&upperpath);
707 inode->i_atime = d_inode(upperpath.dentry)->i_atime;

--- 578 unchanged lines hidden (view full) ---

1286}
1287
1288/*
1289 * Does overlay inode need to be hashed by lower inode?
1290 */
1291static bool ovl_hash_bylower(struct super_block *sb, struct dentry *upper,
1292 struct dentry *lower, bool index)
1293{
700 struct path upperpath = {
701 .mnt = ovl_upper_mnt(ofs),
702 .dentry = ovl_upperdentry_dereference(OVL_I(inode)),
703 };
704
705 if (upperpath.dentry) {
706 touch_atime(&upperpath);
707 inode->i_atime = d_inode(upperpath.dentry)->i_atime;

--- 578 unchanged lines hidden (view full) ---

1286}
1287
1288/*
1289 * Does overlay inode need to be hashed by lower inode?
1290 */
1291static bool ovl_hash_bylower(struct super_block *sb, struct dentry *upper,
1292 struct dentry *lower, bool index)
1293{
1294 struct ovl_fs *ofs = sb->s_fs_info;
1294 struct ovl_fs *ofs = OVL_FS(sb);
1295
1296 /* No, if pure upper */
1297 if (!lower)
1298 return false;
1299
1300 /* Yes, if already indexed */
1301 if (index)
1302 return true;

--- 132 unchanged lines hidden ---
1295
1296 /* No, if pure upper */
1297 if (!lower)
1298 return false;
1299
1300 /* Yes, if already indexed */
1301 if (index)
1302 return true;

--- 132 unchanged lines hidden ---