|
Lines 14-19
Link Here
|
| 14 |
#include <linux/slab.h> |
14 |
#include <linux/slab.h> |
| 15 |
#include <linux/pagemap.h> |
15 |
#include <linux/pagemap.h> |
| 16 |
#include <linux/smp_lock.h> |
16 |
#include <linux/smp_lock.h> |
|
|
17 |
#include <asm/page.h> |
| 17 |
|
18 |
|
| 18 |
#include "rock.h" |
19 |
#include "rock.h" |
| 19 |
|
20 |
|
|
Lines 419-425
Link Here
|
| 419 |
return 0; |
420 |
return 0; |
| 420 |
} |
421 |
} |
| 421 |
|
422 |
|
| 422 |
static char *get_symlink_chunk(char *rpnt, struct rock_ridge *rr) |
423 |
static char *get_symlink_chunk(char *rpnt, struct rock_ridge *rr, char *pstart) |
| 423 |
{ |
424 |
{ |
| 424 |
int slen; |
425 |
int slen; |
| 425 |
int rootflag; |
426 |
int rootflag; |
|
Lines 431-446
Link Here
|
| 431 |
rootflag = 0; |
432 |
rootflag = 0; |
| 432 |
switch (slp->flags & ~1) { |
433 |
switch (slp->flags & ~1) { |
| 433 |
case 0: |
434 |
case 0: |
|
|
435 |
if (rpnt - pstart + slp->len >= PAGE_SIZE) |
| 436 |
return rpnt; |
| 434 |
memcpy(rpnt, slp->text, slp->len); |
437 |
memcpy(rpnt, slp->text, slp->len); |
| 435 |
rpnt+=slp->len; |
438 |
rpnt+=slp->len; |
| 436 |
break; |
439 |
break; |
| 437 |
case 4: |
440 |
case 4: |
|
|
441 |
if (rpnt - pstart + 1 >= PAGE_SIZE) |
| 442 |
return rpnt; |
| 438 |
*rpnt++='.'; |
443 |
*rpnt++='.'; |
| 439 |
/* fallthru */ |
444 |
/* fallthru */ |
| 440 |
case 2: |
445 |
case 2: |
|
|
446 |
if (rpnt - pstart + 1 >= PAGE_SIZE) |
| 447 |
return rpnt; |
| 441 |
*rpnt++='.'; |
448 |
*rpnt++='.'; |
| 442 |
break; |
449 |
break; |
| 443 |
case 8: |
450 |
case 8: |
|
|
451 |
if (rpnt - pstart + 1 >= PAGE_SIZE) |
| 452 |
return rpnt; |
| 444 |
rootflag = 1; |
453 |
rootflag = 1; |
| 445 |
*rpnt++='/'; |
454 |
*rpnt++='/'; |
| 446 |
break; |
455 |
break; |
|
Lines 457-463
Link Here
|
| 457 |
* If there is another SL record, and this component |
466 |
* If there is another SL record, and this component |
| 458 |
* record isn't continued, then add a slash. |
467 |
* record isn't continued, then add a slash. |
| 459 |
*/ |
468 |
*/ |
| 460 |
if ((!rootflag) && (rr->u.SL.flags & 1) && !(oldslp->flags & 1)) |
469 |
if ((!rootflag) && (rr->u.SL.flags & 1) && |
|
|
470 |
!(oldslp->flags & 1) && |
| 471 |
rpnt - pstart + 1 < PAGE_SIZE) |
| 461 |
*rpnt++='/'; |
472 |
*rpnt++='/'; |
| 462 |
break; |
473 |
break; |
| 463 |
} |
474 |
} |
|
Lines 465-471
Link Here
|
| 465 |
/* |
476 |
/* |
| 466 |
* If this component record isn't continued, then append a '/'. |
477 |
* If this component record isn't continued, then append a '/'. |
| 467 |
*/ |
478 |
*/ |
| 468 |
if (!rootflag && !(oldslp->flags & 1)) |
479 |
if (!rootflag && !(oldslp->flags & 1) && |
|
|
480 |
rpnt - pstart + 1 < PAGE_SIZE) |
| 469 |
*rpnt++='/'; |
481 |
*rpnt++='/'; |
| 470 |
|
482 |
|
| 471 |
} |
483 |
} |
|
Lines 548-554
Link Here
|
| 548 |
CHECK_SP(goto out); |
560 |
CHECK_SP(goto out); |
| 549 |
break; |
561 |
break; |
| 550 |
case SIG('S', 'L'): |
562 |
case SIG('S', 'L'): |
| 551 |
rpnt = get_symlink_chunk(rpnt, rr); |
563 |
rpnt = get_symlink_chunk(rpnt, rr, link); |
| 552 |
break; |
564 |
break; |
| 553 |
case SIG('C', 'E'): |
565 |
case SIG('C', 'E'): |
| 554 |
/* This tells is if there is a continuation record */ |
566 |
/* This tells is if there is a continuation record */ |