This source file includes following definitions.
- fsstack_copy_inode_size
- fsstack_copy_attr_all
1
2 #include <linux/export.h>
3 #include <linux/fs.h>
4 #include <linux/fs_stack.h>
5
6
7
8
9
10
11 void fsstack_copy_inode_size(struct inode *dst, struct inode *src)
12 {
13 loff_t i_size;
14 blkcnt_t i_blocks;
15
16
17
18
19
20
21
22 i_size = i_size_read(src);
23
24
25
26
27
28
29
30
31
32
33
34 if (sizeof(i_blocks) > sizeof(long))
35 spin_lock(&src->i_lock);
36 i_blocks = src->i_blocks;
37 if (sizeof(i_blocks) > sizeof(long))
38 spin_unlock(&src->i_lock);
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53 if (sizeof(i_size) > sizeof(long) || sizeof(i_blocks) > sizeof(long))
54 spin_lock(&dst->i_lock);
55 i_size_write(dst, i_size);
56 dst->i_blocks = i_blocks;
57 if (sizeof(i_size) > sizeof(long) || sizeof(i_blocks) > sizeof(long))
58 spin_unlock(&dst->i_lock);
59 }
60 EXPORT_SYMBOL_GPL(fsstack_copy_inode_size);
61
62
63 void fsstack_copy_attr_all(struct inode *dest, const struct inode *src)
64 {
65 dest->i_mode = src->i_mode;
66 dest->i_uid = src->i_uid;
67 dest->i_gid = src->i_gid;
68 dest->i_rdev = src->i_rdev;
69 dest->i_atime = src->i_atime;
70 dest->i_mtime = src->i_mtime;
71 dest->i_ctime = src->i_ctime;
72 dest->i_blkbits = src->i_blkbits;
73 dest->i_flags = src->i_flags;
74 set_nlink(dest, src->i_nlink);
75 }
76 EXPORT_SYMBOL_GPL(fsstack_copy_attr_all);