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.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index e7cd392a796a..1d8aa0385ef7 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -566,10 +566,18 @@ static const struct inode_operations cifs_ipc_inode_ops = {
566}; 566};
567 567
568/* gets root inode */ 568/* gets root inode */
569void cifs_read_inode(struct inode *inode) 569struct inode *cifs_iget(struct super_block *sb, unsigned long ino)
570{ 570{
571 int xid, rc; 571 int xid;
572 struct cifs_sb_info *cifs_sb; 572 struct cifs_sb_info *cifs_sb;
573 struct inode *inode;
574 long rc;
575
576 inode = iget_locked(sb, ino);
577 if (!inode)
578 return ERR_PTR(-ENOMEM);
579 if (!(inode->i_state & I_NEW))
580 return inode;
573 581
574 cifs_sb = CIFS_SB(inode->i_sb); 582 cifs_sb = CIFS_SB(inode->i_sb);
575 xid = GetXid(); 583 xid = GetXid();
@@ -586,10 +594,18 @@ void cifs_read_inode(struct inode *inode)
586 inode->i_fop = &simple_dir_operations; 594 inode->i_fop = &simple_dir_operations;
587 inode->i_uid = cifs_sb->mnt_uid; 595 inode->i_uid = cifs_sb->mnt_uid;
588 inode->i_gid = cifs_sb->mnt_gid; 596 inode->i_gid = cifs_sb->mnt_gid;
597 _FreeXid(xid);
598 iget_failed(inode);
599 return ERR_PTR(rc);
589 } 600 }
590 601
591 /* can not call macro FreeXid here since in a void func */ 602 unlock_new_inode(inode);
603
604 /* can not call macro FreeXid here since in a void func
605 * TODO: This is no longer true
606 */
592 _FreeXid(xid); 607 _FreeXid(xid);
608 return inode;
593} 609}
594 610
595int cifs_unlink(struct inode *inode, struct dentry *direntry) 611int cifs_unlink(struct inode *inode, struct dentry *direntry)