Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23941
b: refs/heads/master
c: 01d0ae8
h: refs/heads/master
i:
  23939: 61ce1ad
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Mar 20, 2006
1 parent 7040d2f commit da2518f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d9f6eb75d4900782a095b98470decfe98971f920
refs/heads/master: 01d0ae8beaee75d954900109619b700fe68707d9
13 changes: 6 additions & 7 deletions trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ nfs_sb_init(struct super_block *sb, rpc_authflavor_t authflavor)

sb->s_magic = NFS_SUPER_MAGIC;

server->io_stats = nfs_alloc_iostats();
if (server->io_stats == NULL)
return -ENOMEM;

root_inode = nfs_get_root(sb, &server->fh, &fsinfo);
/* Did getting the root inode fail? */
if (IS_ERR(root_inode)) {
Expand All @@ -294,12 +298,6 @@ nfs_sb_init(struct super_block *sb, rpc_authflavor_t authflavor)
}
sb->s_root->d_op = server->rpc_ops->dentry_ops;

server->io_stats = nfs_alloc_iostats();
if (!server->io_stats) {
no_root_error = -ENOMEM;
goto out_no_root;
}

/* mount time stamp, in seconds */
server->mount_time = jiffies;

Expand Down Expand Up @@ -1822,6 +1820,7 @@ static void nfs_kill_super(struct super_block *s)

rpciod_down(); /* release rpciod */

nfs_free_iostats(server->io_stats);
kfree(server->hostname);
kfree(server);
}
Expand Down Expand Up @@ -2122,7 +2121,6 @@ static struct super_block *nfs4_get_sb(struct file_system_type *fs_type,
out_free:
kfree(server->mnt_path);
kfree(server->hostname);
nfs_free_iostats(server->io_stats);
kfree(server);
return s;
}
Expand All @@ -2143,6 +2141,7 @@ static void nfs4_kill_super(struct super_block *sb)

rpciod_down();

nfs_free_iostats(server->io_stats);
kfree(server->hostname);
kfree(server);
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/nfs/iostat.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ static inline struct nfs_iostats *nfs_alloc_iostats(void)

static inline void nfs_free_iostats(struct nfs_iostats *stats)
{
free_percpu(stats);
if (stats != NULL)
free_percpu(stats);
}

#endif
Expand Down

0 comments on commit da2518f

Please sign in to comment.