iget-stop-affs-from-using-iget-and-read_inode-try
[linux-2.6/linux-trees-mm.git] / fs / stack.c
bloba548aacf8af1bbcc52faa41ac31daa7dccd5bcd8
1 /*
2 * Copyright (c) 2006-2007 Erez Zadok
3 * Copyright (c) 2006-2007 Josef 'Jeff' Sipek
4 * Copyright (c) 2006-2007 Stony Brook University
5 * Copyright (c) 2006-2007 The Research Foundation of SUNY
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #include <linux/module.h>
13 #include <linux/fs.h>
14 #include <linux/fs_stack.h>
17 * does _NOT_ require i_mutex to be held.
19 * This function cannot be inlined since i_size_{read,write} is rather
20 * heavy-weight on 32-bit systems
22 void fsstack_copy_inode_size(struct inode *dst, const struct inode *src)
24 i_size_write(dst, i_size_read((struct inode *)src));
25 dst->i_blocks = src->i_blocks;
27 EXPORT_SYMBOL_GPL(fsstack_copy_inode_size);
30 * copy all attributes; get_nlinks is optional way to override the i_nlink
31 * copying
33 void fsstack_copy_attr_all(struct inode *dest, const struct inode *src)
35 dest->i_mode = src->i_mode;
36 dest->i_uid = src->i_uid;
37 dest->i_gid = src->i_gid;
38 dest->i_rdev = src->i_rdev;
39 dest->i_atime = src->i_atime;
40 dest->i_mtime = src->i_mtime;
41 dest->i_ctime = src->i_ctime;
42 dest->i_blkbits = src->i_blkbits;
43 dest->i_flags = src->i_flags;
44 dest->i_nlink = src->i_nlink;
46 EXPORT_SYMBOL_GPL(fsstack_copy_attr_all);