Guest User

2.6.37_plus_v16_zcache_linux-next_fixes.patch

a guest
Feb 19th, 2011
352
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff -Nrupad linux-2.6.37_plus_v16_clean//drivers/staging/zcache/zcache.c linux-2.6.37_plus_v16_fix//drivers/staging/zcache/zcache.c
  2. --- linux-2.6.37_plus_v16_clean//drivers/staging/zcache/zcache.c 2011-02-20 02:43:47.398811587 +0100
  3. +++ linux-2.6.37_plus_v16_fix//drivers/staging/zcache/zcache.c 2011-02-20 02:16:11.780812923 +0100
  4. @@ -1591,9 +1591,9 @@ __setup("nofrontswap", no_frontswap);
  5.  
  6. static int __init zcache_init(void)
  7. {
  8. +#ifdef CONFIG_SYSFS
  9. int ret = 0;
  10.  
  11. -#ifdef CONFIG_SYSFS
  12. ret = sysfs_create_group(mm_kobj, &zcache_attr_group);
  13. if (ret) {
  14. pr_err("zcache: can't create sysfs\n");
  15. diff -Nrupad linux-2.6.37_plus_v16_clean//fs/super.c linux-2.6.37_plus_v16_fix//fs/super.c
  16. --- linux-2.6.37_plus_v16_clean//fs/super.c 2011-02-20 02:43:47.544811587 +0100
  17. +++ linux-2.6.37_plus_v16_fix//fs/super.c 2011-02-20 02:16:55.200812888 +0100
  18. @@ -177,8 +177,8 @@ void deactivate_locked_super(struct supe
  19. {
  20. struct file_system_type *fs = s->s_type;
  21. if (atomic_dec_and_test(&s->s_active)) {
  22. - fs->kill_sb(s);
  23. cleancache_flush_fs(s);
  24. + fs->kill_sb(s);
  25. put_filesystem(fs);
  26. put_super(s);
  27. } else {
  28. diff -Nrupad linux-2.6.37_plus_v16_clean//mm/cleancache.c linux-2.6.37_plus_v16_fix//mm/cleancache.c
  29. --- linux-2.6.37_plus_v16_clean//mm/cleancache.c 2011-02-20 02:43:47.595811587 +0100
  30. +++ linux-2.6.37_plus_v16_fix//mm/cleancache.c 2011-02-20 02:17:24.430812865 +0100
  31. @@ -73,25 +73,27 @@ EXPORT_SYMBOL(__cleancache_init_shared_f
  32. * the key, else use the inode number.
  33. */
  34. static int cleancache_get_key(struct inode *inode,
  35. - struct cleancache_filekey *key)
  36. + struct cleancache_filekey *key)
  37. {
  38. - int (*fhfn)(struct dentry *, __u32 *fh, int *, int);
  39. - int maxlen = CLEANCACHE_KEY_MAX;
  40. - struct super_block *sb = inode->i_sb;
  41. - struct dentry *d;
  42. + int (*fhfn)(struct dentry *, __u32 *fh, int *, int);
  43. + int len = 0, maxlen = CLEANCACHE_KEY_MAX;
  44. + struct super_block *sb = inode->i_sb;
  45. + struct dentry *d;
  46.  
  47. - key->u.ino = inode->i_ino;
  48. - if (sb->s_export_op != NULL) {
  49. - fhfn = sb->s_export_op->encode_fh;
  50. - if (fhfn) {
  51. - d = list_first_entry(&inode->i_dentry,
  52. - struct dentry, d_alias);
  53. - (void)(*fhfn)(d, &key->u.fh[0], &maxlen, 0);
  54. - if (maxlen > CLEANCACHE_KEY_MAX)
  55. - return -1;
  56. - }
  57. - }
  58. - return 0;
  59. + key->u.ino = inode->i_ino;
  60. + if (sb->s_export_op != NULL) {
  61. + fhfn = sb->s_export_op->encode_fh;
  62. + if (fhfn) {
  63. + d = list_first_entry(&inode->i_dentry,
  64. + struct dentry, d_alias);
  65. + len = (*fhfn)(d, &key->u.fh[0], &maxlen, 0);
  66. + if (len <= 0 || len == 255)
  67. + return -1;
  68. + if (maxlen > CLEANCACHE_KEY_MAX)
  69. + return -1;
  70. + }
  71. + }
  72. + return 0;
  73. }
  74.  
  75. /*
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×