diff options
author | Matthew Treinish <treinish@linux.vnet.ibm.com> | 2012-04-30 11:32:57 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-19 17:10:10 -0400 |
commit | e73e6c9e85ed91187c1d21cb9238e86a116bf3db (patch) | |
tree | 5b670db58e5ae253be7a204b610170147d8a1cc3 /fs/nfs/inode.c | |
parent | 39ffb9218e41b1ef4920432776791f5e9ed2eff3 (diff) |
Fixed goto readability in nfs_update_inode.
Simplified error gotos to make it slightly easier to read,
it doesn't affect the functionality of the routine.
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r-- | fs/nfs/inode.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 9f17cd19e710..9ad81ce0c40f 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -1275,14 +1275,26 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1275 | nfs_display_fhandle_hash(NFS_FH(inode)), | 1275 | nfs_display_fhandle_hash(NFS_FH(inode)), |
1276 | atomic_read(&inode->i_count), fattr->valid); | 1276 | atomic_read(&inode->i_count), fattr->valid); |
1277 | 1277 | ||
1278 | if ((fattr->valid & NFS_ATTR_FATTR_FILEID) && nfsi->fileid != fattr->fileid) | 1278 | if ((fattr->valid & NFS_ATTR_FATTR_FILEID) && nfsi->fileid != fattr->fileid) { |
1279 | goto out_fileid; | 1279 | printk(KERN_ERR "NFS: server %s error: fileid changed\n" |
1280 | "fsid %s: expected fileid 0x%Lx, got 0x%Lx\n", | ||
1281 | NFS_SERVER(inode)->nfs_client->cl_hostname, | ||
1282 | inode->i_sb->s_id, (long long)nfsi->fileid, | ||
1283 | (long long)fattr->fileid); | ||
1284 | goto out_err; | ||
1285 | } | ||
1280 | 1286 | ||
1281 | /* | 1287 | /* |
1282 | * Make sure the inode's type hasn't changed. | 1288 | * Make sure the inode's type hasn't changed. |
1283 | */ | 1289 | */ |
1284 | if ((fattr->valid & NFS_ATTR_FATTR_TYPE) && (inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) | 1290 | if ((fattr->valid & NFS_ATTR_FATTR_TYPE) && (inode->i_mode & S_IFMT) != (fattr->mode & S_IFMT)) { |
1285 | goto out_changed; | 1291 | /* |
1292 | * Big trouble! The inode has become a different object. | ||
1293 | */ | ||
1294 | printk(KERN_DEBUG "NFS: %s: inode %ld mode changed, %07o to %07o\n", | ||
1295 | __func__, inode->i_ino, inode->i_mode, fattr->mode); | ||
1296 | goto out_err; | ||
1297 | } | ||
1286 | 1298 | ||
1287 | server = NFS_SERVER(inode); | 1299 | server = NFS_SERVER(inode); |
1288 | /* Update the fsid? */ | 1300 | /* Update the fsid? */ |
@@ -1443,12 +1455,6 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1443 | nfsi->cache_validity |= invalid; | 1455 | nfsi->cache_validity |= invalid; |
1444 | 1456 | ||
1445 | return 0; | 1457 | return 0; |
1446 | out_changed: | ||
1447 | /* | ||
1448 | * Big trouble! The inode has become a different object. | ||
1449 | */ | ||
1450 | printk(KERN_DEBUG "NFS: %s: inode %ld mode changed, %07o to %07o\n", | ||
1451 | __func__, inode->i_ino, inode->i_mode, fattr->mode); | ||
1452 | out_err: | 1458 | out_err: |
1453 | /* | 1459 | /* |
1454 | * No need to worry about unhashing the dentry, as the | 1460 | * No need to worry about unhashing the dentry, as the |
@@ -1457,13 +1463,6 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1457 | */ | 1463 | */ |
1458 | nfs_invalidate_inode(inode); | 1464 | nfs_invalidate_inode(inode); |
1459 | return -ESTALE; | 1465 | return -ESTALE; |
1460 | |||
1461 | out_fileid: | ||
1462 | printk(KERN_ERR "NFS: server %s error: fileid changed\n" | ||
1463 | "fsid %s: expected fileid 0x%Lx, got 0x%Lx\n", | ||
1464 | NFS_SERVER(inode)->nfs_client->cl_hostname, inode->i_sb->s_id, | ||
1465 | (long long)nfsi->fileid, (long long)fattr->fileid); | ||
1466 | goto out_err; | ||
1467 | } | 1466 | } |
1468 | 1467 | ||
1469 | 1468 | ||