aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/f2fs/inode.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index 794241777322..340a21be5a76 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -100,6 +100,10 @@ static int do_read_inode(struct inode *inode)
100 inode->i_ctime.tv_nsec = le32_to_cpu(ri->i_ctime_nsec); 100 inode->i_ctime.tv_nsec = le32_to_cpu(ri->i_ctime_nsec);
101 inode->i_mtime.tv_nsec = le32_to_cpu(ri->i_mtime_nsec); 101 inode->i_mtime.tv_nsec = le32_to_cpu(ri->i_mtime_nsec);
102 inode->i_generation = le32_to_cpu(ri->i_generation); 102 inode->i_generation = le32_to_cpu(ri->i_generation);
103 if (ri->i_addr[0])
104 inode->i_rdev = old_decode_dev(le32_to_cpu(ri->i_addr[0]));
105 else
106 inode->i_rdev = new_decode_dev(le32_to_cpu(ri->i_addr[1]));
103 107
104 fi->i_current_depth = le32_to_cpu(ri->i_current_depth); 108 fi->i_current_depth = le32_to_cpu(ri->i_current_depth);
105 fi->i_xattr_nid = le32_to_cpu(ri->i_xattr_nid); 109 fi->i_xattr_nid = le32_to_cpu(ri->i_xattr_nid);
@@ -203,6 +207,20 @@ void update_inode(struct inode *inode, struct page *node_page)
203 ri->i_flags = cpu_to_le32(F2FS_I(inode)->i_flags); 207 ri->i_flags = cpu_to_le32(F2FS_I(inode)->i_flags);
204 ri->i_pino = cpu_to_le32(F2FS_I(inode)->i_pino); 208 ri->i_pino = cpu_to_le32(F2FS_I(inode)->i_pino);
205 ri->i_generation = cpu_to_le32(inode->i_generation); 209 ri->i_generation = cpu_to_le32(inode->i_generation);
210
211 if (S_ISCHR(inode->i_mode) || S_ISBLK(inode->i_mode)) {
212 if (old_valid_dev(inode->i_rdev)) {
213 ri->i_addr[0] =
214 cpu_to_le32(old_encode_dev(inode->i_rdev));
215 ri->i_addr[1] = 0;
216 } else {
217 ri->i_addr[0] = 0;
218 ri->i_addr[1] =
219 cpu_to_le32(new_encode_dev(inode->i_rdev));
220 ri->i_addr[2] = 0;
221 }
222 }
223
206 set_cold_node(inode, node_page); 224 set_cold_node(inode, node_page);
207 set_page_dirty(node_page); 225 set_page_dirty(node_page);
208} 226}