Author: vlendec Date: 2005-09-03 09:28:55 +0000 (Sat, 03 Sep 2005) New Revision: 9989
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9989 Log: Nobody looks at the share mode returned from del_share_mode, so delete that argument. Volker Modified: branches/tmp/vl-cluster/source/locking/locking.c branches/tmp/vl-cluster/source/smbd/close.c branches/tmp/vl-cluster/source/smbd/open.c trunk/source/locking/locking.c trunk/source/smbd/close.c trunk/source/smbd/open.c Changeset: Modified: branches/tmp/vl-cluster/source/locking/locking.c =================================================================== --- branches/tmp/vl-cluster/source/locking/locking.c 2005-09-03 08:24:25 UTC (rev 9988) +++ branches/tmp/vl-cluster/source/locking/locking.c 2005-09-03 09:28:55 UTC (rev 9989) @@ -616,14 +616,12 @@ } /******************************************************************* - Delete a specific share mode. Return the number - of entries left, and a memdup'ed copy of the entry deleted (if required). + Delete a specific share mode. Return the number of entries left. Ignore if no entry deleted. ********************************************************************/ static ssize_t del_share_entry(struct share_mode_lock *lck, struct share_mode_entry *entry, - struct share_mode_entry **ppse, BOOL *delete_on_close) { TDB_DATA dbuf; @@ -632,9 +630,6 @@ struct share_mode_entry *shares; ssize_t count = 0; - if (ppse) - *ppse = NULL; - /* read in the existing share modes */ dbuf = tdb_fetch(tdb, lck->tdbkey); if (!dbuf.dptr) @@ -657,9 +652,6 @@ if (share_modes_identical(&shares[i], entry)) { DEBUG(10,("del_share_entry: deleted %s\n", share_mode_str(i, &shares[i]) )); - if (ppse) - *ppse = talloc_memdup(lck, &shares[i], - sizeof(*shares)); data->u.s.num_share_mode_entries--; if ((dbuf.dsize - (sizeof(*data) + (i+1)*sizeof(*shares))) > 0) { memmove(&shares[i], &shares[i+1], @@ -697,12 +689,11 @@ } /******************************************************************* - Del the share mode of a file for this process. Return the number - of entries left, and a memdup'ed copy of the entry deleted. + Del the share mode of a file for this process. Return the number of + entries left. ********************************************************************/ -ssize_t del_share_mode(struct share_mode_lock *lck, - files_struct *fsp, struct share_mode_entry **ppse, +ssize_t del_share_mode(struct share_mode_lock *lck, files_struct *fsp, BOOL *delete_on_close) { struct share_mode_entry entry; @@ -712,7 +703,7 @@ */ fill_share_mode((char *)&entry, fsp, 0, 0); - return del_share_entry(lck, &entry, ppse, delete_on_close); + return del_share_entry(lck, &entry, delete_on_close); } /******************************************************************* Modified: branches/tmp/vl-cluster/source/smbd/close.c =================================================================== --- branches/tmp/vl-cluster/source/smbd/close.c 2005-09-03 08:24:25 UTC (rev 9988) +++ branches/tmp/vl-cluster/source/smbd/close.c 2005-09-03 09:28:55 UTC (rev 9989) @@ -144,7 +144,6 @@ static int close_normal_file(files_struct *fsp, BOOL normal_close) { - struct share_mode_entry *share_entry = NULL; size_t share_entry_count = 0; BOOL delete_file = False; connection_struct *conn = fsp->conn; @@ -198,8 +197,7 @@ return EINVAL; } - share_entry_count = del_share_mode(lck, fsp, &share_entry, - &delete_file); + share_entry_count = del_share_mode(lck, fsp, &delete_file); DEBUG(10,("close_normal_file: share_entry_count = %lu for file %s\n", (unsigned long)share_entry_count, fsp->fsp_name )); Modified: branches/tmp/vl-cluster/source/smbd/open.c =================================================================== --- branches/tmp/vl-cluster/source/smbd/open.c 2005-09-03 08:24:25 UTC (rev 9988) +++ branches/tmp/vl-cluster/source/smbd/open.c 2005-09-03 09:28:55 UTC (rev 9989) @@ -1680,7 +1680,7 @@ if (!NT_STATUS_IS_OK(result)) { BOOL dummy_del_on_close; /* Remember to delete the mode we just added. */ - del_share_mode(lck, fsp, NULL, &dummy_del_on_close); + del_share_mode(lck, fsp, &dummy_del_on_close); talloc_free(lck); fd_close(conn,fsp); file_free(fsp); Modified: trunk/source/locking/locking.c =================================================================== --- trunk/source/locking/locking.c 2005-09-03 08:24:25 UTC (rev 9988) +++ trunk/source/locking/locking.c 2005-09-03 09:28:55 UTC (rev 9989) @@ -618,14 +618,12 @@ } /******************************************************************* - Delete a specific share mode. Return the number - of entries left, and a memdup'ed copy of the entry deleted (if required). + Delete a specific share mode. Return the number of entries left. Ignore if no entry deleted. ********************************************************************/ static ssize_t del_share_entry(struct share_mode_lock *lck, struct share_mode_entry *entry, - struct share_mode_entry **ppse, BOOL *delete_on_close) { TDB_DATA dbuf; @@ -634,9 +632,6 @@ struct share_mode_entry *shares; ssize_t count = 0; - if (ppse) - *ppse = NULL; - /* read in the existing share modes */ dbuf = tdb_fetch(tdb, lck->tdbkey); if (!dbuf.dptr) @@ -659,9 +654,6 @@ if (share_modes_identical(&shares[i], entry)) { DEBUG(10,("del_share_entry: deleted %s\n", share_mode_str(i, &shares[i]) )); - if (ppse) - *ppse = talloc_memdup(lck, &shares[i], - sizeof(*shares)); data->u.s.num_share_mode_entries--; if ((dbuf.dsize - (sizeof(*data) + (i+1)*sizeof(*shares))) > 0) { memmove(&shares[i], &shares[i+1], @@ -699,12 +691,11 @@ } /******************************************************************* - Del the share mode of a file for this process. Return the number - of entries left, and a memdup'ed copy of the entry deleted. + Del the share mode of a file for this process. Return the number of + entries left. ********************************************************************/ -ssize_t del_share_mode(struct share_mode_lock *lck, - files_struct *fsp, struct share_mode_entry **ppse, +ssize_t del_share_mode(struct share_mode_lock *lck, files_struct *fsp, BOOL *delete_on_close) { struct share_mode_entry entry; @@ -714,7 +705,7 @@ */ fill_share_mode((char *)&entry, fsp, 0, 0); - return del_share_entry(lck, &entry, ppse, delete_on_close); + return del_share_entry(lck, &entry, delete_on_close); } /******************************************************************* Modified: trunk/source/smbd/close.c =================================================================== --- trunk/source/smbd/close.c 2005-09-03 08:24:25 UTC (rev 9988) +++ trunk/source/smbd/close.c 2005-09-03 09:28:55 UTC (rev 9989) @@ -145,7 +145,6 @@ static int close_normal_file(files_struct *fsp, BOOL normal_close) { - struct share_mode_entry *share_entry = NULL; size_t share_entry_count = 0; BOOL delete_file = False; connection_struct *conn = fsp->conn; @@ -199,8 +198,7 @@ return EINVAL; } - share_entry_count = del_share_mode(lck, fsp, &share_entry, - &delete_file); + share_entry_count = del_share_mode(lck, fsp, &delete_file); DEBUG(10,("close_normal_file: share_entry_count = %lu for file %s\n", (unsigned long)share_entry_count, fsp->fsp_name )); Modified: trunk/source/smbd/open.c =================================================================== --- trunk/source/smbd/open.c 2005-09-03 08:24:25 UTC (rev 9988) +++ trunk/source/smbd/open.c 2005-09-03 09:28:55 UTC (rev 9989) @@ -1682,7 +1682,7 @@ if (!NT_STATUS_IS_OK(result)) { BOOL dummy_del_on_close; /* Remember to delete the mode we just added. */ - del_share_mode(lck, fsp, NULL, &dummy_del_on_close); + del_share_mode(lck, fsp, &dummy_del_on_close); talloc_free(lck); fd_close(conn,fsp); file_free(fsp);