diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2006-09-12 18:35:49 -0400 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-09-24 16:50:45 -0400 |
commit | f9e2d82e6395cfa0802446b54b63cc412089d82c (patch) | |
tree | cdf647041c713d3cbc8b1e0d4006c9440184e336 /fs/ocfs2/dlmglue.c | |
parent | 4d3b83f7364269b66cdda271f680bd99e77afd96 (diff) |
ocfs2: Encode i_generation in the meta data lvb
When i_generation is removed from the lockname, this will help us determine
whether a meta data lvb has information that is in sync with the local
struct inode.
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/dlmglue.c')
-rw-r--r-- | fs/ocfs2/dlmglue.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index f80fb14ee815..6cd84dffbbf4 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
@@ -1427,6 +1427,7 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) | |||
1427 | lvb->lvb_imtime_packed = | 1427 | lvb->lvb_imtime_packed = |
1428 | cpu_to_be64(ocfs2_pack_timespec(&inode->i_mtime)); | 1428 | cpu_to_be64(ocfs2_pack_timespec(&inode->i_mtime)); |
1429 | lvb->lvb_iattr = cpu_to_be32(oi->ip_attr); | 1429 | lvb->lvb_iattr = cpu_to_be32(oi->ip_attr); |
1430 | lvb->lvb_igeneration = cpu_to_be32(inode->i_generation); | ||
1430 | 1431 | ||
1431 | mlog_meta_lvb(0, lockres); | 1432 | mlog_meta_lvb(0, lockres); |
1432 | 1433 | ||
@@ -1482,11 +1483,13 @@ static void ocfs2_refresh_inode_from_lvb(struct inode *inode) | |||
1482 | mlog_exit_void(); | 1483 | mlog_exit_void(); |
1483 | } | 1484 | } |
1484 | 1485 | ||
1485 | static inline int ocfs2_meta_lvb_is_trustable(struct ocfs2_lock_res *lockres) | 1486 | static inline int ocfs2_meta_lvb_is_trustable(struct inode *inode, |
1487 | struct ocfs2_lock_res *lockres) | ||
1486 | { | 1488 | { |
1487 | struct ocfs2_meta_lvb *lvb = (struct ocfs2_meta_lvb *) lockres->l_lksb.lvb; | 1489 | struct ocfs2_meta_lvb *lvb = (struct ocfs2_meta_lvb *) lockres->l_lksb.lvb; |
1488 | 1490 | ||
1489 | if (lvb->lvb_version == OCFS2_LVB_VERSION) | 1491 | if (lvb->lvb_version == OCFS2_LVB_VERSION |
1492 | && be32_to_cpu(lvb->lvb_igeneration) == inode->i_generation) | ||
1490 | return 1; | 1493 | return 1; |
1491 | return 0; | 1494 | return 0; |
1492 | } | 1495 | } |
@@ -1583,7 +1586,7 @@ static int ocfs2_meta_lock_update(struct inode *inode, | |||
1583 | * map (directories, bitmap files, etc) */ | 1586 | * map (directories, bitmap files, etc) */ |
1584 | ocfs2_extent_map_trunc(inode, 0); | 1587 | ocfs2_extent_map_trunc(inode, 0); |
1585 | 1588 | ||
1586 | if (ocfs2_meta_lvb_is_trustable(lockres)) { | 1589 | if (ocfs2_meta_lvb_is_trustable(inode, lockres)) { |
1587 | mlog(0, "Trusting LVB on inode %llu\n", | 1590 | mlog(0, "Trusting LVB on inode %llu\n", |
1588 | (unsigned long long)oi->ip_blkno); | 1591 | (unsigned long long)oi->ip_blkno); |
1589 | ocfs2_refresh_inode_from_lvb(inode); | 1592 | ocfs2_refresh_inode_from_lvb(inode); |
@@ -3166,8 +3169,9 @@ void ocfs2_dump_meta_lvb_info(u64 level, | |||
3166 | 3169 | ||
3167 | mlog(level, "LVB information for %s (called from %s:%u):\n", | 3170 | mlog(level, "LVB information for %s (called from %s:%u):\n", |
3168 | lockres->l_name, function, line); | 3171 | lockres->l_name, function, line); |
3169 | mlog(level, "version: %u, clusters: %u\n", | 3172 | mlog(level, "version: %u, clusters: %u, generation: 0x%x\n", |
3170 | lvb->lvb_version, be32_to_cpu(lvb->lvb_iclusters)); | 3173 | lvb->lvb_version, be32_to_cpu(lvb->lvb_iclusters), |
3174 | be32_to_cpu(lvb->lvb_igeneration)); | ||
3171 | mlog(level, "size: %llu, uid %u, gid %u, mode 0x%x\n", | 3175 | mlog(level, "size: %llu, uid %u, gid %u, mode 0x%x\n", |
3172 | (unsigned long long)be64_to_cpu(lvb->lvb_isize), | 3176 | (unsigned long long)be64_to_cpu(lvb->lvb_isize), |
3173 | be32_to_cpu(lvb->lvb_iuid), be32_to_cpu(lvb->lvb_igid), | 3177 | be32_to_cpu(lvb->lvb_iuid), be32_to_cpu(lvb->lvb_igid), |