]> err.no Git - linux-2.6/blobdiff - fs/cifs/file.c
[PATCH] Make most file operations structs in fs/ const
[linux-2.6] / fs / cifs / file.c
index d17c97d07c80e44895503e6d336b8328c0ffd348..fb49aef1f2ecd9ca3a90d961bcf175e5d5e1f928 100644 (file)
@@ -203,9 +203,9 @@ int cifs_open(struct inode *inode, struct file *file)
                }
        }
 
-       down(&inode->i_sb->s_vfs_rename_sem);
+       mutex_lock(&inode->i_sb->s_vfs_rename_mutex);
        full_path = build_path_from_dentry(file->f_dentry);
-       up(&inode->i_sb->s_vfs_rename_sem);
+       mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);
        if (full_path == NULL) {
                FreeXid(xid);
                return -ENOMEM;
@@ -1339,7 +1339,7 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync)
        return rc;
 }
 
-/* static int cifs_sync_page(struct page *page)
+/* static void cifs_sync_page(struct page *page)
 {
        struct address_space *mapping;
        struct inode *inode;
@@ -1353,16 +1353,18 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync)
                return 0;
        inode = mapping->host;
        if (!inode)
-               return 0; */
+               return; */
 
 /*     fill in rpages then 
        result = cifs_pagein_inode(inode, index, rpages); */ /* BB finish */
 
 /*     cFYI(1, ("rpages is %d for sync page of Index %ld ", rpages, index));
 
+#if 0
        if (rc < 0)
                return rc;
        return 0;
+#endif
 } */
 
 /*
@@ -1442,13 +1444,15 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
                                         &bytes_read, &smb_read_data,
                                         &buf_type);
                        pSMBr = (struct smb_com_read_rsp *)smb_read_data;
-                       if (copy_to_user(current_offset, 
-                                        smb_read_data + 4 /* RFC1001 hdr */
-                                        + le16_to_cpu(pSMBr->DataOffset), 
-                                        bytes_read)) {
-                               rc = -EFAULT;
-                       }
                        if (smb_read_data) {
+                               if (copy_to_user(current_offset,
+                                               smb_read_data +
+                                               4 /* RFC1001 length field */ +
+                                               le16_to_cpu(pSMBr->DataOffset),
+                                               bytes_read)) {
+                                       rc = -EFAULT;
+                               }
+
                                if(buf_type == CIFS_SMALL_BUFFER)
                                        cifs_small_buf_release(smb_read_data);
                                else if(buf_type == CIFS_LARGE_BUFFER)