From 4d3e4bf7484ce05e33064fd7becdd42292ded82e Mon Sep 17 00:00:00 2001
From: wangdi <wangdi>
Date: Mon, 19 Jan 2004 07:44:38 +0000
Subject: [PATCH] some minor fix in delete snapshot

---
 lustre/snapfs/snaptable.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lustre/snapfs/snaptable.c b/lustre/snapfs/snaptable.c
index 5788524d6b..0af46c3b6b 100644
--- a/lustre/snapfs/snaptable.c
+++ b/lustre/snapfs/snaptable.c
@@ -306,7 +306,7 @@ static int delete_inode(struct inode *primary, void *param)
 		my_table[slot - delete_slot] = table->snap_items[slot].index;
 	}
 	next_ind = snap_get_indirect 
-		(primary, my_table, table->tbl_count - delete_slot );
+		   (primary, my_table, table->tbl_count - delete_slot );
 	if (next_ind && (next_ind->i_ino == primary->i_ino)) {
 		iput(next_ind);
 		next_ind = NULL;
@@ -719,8 +719,7 @@ int snap_get_index_from_name(int tableno, char *name)
 	table = &snap_tables[tableno];
 
 	for ( slot = 0 ; slot < SNAP_MAX ; slot++ ) {
-		if(strncmp (&table->snap_items[slot].name[0], name, 
-			SNAP_MAX_NAMELEN) == 0 ) {
+		if (!strcmp(&table->snap_items[slot].name[0], name)) {
 			return table->snap_items[slot].index;
 		}
 	}
@@ -754,7 +753,7 @@ int snap_iterate_func( struct ioc_snap_tbl_data *data, unsigned int cmd)
 	sb = cache->cache_sb;
 	table = &snap_tables[tableno];
 	
-	index = get_index_of_item(table, data->snaps[0].name);
+	index = snap_get_index_from_name(tableno, data->snaps[0].name);
 	if (index < 0)
 		RETURN(-EINVAL);
 	
-- 
GitLab