aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r--fs/cifs/inode.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index d9567ba2960b..b1a4a65eaa08 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -586,10 +586,18 @@ static const struct inode_operations cifs_ipc_inode_ops = {
586}; 586};
587 587
588/* gets root inode */ 588/* gets root inode */
589void cifs_read_inode(struct inode *inode) 589struct inode *cifs_iget(struct super_block *sb, unsigned long ino)
590{ 590{
591 int xid, rc; 591 int xid;
592 struct cifs_sb_info *cifs_sb; 592 struct cifs_sb_info *cifs_sb;
593 struct inode *inode;
594 long rc;
595
596 inode = iget_locked(sb, ino);
597 if (!inode)
598 return ERR_PTR(-ENOMEM);
599 if (!(inode->i_state & I_NEW))
600 return inode;
593 601
594 cifs_sb = CIFS_SB(inode->i_sb); 602 cifs_sb = CIFS_SB(inode->i_sb);
595 xid = GetXid(); 603 xid = GetXid();
@@ -606,10 +614,18 @@ void cifs_read_inode(struct inode *inode)
606 inode->i_fop = &simple_dir_operations; 614 inode->i_fop = &simple_dir_operations;
607 inode->i_uid = cifs_sb->mnt_uid; 615 inode->i_uid = cifs_sb->mnt_uid;
608 inode->i_gid = cifs_sb->mnt_gid; 616 inode->i_gid = cifs_sb->mnt_gid;
617 _FreeXid(xid);
618 iget_failed(inode);
619 return ERR_PTR(rc);
609 } 620 }
610 621
611 /* can not call macro FreeXid here since in a void func */ 622 unlock_new_inode(inode);
623
624 /* can not call macro FreeXid here since in a void func
625 * TODO: This is no longer true
626 */
612 _FreeXid(xid); 627 _FreeXid(xid);
628 return inode;
613} 629}
614 630
615int cifs_unlink(struct inode *inode, struct dentry *direntry) 631int cifs_unlink(struct inode *inode, struct dentry *direntry)
@@ -1386,7 +1402,7 @@ static int cifs_truncate_page(struct address_space *mapping, loff_t from)
1386 if (!page) 1402 if (!page)
1387 return -ENOMEM; 1403 return -ENOMEM;
1388 1404
1389 zero_user_page(page, offset, PAGE_CACHE_SIZE - offset, KM_USER0); 1405 zero_user_segment(page, offset, PAGE_CACHE_SIZE);
1390 unlock_page(page); 1406 unlock_page(page);
1391 page_cache_release(page); 1407 page_cache_release(page);
1392 return rc; 1408 return rc;