Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2547
b: refs/heads/master
c: 1212171
h: refs/heads/master
i:
  2545: 4f893a8
  2543: 405e0cc
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Jun 22, 2005
1 parent 95b055c commit fa65a56
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 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: 7fa393a1d3d9485e428a3c74b5599190c14b13db
refs/heads/master: 12121714fbf36023d5892034d0c97df54a451543
30 changes: 21 additions & 9 deletions trunk/fs/isofs/rock.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,21 @@

#define SIG(A,B) ((A) | ((B) << 8)) /* isonum_721() */

/* This is a way of ensuring that we have something in the system
use fields that is compatible with Rock Ridge */
#define CHECK_SP(FAIL) \
if(rr->u.SP.magic[0] != 0xbe) FAIL; \
if(rr->u.SP.magic[1] != 0xef) FAIL; \
ISOFS_SB(inode->i_sb)->s_rock_offset=rr->u.SP.skip;
/*
* This is a way of ensuring that we have something in the system
* use fields that is compatible with Rock Ridge. Return zero on success.
*/

static int check_sp(struct rock_ridge *rr, struct inode *inode)
{
if (rr->u.SP.magic[0] != 0xbe)
return -1;
if (rr->u.SP.magic[1] != 0xef)
return -1;
ISOFS_SB(inode->i_sb)->s_rock_offset = rr->u.SP.skip;
return 0;
}

/* We define a series of macros because each function must do exactly the
same thing in certain places. We use the macros to ensure that everything
is done correctly */
Expand Down Expand Up @@ -118,7 +127,8 @@ int get_rock_ridge_filename(struct iso_directory_record *de,
goto out;
break;
case SIG('S', 'P'):
CHECK_SP(goto out);
if (check_sp(rr, inode))
goto out;
break;
case SIG('C', 'E'):
CHECK_CE;
Expand Down Expand Up @@ -212,7 +222,8 @@ parse_rock_ridge_inode_internal(struct iso_directory_record *de,
break;
#endif
case SIG('S', 'P'):
CHECK_SP(goto out);
if (check_sp(rr, inode))
goto out;
break;
case SIG('C', 'E'):
CHECK_CE;
Expand Down Expand Up @@ -570,7 +581,8 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
goto out;
break;
case SIG('S', 'P'):
CHECK_SP(goto out);
if (check_sp(rr, inode))
goto out;
break;
case SIG('S', 'L'):
rpnt = get_symlink_chunk(rpnt, rr,
Expand Down

0 comments on commit fa65a56

Please sign in to comment.