]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/cifs/cifsglob.h
cifs: convert cifsFileInfo->count to non-atomic counter
[mv-sheeva.git] / fs / cifs / cifsglob.h
index 3365e77f6f240825a68ff3f577c11e064d691620..6319db025e7b2c8c1bf01494037e977489f4efcc 100644 (file)
@@ -395,16 +395,19 @@ struct cifsFileInfo {
        struct list_head llist; /* list of byte range locks we have. */
        bool invalidHandle:1;   /* file closed via session abend */
        bool oplock_break_cancelled:1;
-       atomic_t count;         /* reference count */
+       int count;              /* refcount -- protected by cifs_file_list_lock */
        struct mutex fh_mutex; /* prevents reopen race after dead ses*/
        struct cifs_search_info srch_inf;
        struct work_struct oplock_break; /* work for oplock breaks */
 };
 
-/* Take a reference on the file private data */
+/*
+ * Take a reference on the file private data. Must be called with
+ * cifs_file_list_lock held.
+ */
 static inline void cifsFileInfo_get(struct cifsFileInfo *cifs_file)
 {
-       atomic_inc(&cifs_file->count);
+       ++cifs_file->count;
 }
 
 void cifsFileInfo_put(struct cifsFileInfo *cifs_file);