patch-2.4.0-test3 linux/fs/ncpfs/ncplib_kernel.h

Next file: linux/fs/ncpfs/sock.c
Previous file: linux/fs/ncpfs/ncplib_kernel.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/fs/ncpfs/ncplib_kernel.h linux/fs/ncpfs/ncplib_kernel.h
@@ -57,6 +57,10 @@
 int ncp_write_kernel(struct ncp_server *, const char *, __u32, __u16,
 		const char *, int *);
 
+static inline void ncp_inode_close(struct inode *inode) {
+	atomic_dec(&NCP_FINFO(inode)->opened);
+}
+
 int ncp_obtain_info(struct ncp_server *server, struct inode *, char *,
 		struct nw_info_struct *target);
 int ncp_lookup_volume(struct ncp_server *, char *, struct nw_info_struct *);
@@ -153,9 +157,11 @@
 ncp_renew_dentries(struct dentry *parent)
 {
 	struct ncp_server *server = NCP_SERVER(parent->d_inode);
-	struct list_head *next = parent->d_subdirs.next;
+	struct list_head *next;
 	struct dentry *dentry;
 
+	spin_lock(&dcache_lock);
+	next = parent->d_subdirs.next;
 	while (next != &parent->d_subdirs) {
 		dentry = list_entry(next, struct dentry, d_child);
 
@@ -166,21 +172,25 @@
 
 		next = next->next;
 	}
+	spin_unlock(&dcache_lock);
 }
 
 static inline void
 ncp_invalidate_dircache_entries(struct dentry *parent)
 {
 	struct ncp_server *server = NCP_SERVER(parent->d_inode);
-	struct list_head *next = parent->d_subdirs.next;
+	struct list_head *next;
 	struct dentry *dentry;
 
+	spin_lock(&dcache_lock);
+	next = parent->d_subdirs.next;
 	while (next != &parent->d_subdirs) {
 		dentry = list_entry(next, struct dentry, d_child);
 		dentry->d_fsdata = NULL;
 		ncp_age_dentry(server, dentry);
 		next = next->next;
 	}
+	spin_unlock(&dcache_lock);
 }
 
 struct ncp_cache_head {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)