util.c (c1144d29f405ce1f4e6ede6482beb3d0d09750c6) util.c (d9854c87f0ed1a5f32fec24bb5b5fb426ad79c26)
1/*
2 * Copyright (C) 2011 Novell Inc.
3 * Copyright (C) 2016 Red Hat, 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 */

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

328 if (inode_unhashed(inode)) {
329 if (!inode->i_ino)
330 inode->i_ino = upperinode->i_ino;
331 inode->i_private = upperinode;
332 __insert_inode_hash(inode, (unsigned long) upperinode);
333 }
334}
335
1/*
2 * Copyright (C) 2011 Novell Inc.
3 * Copyright (C) 2016 Red Hat, 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 */

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

328 if (inode_unhashed(inode)) {
329 if (!inode->i_ino)
330 inode->i_ino = upperinode->i_ino;
331 inode->i_private = upperinode;
332 __insert_inode_hash(inode, (unsigned long) upperinode);
333 }
334}
335
336void ovl_dentry_version_inc(struct dentry *dentry, bool impurity)
336static void ovl_dentry_version_inc(struct dentry *dentry, bool impurity)
337{
338 struct inode *inode = d_inode(dentry);
339
340 WARN_ON(!inode_is_locked(inode));
341 /*
342 * Version is used by readdir code to keep cache consistent. For merge
343 * dirs all changes need to be noted. For non-merge dirs, cache only
344 * contains impure (ones which have been copied up and have origins)
345 * entries, so only need to note changes to impure entries.
346 */
347 if (OVL_TYPE_MERGE(ovl_path_type(dentry)) || impurity)
348 OVL_I(inode)->version++;
349}
350
337{
338 struct inode *inode = d_inode(dentry);
339
340 WARN_ON(!inode_is_locked(inode));
341 /*
342 * Version is used by readdir code to keep cache consistent. For merge
343 * dirs all changes need to be noted. For non-merge dirs, cache only
344 * contains impure (ones which have been copied up and have origins)
345 * entries, so only need to note changes to impure entries.
346 */
347 if (OVL_TYPE_MERGE(ovl_path_type(dentry)) || impurity)
348 OVL_I(inode)->version++;
349}
350
351void ovl_dir_modified(struct dentry *dentry, bool impurity)
352{
353 /* Copy mtime/ctime */
354 ovl_copyattr(d_inode(ovl_dentry_upper(dentry)), d_inode(dentry));
355
356 ovl_dentry_version_inc(dentry, impurity);
357}
358
351u64 ovl_dentry_version_get(struct dentry *dentry)
352{
353 struct inode *inode = d_inode(dentry);
354
355 WARN_ON(!inode_is_locked(inode));
356 return OVL_I(inode)->version;
357}
358

--- 319 unchanged lines hidden ---
359u64 ovl_dentry_version_get(struct dentry *dentry)
360{
361 struct inode *inode = d_inode(dentry);
362
363 WARN_ON(!inode_is_locked(inode));
364 return OVL_I(inode)->version;
365}
366

--- 319 unchanged lines hidden ---