dir.c (e98bdb3059cbf2b1cd4261e126b08429f64466c3) dir.c (a528d35e8bfcc521d7cb70aaf03e1bd296c8493f)
1/*
2 *
3 * Copyright (C) 2011 Novell Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 */

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

133
134 err = ovl_do_setxattr(upperdentry, OVL_XATTR_OPAQUE, "y", 1, 0);
135 if (!err)
136 ovl_dentry_set_opaque(dentry);
137
138 return err;
139}
140
1/*
2 *
3 * Copyright (C) 2011 Novell Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 */

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

133
134 err = ovl_do_setxattr(upperdentry, OVL_XATTR_OPAQUE, "y", 1, 0);
135 if (!err)
136 ovl_dentry_set_opaque(dentry);
137
138 return err;
139}
140
141static int ovl_dir_getattr(struct vfsmount *mnt, struct dentry *dentry,
142 struct kstat *stat)
141static int ovl_dir_getattr(const struct path *path, struct kstat *stat,
142 u32 request_mask, unsigned int flags)
143{
143{
144 struct dentry *dentry = path->dentry;
144 int err;
145 enum ovl_path_type type;
146 struct path realpath;
147 const struct cred *old_cred;
148
149 type = ovl_path_real(dentry, &realpath);
150 old_cred = ovl_override_creds(dentry->d_sb);
145 int err;
146 enum ovl_path_type type;
147 struct path realpath;
148 const struct cred *old_cred;
149
150 type = ovl_path_real(dentry, &realpath);
151 old_cred = ovl_override_creds(dentry->d_sb);
151 err = vfs_getattr(&realpath, stat);
152 err = vfs_getattr(&realpath, stat, request_mask, flags);
152 revert_creds(old_cred);
153 if (err)
154 return err;
155
156 stat->dev = dentry->d_sb->s_dev;
157 stat->ino = dentry->d_inode->i_ino;
158
159 /*

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

259 if (WARN_ON(!workdir))
260 return ERR_PTR(-EROFS);
261
262 err = ovl_lock_rename_workdir(workdir, upperdir);
263 if (err)
264 goto out;
265
266 ovl_path_upper(dentry, &upperpath);
153 revert_creds(old_cred);
154 if (err)
155 return err;
156
157 stat->dev = dentry->d_sb->s_dev;
158 stat->ino = dentry->d_inode->i_ino;
159
160 /*

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

260 if (WARN_ON(!workdir))
261 return ERR_PTR(-EROFS);
262
263 err = ovl_lock_rename_workdir(workdir, upperdir);
264 if (err)
265 goto out;
266
267 ovl_path_upper(dentry, &upperpath);
267 err = vfs_getattr(&upperpath, &stat);
268 err = vfs_getattr(&upperpath, &stat,
269 STATX_BASIC_STATS, AT_STATX_SYNC_AS_STAT);
268 if (err)
269 goto out_unlock;
270
271 err = -ESTALE;
272 if (!S_ISDIR(stat.mode))
273 goto out_unlock;
274 upper = upperpath.dentry;
275 if (upper->d_parent->d_inode != udir)

--- 800 unchanged lines hidden ---
270 if (err)
271 goto out_unlock;
272
273 err = -ESTALE;
274 if (!S_ISDIR(stat.mode))
275 goto out_unlock;
276 upper = upperpath.dentry;
277 if (upper->d_parent->d_inode != udir)

--- 800 unchanged lines hidden ---