aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2008-02-15 16:06:08 -0500
committerSteve French <sfrench@us.ibm.com>2008-02-15 16:06:08 -0500
commit0a3abcf75bf391fec4e32356ab5ddb8f5d2e6b41 (patch)
treeb80b1d344ec24cad28b057ef803cebac9434be01 /fs/cifs
parent70eff55d2d979cca700aa6906494f0c474f3f7ff (diff)
parent101142c37be8e5af9b847860219217e6b958c739 (diff)
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifs_dfs_ref.c25
-rw-r--r--fs/cifs/cifsfs.c8
-rw-r--r--fs/cifs/cifsfs.h1
-rw-r--r--fs/cifs/inode.c22
4 files changed, 37 insertions, 19 deletions
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index dd3bba4134b5..7f8838253410 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -259,18 +259,18 @@ static int add_mount_helper(struct vfsmount *newmnt, struct nameidata *nd,
259 int err; 259 int err;
260 260
261 mntget(newmnt); 261 mntget(newmnt);
262 err = do_add_mount(newmnt, nd, nd->mnt->mnt_flags, mntlist); 262 err = do_add_mount(newmnt, nd, nd->path.mnt->mnt_flags, mntlist);
263 switch (err) { 263 switch (err) {
264 case 0: 264 case 0:
265 dput(nd->dentry); 265 dput(nd->path.dentry);
266 mntput(nd->mnt); 266 mntput(nd->path.mnt);
267 nd->mnt = newmnt; 267 nd->path.mnt = newmnt;
268 nd->dentry = dget(newmnt->mnt_root); 268 nd->path.dentry = dget(newmnt->mnt_root);
269 break; 269 break;
270 case -EBUSY: 270 case -EBUSY:
271 /* someone else made a mount here whilst we were busy */ 271 /* someone else made a mount here whilst we were busy */
272 while (d_mountpoint(nd->dentry) && 272 while (d_mountpoint(nd->path.dentry) &&
273 follow_down(&nd->mnt, &nd->dentry)) 273 follow_down(&nd->path.mnt, &nd->path.dentry))
274 ; 274 ;
275 err = 0; 275 err = 0;
276 default: 276 default:
@@ -307,8 +307,8 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
307 307
308 xid = GetXid(); 308 xid = GetXid();
309 309
310 dput(nd->dentry); 310 dput(nd->path.dentry);
311 nd->dentry = dget(dentry); 311 nd->path.dentry = dget(dentry);
312 312
313 cifs_sb = CIFS_SB(dentry->d_inode->i_sb); 313 cifs_sb = CIFS_SB(dentry->d_inode->i_sb);
314 ses = cifs_sb->tcon->ses; 314 ses = cifs_sb->tcon->ses;
@@ -340,7 +340,8 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
340 rc = -EINVAL; 340 rc = -EINVAL;
341 goto out_err; 341 goto out_err;
342 } 342 }
343 mnt = cifs_dfs_do_refmount(nd->mnt, nd->dentry, 343 mnt = cifs_dfs_do_refmount(nd->path.mnt,
344 nd->path.dentry,
344 referrals[i].node_name); 345 referrals[i].node_name);
345 cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p", 346 cFYI(1, ("%s: cifs_dfs_do_refmount:%s , mnt:%p",
346 __FUNCTION__, 347 __FUNCTION__,
@@ -357,7 +358,7 @@ cifs_dfs_follow_mountpoint(struct dentry *dentry, struct nameidata *nd)
357 if (IS_ERR(mnt)) 358 if (IS_ERR(mnt))
358 goto out_err; 359 goto out_err;
359 360
360 nd->mnt->mnt_flags |= MNT_SHRINKABLE; 361 nd->path.mnt->mnt_flags |= MNT_SHRINKABLE;
361 rc = add_mount_helper(mnt, nd, &cifs_dfs_automount_list); 362 rc = add_mount_helper(mnt, nd, &cifs_dfs_automount_list);
362 363
363out: 364out:
@@ -367,7 +368,7 @@ out:
367 cFYI(1, ("leaving %s" , __FUNCTION__)); 368 cFYI(1, ("leaving %s" , __FUNCTION__));
368 return ERR_PTR(rc); 369 return ERR_PTR(rc);
369out_err: 370out_err:
370 path_release(nd); 371 path_put(&nd->path);
371 goto out; 372 goto out;
372} 373}
373 374
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 29bbf655b99c..a04b17e5a9d0 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -147,10 +147,11 @@ cifs_read_super(struct super_block *sb, void *data,
147#endif 147#endif
148 sb->s_blocksize = CIFS_MAX_MSGSIZE; 148 sb->s_blocksize = CIFS_MAX_MSGSIZE;
149 sb->s_blocksize_bits = 14; /* default 2**14 = CIFS_MAX_MSGSIZE */ 149 sb->s_blocksize_bits = 14; /* default 2**14 = CIFS_MAX_MSGSIZE */
150 inode = iget(sb, ROOT_I); 150 inode = cifs_iget(sb, ROOT_I);
151 151
152 if (!inode) { 152 if (IS_ERR(inode)) {
153 rc = -ENOMEM; 153 rc = PTR_ERR(inode);
154 inode = NULL;
154 goto out_no_root; 155 goto out_no_root;
155 } 156 }
156 157
@@ -517,7 +518,6 @@ static int cifs_remount(struct super_block *sb, int *flags, char *data)
517} 518}
518 519
519static const struct super_operations cifs_super_ops = { 520static const struct super_operations cifs_super_ops = {
520 .read_inode = cifs_read_inode,
521 .put_super = cifs_put_super, 521 .put_super = cifs_put_super,
522 .statfs = cifs_statfs, 522 .statfs = cifs_statfs,
523 .alloc_inode = cifs_alloc_inode, 523 .alloc_inode = cifs_alloc_inode,
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index 195b14de5567..68978306c3ca 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -44,6 +44,7 @@ extern void cifs_read_inode(struct inode *);
44 44
45/* Functions related to inodes */ 45/* Functions related to inodes */
46extern const struct inode_operations cifs_dir_inode_ops; 46extern const struct inode_operations cifs_dir_inode_ops;
47extern struct inode *cifs_iget(struct super_block *, unsigned long);
47extern int cifs_create(struct inode *, struct dentry *, int, 48extern int cifs_create(struct inode *, struct dentry *, int,
48 struct nameidata *); 49 struct nameidata *);
49extern struct dentry *cifs_lookup(struct inode *, struct dentry *, 50extern struct dentry *cifs_lookup(struct inode *, struct dentry *,
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)