[Ocfs2-commits] mfasheh commits r1240 - trunk/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue Jul 6 15:04:20 CDT 2004
Author: mfasheh
Date: 2004-07-06 14:04:19 -0500 (Tue, 06 Jul 2004)
New Revision: 1240
Modified:
trunk/src/dcache.c
trunk/src/dcache.h
trunk/src/dlm.c
trunk/src/dlm.h
trunk/src/nm.c
Log:
* commit a patch by <hch at lst.de>:
iterating over all childs is really a rather bad idea in a unix fs, so
let's kill the if 0'ed code and all the child iteration code behind it
that's now unused.
* Commit a small change of mine to the patch: remove
ocfs_break_cache_lock_zap_buffers altogether as it just
became a trivial wrapper around ocfs_inc_inode_seq.
Modified: trunk/src/dcache.c
===================================================================
--- trunk/src/dcache.c 2004-07-06 17:53:18 UTC (rev 1239)
+++ trunk/src/dcache.c 2004-07-06 19:04:19 UTC (rev 1240)
@@ -112,37 +112,3 @@
.d_revalidate = ocfs_dentry_revalidate24,
};
#endif
-
-/*
- * ocfs_foreach_child()
- *
- */
-int ocfs_foreach_child (struct dentry *dentry, int (*func)(struct dentry *, void *), void *data)
-{
- struct list_head *list;
- int ret, done;
-
- LOG_ENTRY_ARGS ("(0x%p, '%*s')\n", dentry,
- dentry->d_name.len, dentry->d_name.name);
-
- spin_lock (&dcache_lock);
- list = dentry->d_subdirs.next;
-
- ret = 1;
- while (list != &dentry->d_subdirs) {
- struct dentry *de = list_entry (list, struct dentry, d_child);
-
- if (de->d_inode && !d_unhashed (de)) {
- done = func(de, data);
- if (done) {
- ret = 0;
- break;
- }
- }
- list = list->next;
- }
- spin_unlock (&dcache_lock);
-
- LOG_EXIT_INT (ret);
- return ret;
-}
Modified: trunk/src/dcache.h
===================================================================
--- trunk/src/dcache.h 2004-07-06 17:53:18 UTC (rev 1239)
+++ trunk/src/dcache.h 2004-07-06 19:04:19 UTC (rev 1240)
@@ -31,8 +31,4 @@
extern struct dentry_operations ocfs_dentry_ops;
-int ocfs_foreach_child(struct dentry *dentry,
- int (*func)(struct dentry *, void *),
- void *data);
-
#endif /* OCFS2_DCACHE_H */
Modified: trunk/src/dlm.c
===================================================================
--- trunk/src/dlm.c 2004-07-06 17:53:18 UTC (rev 1239)
+++ trunk/src/dlm.c 2004-07-06 19:04:19 UTC (rev 1240)
@@ -62,7 +62,6 @@
static int ocfs_reset_voting (ocfs_super * osb);
static int ocfs_get_vote_on_disk (ocfs_super * osb, __u64 lock_id, __u32 lock_type, __u32 flags, ocfs_node_map * got_vote_map, ocfs_node_map * vote_map, __u64 lock_seq_num, ocfs_node_map * oin_open_map);
int ocfs_disk_release_lock (ocfs_super * osb, __u64 lock_id, __u32 lock_type, __u32 flags, struct buffer_head *bh, struct inode *inode);
-static int ocfs_zap_child_buffers_func(struct dentry *dentry, void *data);
void ocfs_set_publish_vote_map(ocfs_super *osb, ocfs_publish *publish, ocfs_node_map *vote_map)
@@ -1267,38 +1266,7 @@
return (status);
} /* ocfs_release_lock */
-
/* inode is definitely non NULL */
-static int ocfs_zap_child_buffers_func(struct dentry *dentry, void *data)
-{
- struct inode *inode = dentry->d_inode;
- ocfs_super *osb = data;
-
- ocfs_inc_inode_seq(osb, inode, 0);
- return 0;
-}
-
-int ocfs_break_cache_lock_zap_buffers(ocfs_super * osb, struct inode * inode)
-{
- struct list_head *iter;
- struct dentry *dentry;
-
- if (inode==NULL)
- return 0;
-
-#warning invalidating child inodes is probably inappropriate now
-#if 0
- list_for_each(iter, &(inode->i_dentry)) {
- dentry = list_entry (iter, struct dentry, d_alias);
- ocfs_foreach_child (dentry, ocfs_zap_child_buffers_func, osb);
- }
-#endif
- ocfs_inc_inode_seq(osb, inode, 0);
- return 0;
-}
-
-
-/* inode is definitely non NULL */
int new_lock_function(ocfs_super * osb, __u32 requested_lock, __u32 flags, struct buffer_head *bh, int *disk_vote, struct inode *inode)
{
ocfs_node_map vote_map;
@@ -1439,7 +1407,7 @@
ocfs_node_map_set(&lockres->oin_openmap, &open_map);
if (need_to_zap_buffers)
- ocfs_break_cache_lock_zap_buffers(osb, inode);
+ ocfs_inc_inode_seq(osb, inode, 0);
/* just alerting owner on open */
if (flags & (FLAG_ADD_OIN_MAP | FLAG_TRUNCATE_PAGES))
Modified: trunk/src/dlm.h
===================================================================
--- trunk/src/dlm.h 2004-07-06 17:53:18 UTC (rev 1239)
+++ trunk/src/dlm.h 2004-07-06 19:04:19 UTC (rev 1240)
@@ -35,8 +35,6 @@
int ocfs_acquire_lock(ocfs_super *osb, __u32 lock_type,
__u32 flags, struct buffer_head **bh,
struct inode *inode);
-int ocfs_break_cache_lock_zap_buffers(ocfs_super *osb,
- struct inode *inode);
void ocfs_compute_dlm_stats(int status, int vote_status,
ocfs_dlm_stats *stats);
int ocfs_release_lock(ocfs_super *osb, __u32 lock_type,
Modified: trunk/src/nm.c
===================================================================
--- trunk/src/nm.c 2004-07-06 17:53:18 UTC (rev 1239)
+++ trunk/src/nm.c 2004-07-06 19:04:19 UTC (rev 1240)
@@ -1087,7 +1087,7 @@
}
if (is_dir && vote_type == RELEASE_CACHE)
- ocfs_break_cache_lock_zap_buffers(osb, inode);
+ ocfs_inc_inode_seq(osb, inode, 0);
/* need to do the write only if fe lock values need to change */
if (is_locked || vote_type == CHANGE_MASTER) {
More information about the Ocfs2-commits
mailing list