Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1746291
  • 博文数量: 141
  • 博客积分: 3552
  • 博客等级: 中校
  • 技术积分: 4101
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-15 14:39
个人简介

熟悉Linux下程序设计及各种应用程序 熟悉C Language 熟悉Glusterfs、FFmpeg、CDN 系统设计,计算机图形系统设计、分布式程序设计 目前主要研究方向:流媒体

文章分类

全部博文(141)

分类: 项目管理

2011-04-21 15:15:43

使用git作patch有以下几种

1.自己修改了一些代码,或者加了一些文件,然后做patch,方法如下:

    (1)修改了代码
  1. [root@btg core]# vim system/core/rootdir/init.rc
  2. [root@btg core]# vim rootdir/init.rc
  3. [root@btg core]# git diff
  4. diff --git a/rootdir/init.rc b/rootdir/init.rc
  5. index 09920ab..c59661a 100755
  6. --- a/rootdir/init.rc
  7. +++ b/rootdir/init.rc
  8. @@ -279,7 +279,7 @@ on boot
  9.      chown system system /sys/devices/platform/msm_sdcc.3/polling
  10.      chown system system /sys/devices/platform/msm_sdcc.4/polling
  11.      chown system system /sys/devices/platform/msm_hsusb/gadget/wakeup
  12. -
  13. + chmod 777 /dev/ilitek_ctrl
  14.  # Define TCP buffer sizes for various networks
  15.  # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
  16.      setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
  17. [root@btg core]#
       上面是作通用的patch,接下来是做当前树的patch
  1. [root@btg core]# git commit -am "test message"
  2. [LiuQi 58673fd] test message
  3.  1 files changed, 1 insertions(+), 1 deletions(-)
  4. [root@btg core]# git format-patch -s -1
  5. 0001-test-message.patch
  6. [root@btg core]# cat 0001-test-message.patch
  7. From 58673fd548211ce90c5b8fee7fc429f29d27ebab Mon Sep 17 00:00:00 2001
  8. From: LiuQi <lingjiujianke@gmail.com>
  9. Date: Thu, 21 Apr 2011 15:21:55 +0800
  10. Subject: [PATCH] test message

  11. Change-Id: I033602c176d9825e7bcd0bd0ec2d736f9c29b396

  12. Signed-off-by: LiuQi <lingjiujianke@gmail.com>
  13. ---
  14.  rootdir/init.rc | 2 +-
  15.  1 files changed, 1 insertions(+), 1 deletions(-)

  16. diff --git a/rootdir/init.rc b/rootdir/init.rc
  17. index 09920ab..c59661a 100755
  18. --- a/rootdir/init.rc
  19. +++ b/rootdir/init.rc
  20. @@ -279,7 +279,7 @@ on boot
  21.      chown system system /sys/devices/platform/msm_sdcc.3/polling
  22.      chown system system /sys/devices/platform/msm_sdcc.4/polling
  23.      chown system system /sys/devices/platform/msm_hsusb/gadget/wakeup
  24. -
  25. +    chmod 777 /dev/ilitek_ctrl
  26.  # Define TCP buffer sizes for various networks
  27.  # ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
  28.      setprop net.tcp.buffersize.default 4096,87380,110208,4096,16384,110208
  29. --
  30. 1.7.3.1

  31. [root@btg core]#
这样,对一个文件的修改的patch就做完了

    (2)文件添加的patch
    首先添加一个文件,然后再commit
       
  1. [root@btg core]# touch testfile.c
  2. [root@btg core]# vim testfile.c
  3. [root@btg core]# cat testfile.c
  4. #include <stdio.h>

  5. void test(void)
  6. {
  7.     return;
  8. }

  9. [root@btg core]# git add testfile.c
  10. [root@btg core]# git commit -am "add testfile.c"
  11. [LiuQi e4cf940] add testfile.c
  12.  1 files changed, 7 insertions(+), 0 deletions(-)
  13.  create mode 100644 testfile.c
  14. [root@btg core]#
然后再生成patch
  1. [root@btg core]# git format-patch -s -1
  2. 0001-add-testfile.c.patch
  3. [root@btg core]# cat 0001-add-testfile.c.patch
  4. From e4cf940d60d9d62f57b5f0f3a489e31040e7ede8 Mon Sep 17 00:00:00 2001
  5. From: LiuQi <lingjiujianke@gmail.com>
  6. Date: Thu, 21 Apr 2011 15:29:18 +0800
  7. Subject: [PATCH] add testfile.c

  8. Change-Id: Ifa1f291e782b0a1c77889cb48ba943aeef6cd57f

  9. Signed-off-by: LiuQi <lingjiujianke@gmail.com>
  10. ---
  11.  testfile.c | 7 +++++++
  12.  1 files changed, 7 insertions(+), 0 deletions(-)
  13.  create mode 100644 testfile.c

  14. diff --git a/testfile.c b/testfile.c
  15. new file mode 100644
  16. index 0000000..0c49400
  17. --- /dev/null
  18. +++ b/testfile.c
  19. @@ -0,0 +1,7 @@
  20. +#include <stdio.h>
  21. +
  22. +void test(void)
  23. +{
  24. +    return;
  25. +}
  26. +
  27. --
  28. 1.7.3.1

  29. [root@btg core]#
这样,添加一个文件后作的patch就生成出来了



2. 当从服务器clone下来了最新的代码,然后想知道中间的某一部分的代码的patch,
可以使用如下方法获得修改的内容,并生成patch
  1. [root@btg linux-2.6]# git format-patch -s -99999 fs/ext2/

  2. 0001-Linux-2.6.12-rc2.patch
  3. 0002-PATCH-Fix-acl-Oops.patch
  4. 0003-PATCH-ext2-corruption-regression-between-2.6.9-and-2.patch
  5. 0004-PATCH-remove-linux-xattr_acl.h.patch
  6. 0005-PATCH-xip-ext2-execute-in-place.patch
  7. 0006-PATCH-xip-reduce-code-duplication.patch
  8. 0007-PATCH-ext2-fix-mount-options-parting.patch
  9. 0008-PATCH-execute-in-place-fixes.patch
  10. 0009-PATCH-ext2-drop-quota-reference-before-releasing-ino.patch
  11. 0010-PATCH-fix-xip-sparse-file-handling-in-ext2.patch
  12. 0011-PATCH-mbcache-Remove-unused-mb_cache_shrink-paramete.patch
  13. 0012-Fix-nasty-ncpfs-symlink-handling-bug.patch
  14. 0013-PATCH-disk-quotas-fail-when-etc-mtab-is-symlinked-to.patch
  15. 0014-PATCH-update-filesystems-for-new-delete_inode-behavi.patch
  16. 0015-PATCH-ext2-Enable-atomic-inode-security-labeling.patch
  17. 0016-PATCH-Fix-ext2_new_inode-failure-paths.patch
  18. 0017-PATCH-Test-for-sb_getblk-return-value.patch
  19. 0018-PATCH-kfree-cleanup-fs.patch
  20. 0019-PATCH-remove-CONFIG_EXT-2-3-_CHECK.patch
  21. 0020-PATCH-ext2-remove-the-ancient-CHANGES-file.patch
  22. 0021-PATCH-ext2-remove-duplicate-newlines-in-ext2_fill_su.patch
  23. 0022-PATCH-mutex-subsystem-semaphore-to-mutex-VFS-i_sem.patch
  24. 0023-PATCH-remove-ext2-xattr-permission-checks.patch
  25. 0024-PATCH-fs-ext2-bitmap.c-ext2_count_free-is-only-requi.patch
  26. 0025-ext2-trivial-indentation-fix.patch
  27. 0026-PATCH-capable-capability.h-fs.patch
  28. 0027-PATCH-ext2-remove-d_splice_alias-NULL-check-from-ext.patch
  29. 0028-PATCH-Direct-Migration-V9-Avoid-writeback-page_migra.patch
  30. 0029-PATCH-Fix-two-ext-23-uninitialized-warnings.patch
  31. 0030-PATCH-ext2-print-xip-mount-option-in-ext2_show_optio.patch
  32. 0031-PATCH-quota-fix-error-code-for-ext2_new_inode.patch
  33. 0032-PATCH-fix-deadlock-in-ext2.patch
  34. 0033-PATCH-Fix-ext2-readdir-f_pos-re-validation-logic.patch
  35. 0034-PATCH-ext2-switch-to-inode_inc_count-inode_dec_count.patch
  36. 0035-PATCH-fs-ext2-proper-ext2_get_parent-prototype.patch
  37. 0036-PATCH-cpuset-memory-spread-slab-cache-filesystems.patch
  38. 0037-PATCH-cpuset-memory-spread-slab-cache-format.patch
  39. 0038-PATCH-Ext2-flags-shouldn-t-report-nogrpid.patch
  40. 0039-BUG_ON-Conversion-in-fs-ext2.patch
  41. 0040-PATCH-remove-get_blocks-support.patch
  42. 0041-PATCH-Make-most-file-operations-structs-in-fs-const.patch
  43. 0042-PATCH-Introduce-sys_splice-system-call.patch
  44. 0043-PATCH-VFS-Permit-filesystem-to-override-root-dentry-.patch
  45. 0044-PATCH-VFS-Permit-filesystem-to-perform-statfs-with-a.patch
  46. 0045-PATCH-read_mapping_page-for-address-space.patch
  47. 0046-PATCH-percpu-counter-data-type-changes-to-suppport-m.patch
  48. 0047-PATCH-ext2-clean-up-dead-code-from-mount-code.patch
  49. 0048-PATCH-Make-EXT2_DEBUG-work-again.patch
  50. 0049-PATCH-ext2-cleanup-put_page-and-comment-fix.patch
  51. 0050-PATCH-mark-address_space_operations-const.patch
  52. 0051-Remove-obsolete-include-linux-config.h.patch
  53. 0052-PATCH-lockdep-annotate-the-quota-code.patch
  54. 0053-PATCH-ext2-prevent-div-by-zero-on-corrupted-fs.patch
  55. 0054-PATCH-knfsd-Have-ext2-reject-file-handles-with-bad-i.patch
  56. 0055-PATCH-EXT2-Remove-superblock-lock-contention-in-ext2.patch
  57. 0056-PATCH-ext2-fix-mounts-at-16T.patch
  58. 0057-PATCH-fs-Conversions-from-kmalloc-memset-to-k-z-c-al.patch
  59. 0058-PATCH-fs-Removing-useless-casts.patch
  60. 0059-PATCH-Really-ignore-kmem_cache_destroy-return-value.patch
  61. 0060-PATCH-inode-diet-Eliminate-i_blksize-from-the-inode-.patch
  62. 0061-PATCH-BLOCK-Move-the-Ext2-device-ioctl-compat-stuff-.patch
  63. 0062-PATCH-Remove-readv-writev-methods-and-use-aio_read-a.patch
  64. 0063-PATCH-Streamline-generic_file_-interfaces-and-filema.patch
  65. 0064-PATCH-r-o-bind-mounts-unlink-monitor-i_nlink.patch
  66. 0065-PATCH-ext2-errors-behaviour-fix.patch
  67. 0066-PATCH-slab-remove-SLAB_KERNEL.patch
  68. 0067-PATCH-slab-remove-kmem_cache_t.patch
  69. 0068-PATCH-ext2-fsid-for-statvfs.patch
  70. 0069-PATCH-Remove-superfluous-lock_super-in-extN-xattr-co.patch
  71. 0070-PATCH-protect-ext2-ioctl-modifying-append_only-immut.patch
  72. 0071-PATCH-ext2-change-uses-of-f_-dentry-vfsmnt-to-use-f_.patch
  73. 0072-PATCH-LOG2-Implement-a-general-integer-log2-facility.patch
  74. 0073-PATCH-ext2-skip-pages-past-number-of-blocks-in-ext2_.patch
  75. 0074-PATCH-fix-umask-when-noACL-kernel-meets-extN-tuned-f.patch
  76. 0075-PATCH-mark-struct-inode_operations-const-1.patch
  77. 0076-PATCH-Mark-struct-super_operations-const.patch
  78. 0077-PATCH-ext-234-update-documentation.patch
  79. 0078-mm-make-read_cache_page-synchronous.patch
  80. 0079-slab-allocators-Remove-SLAB_DEBUG_INITIAL-flag.patch
  81. 0080-ext2-3-4-fix-file-date-underflow-on-ext2-3-filesyste.patch
  82. 0081-header-cleaning-don-t-include-smp_lock.h-when-not-us.patch
  83. 0082-ext3-copy-i_flags-to-inode-flags-on-write.patch
  84. 0083-Remove-SLAB_CTOR_CONSTRUCTOR.patch
  85. 0084-ext2-disallow-setting-xip-on-remount.patch
  86. 0085-ext2-fix-return-of-uninitialised-variable.patch
  87. 0086-sendfile-remove-.sendfile-from-filesystems-that-use-.patch
  88. 0087-xip-sendfile-removal.patch
  89. 0088-ext2-fix-a-comment-when-ext2_release_file-is-called.patch
  90. 0089-ext2-statfs-speed-up.patch
  91. 0090-knfsd-exportfs-add-exportfs.h-header.patch
  92. 0091-Introduce-is_owner_or_cap-to-wrap-CAP_FOWNER-use-wit.patch
  93. 0092-some-kmalloc-memset-kzalloc-tree-wide.patch
  94. 0093-mm-Remove-slab-destructors-from-kmem_cache_create.patch
  95. 0094-fix-inode_table-test-in-ext234_check_descriptors.patch
  96. 0095-ext2-convert-to-new-aops.patch
  97. 0096-fs-restore-nobh.patch
  98. 0097-lib-percpu_counter_add.patch
  99. 0098-lib-percpu_counter_sub.patch
  100. 0099-lib-percpu_counter_init-error-handling.patch
  101. 0100-Slab-API-remove-useless-ctor-parameter-and-reorder-p.patch
  102. 0101-fs-mark-nibblemap-const.patch
  103. 0102-ext2-show-all-mount-options.patch
  104. 0103-remove-unused-bh-in-calls-to-ext234_get_group_desc.patch
  105. 0104-ext2-ext3-ext4-add-block-bitmap-validation.patch
  106. 0105-ext2-4-use-is_power_of_2.patch
  107. 0106-ext2-reservations.patch
  108. 0107-ext2-avoid-rec_len-overflow-with-64KB-block-size.patch
  109. 0108-ext2-new-export-ops.patch
  110. 0109-exportfs-make-struct-export_operations-const.patch
  111. 0110-Revert-ext2-ext3-ext4-add-block-bitmap-validation.patch
  112. 0111-Forbid-user-to-change-file-flags-on-quota-files.patch
  113. 0112-fix-up-ext2_fs.h-for-userspace-after-reservations-ba.patch
  114. 0113-ext2-Fix-the-max-file-size-for-ext2-file-system.patch
  115. 0114-ext2-return-after-ext2_error-in-case-of-failures.patch
  116. 0115-ext2-change-the-default-behaviour-on-error.patch
  117. 0116-ext2-xip-check-fix.patch
  118. 0117-ext2-add-block-bitmap-validation.patch
  119. 0118-BKL-removal-convert-ext2-over-to-use-unlocked_ioctl.patch
  120. 0119-BKL-removal-remove-incorrect-BKL-comment-in-ext2.patch
  121. 0120-ext-234-fix-comment-for-nonexistent-variable.patch
  122. 0121-ext-234-use-ext-234-_get_group_desc.patch
  123. 0122-ext-234-remove-unused-argument-for-ext-234-_find_goa.patch
  124. 0123-ext-234-cleanup-ext-234-_bg_num_gdb.patch
  125. 0124-iget-stop-EXT2-from-using-iget-and-read_inode.patch
  126. 0125-ext2-remove-unused-ext2_put_inode-prototype.patch
  127. 0126-mount-options-fix-ext2.patch
  128. 0127-vfs-fix-possible-deadlock-in-ext2-ext3-ext4-when-usi.patch
  129. 0128-PATCH-r-o-bind-mounts-elevate-write-count-for-ioctls.patch
  130. 0129-ext-spelling-fix-prefered-preferred.patch
  131. 0130-return-pfn-from-direct_access-for-XIP.patch
  132. 0131-xip-support-non-struct-page-backed-memory.patch
  133. 0132-ext2-le-_add_cpu-conversion.patch
  134. 0133-ext2-convert-byte-order-of-constant-instead-of-varia.patch
  135. 0134-ext2-improve-ext2_readdir-return-value.patch
  136. 0135-ext2-use-ext2_group_first_block_no.patch
  137. 0136-ext2-use-ext2_fsblk_t-type.patch
  138. 0137-fs-ext2-use-BUG_ON.patch
  139. 0138-ext2-replace-remaining-__FUNCTION__-occurrences.patch
  140. 0139-ext2-retry-block-allocation-if-new-blocks-are-alloca.patch
  141. 0140-ext2-remove-double-definitions-of-xattr-macros.patch
  142. 0141-quota-move-function-macros-from-quota.h-to-quotaops..patch
  143. 0142-SL-B-drop-kmem-cache-argument-from-constructor.patch
  144. 0143-PATCH-sanitize-permission-prototype.patch
  145. 0144-vfs-pagecache-usage-optimization-for-pagesize-blocks.patch
  146. 0145-generic-block-based-fiemap-implementation.patch
  147. 0146-vfs-Use-const-for-kernel-parser-table.patch
  148. 0147-ext2-fix-ext2-block-reservation-early-ENOSPC-issue.patch
  149. 0148-ext2-avoid-printk-floods-in-the-face-of-directory-co.patch
  150. 0149-fs-Kconfig-move-ext2-ext3-ext4-JBD-JBD2-out.patch
  151. 0150-PATCH-move-block_device_operations-to-blkdev.h.patch
  152. 0151-PATCH-switch-all-filesystems-over-to-d_obtain_alias.patch
  153. 0152-PATCH-get-rid-of-on-stack-dentry-in-ext2_get_parent.patch
  154. 0153-CRED-Wrap-task-credential-accesses-in-the-Ext2-files.patch
  155. 0154-ext2-ensure-fast-symlinks-are-NUL-terminated.patch
  156. 0155-nfsd-race-fixes-ext2.patch
  157. 0156-ext2-fix-ext2_splice_branch-comments.patch
  158. 0157-ext2-allocate-s_blockgroup_lock-separately.patch
  159. 0158-ext2-don-t-inherit-inappropriate-inode-flags-from-pa.patch
  160. 0159-ext2-tighten-restrictions-on-inode-flags.patch
  161. 0160-ext2-also-update-the-inode-on-disk-when-dir-is-IS_DI.patch
  162. 0161-ext2-xip-refuse-to-change-xip-flag-during-remount-wi.patch
  163. 0162-ext2-Use-lowercase-names-of-quota-functions.patch
  164. 0163-ext2-Zero-our-b_size-in-ext2_quota_read.patch
  165. 0164-New-helper-current_umask.patch
  166. 0165-ext2-fix-data-corruption-for-racing-writes.patch
  167. 0166-ext2-missing-unlock-in-ext2_quota_write.patch
  168. 0167-ext2-Fix-memory-leak-in-ext2_fill_super-in-case-of-a.patch
  169. 0168-remove-write_super-call-in-generic_shutdown_super.patch
  170. 0169-push-BKL-down-into-put_super.patch
  171. 0170-Push-BKL-down-into-remount_fs.patch
  172. 0171-switch-ext2-to-simple_fsync.patch
  173. 0172-ext2-add-sync_fs.patch
  174. 0173-trivial-ext2-fix-a-typo-in-comment-in-ext2.h.patch
  175. 0174-ext2-Do-not-update-mtime-of-a-moved-directory.patch
  176. 0175-switch-ext2-to-inode-i_acl.patch
  177. 0176-helpers-for-acl-caching-switch-to-those.patch
  178. 0177-ext2-return-EIO-not-ESTALE-on-directory-traversal-th.patch
  179. 0178-headers-smp_lock.h-redux.patch
  180. 0179-ext2-fix-unbalanced-kmap-kunmap.patch
  181. 0180-ext-234-move-over-to-check_acl-permission-model.patch
  182. 0181-ext2-Update-comment-about-generic_osync_inode.patch
  183. 0182-HWPOISON-Enable-.remove_error_page-for-migration-awa.patch
  184. 0183-const-make-block_device_operations-const.patch
  185. 0184-ext2-fix-format-string-compile-warning-ino_t.patch
  186. 0185-ext2-Unify-log-messages-in-ext2.patch
  187. 0186-ext2-clear-uptodate-flag-on-super-block-I-O-error.patch
  188. 0187-ext2-fix-comment-in-ext2_find_entry-about-return-val.patch
  189. 0188-ext2-avoid-WARN-messages-when-failing-to-write-to-th.patch
  190. 0189-ext2-report-metadata-errors-during-fsync.patch
  191. 0190-sanitize-xattr-handler-prototypes.patch
  192. 0191-dquot-cleanup-space-allocation-freeing-routines.patch
  193. 0192-dquot-cleanup-inode-allocation-freeing-routines.patch
  194. 0193-dquot-cleanup-dquot-transfer-routine.patch
  195. 0194-dquot-move-dquot-drop-responsibility-into-the-filesy.patch
  196. 0195-dquot-cleanup-dquot-drop-routine.patch
  197. 0196-dquot-move-dquot-initialization-responsibility-into-.patch
  198. 0197-dquot-cleanup-dquot-initialize-routine.patch
  199. 0198-pass-writeback_control-to-write_inode.patch
  200. 0199-include-cleanup-Update-gfp.h-and-slab.h-includes-to-.patch
  201. 0200-ext2-symlink-must-be-handled-via-filesystem-specific.patch
  202. 0201-ext2-Avoid-loading-bitmaps-for-full-groups-during-bl.patch
  203. 0202-ext2-remove-useless-call-to-brelse-in-ext2_free_inod.patch
  204. 0203-ext2-Use-ext2_clear_super_error-in-ext2_sync_fs.patch
  205. 0204-ext2-Set-the-write-time-in-ext2_sync_fs.patch
  206. 0205-ext2-Remove-duplicate-code-from-ext2_sync_fs.patch
  207. 0206-ext2-Fold-ext2_commit_super-into-ext2_sync_super.patch
  208. 0207-ext2-Move-ext2_write_super-out-of-ext2_setup_super.patch
  209. 0208-ext2-Add-ext2_sb_info-s_lock-spinlock.patch
  210. 0209-BKL-Remove-BKL-from-ext2-filesystem.patch
  211. 0210-quota-unify-quota-init-condition-in-setattr.patch
  212. 0211-ext2-constify-xattr_handler.patch
  213. 0212-ext2-replace-inode-uid-gid-mode-init-with-helper.patch
  214. 0213-quota-move-remount-handling-into-the-filesystem.patch
  215. 0214-quota-kill-the-vfs_dq_off-and-vfs_dq_quota_on_remoun.patch
  216. 0215-quota-move-unmount-handling-into-the-filesystem.patch
  217. 0216-quota-explicitly-set-dq_op-and-s_qcop.patch
  218. 0217-quota-rename-default-quotactl-methods-to-dquot_.patch
  219. 0218-drop-unused-dentry-argument-to-fsync.patch
  220. 0219-rename-the-generic-fsync-implementations.patch
  221. 0220-ext2-convert-to-use-the-new-truncate-convention.patch
  222. 0221-fix-truncate-inode-time-modification-breakage.patch
  223. 0222-ext2-update-ctime-when-changing-the-file-s-permissio.patch
  224. 0223-sort-out-blockdev_direct_IO-variants.patch
  225. 0224-get-rid-of-nobh_write_begin_newtrunc.patch
  226. 0225-clean-up-write_begin-usage-for-directories-in-pageca.patch
  227. 0226-introduce-__block_write_begin.patch
  228. 0227-get-rid-of-block_write_begin_newtrunc.patch
  229. 0228-rename-generic_setattr.patch
  230. 0229-check-ATTR_SIZE-contraints-in-inode_change_ok.patch
  231. 0230-ext2-switch-to-dquot_free_block_nodirty.patch
  232. 0231-Take-dirtying-the-inode-to-callers-of-ext2_free_bloc.patch
  233. 0232-Don-t-dirty-the-victim-in-ext2_xattr_delete_inode.patch
  234. 0233-merge-ext2-delete_inode-and-clear_inode-switch-to-ev.patch
  235. 0234-mbcache-Remove-unused-features.patch
  236. 0235-ext2-fix-a-typo-on-comment-in-ext2-inode.c.patch
  237. 0236-BKL-Explicitly-add-BKL-around-get_sb-fill_super.patch
  238. 0237-BKL-Remove-BKL-from-ext2-filesystem.patch
  239. 0238-fs-add-sync_inode_metadata.patch
  240. 0239-ext2_remount-don-t-bother-with-invalidate_inodes.patch
  241. 0240-new-helper-ihold.patch
  242. 0241-ext2-fix-comment-on-ext2_try_to_allocate.patch
  243. 0242-ext2-fixed-typo.patch
  244. 0243-new-helper-mount_bdev.patch
  245. 0244-fs-ext2-super.c-Use-printf-extension-pV.patch
  246. 0245-fs-icache-RCU-free-inodes.patch
  247. 0246-fs-provide-rcu-walk-aware-permission-i_ops.patch
  248. 0247-ext2-3-4-provide-simple-rcu-walk-ACL-implementation.patch
  249. 0248-ext2-ext3-ext4-clarify-comment-for-extN_xattr_set_ha.patch
  250. 0249-ext2-remove-dead-code-in-ext2_xattr_get.patch
  251. 0250-ext2-speed-up-file-creates-by-optimizing-rec_len-fun.patch
  252. 0251-ext2-Remove-redundant-unlikely.patch
  253. 0252-fs-vfs-security-pass-last-path-component-to-LSM-on-i.patch
  254. 0253-ext2-Fix-link-count-corruption-under-heavy-link-rena.patch
  255. 0254-block-remove-per-queue-plugging.patch
  256. 0255-bitops-remove-ext2-non-atomic-bitops-from-asm-bitops.patch
  257. 0256-userns-rename-is_owner_or_cap-to-inode_owner_or_capa.patch
  258. 0257-Fix-common-misspellings.patch
  259. [root@btg linux-2.6]#
这样,就把所有的patch都给列出来了,可以根据需要去进行选择

3.在不同的版本的间做patch
  1. [root@btg linux-2.6]# git tag -l
  2. v2.6.11
  3. v2.6.11-tree
  4. .....
  5. v2.6.37-rc6
  6. v2.6.37-rc7
  7. v2.6.37-rc8
  8. v2.6.38
  9. v2.6.38-rc1
  10. v2.6.38-rc2
  11. v2.6.38-rc3
  12. v2.6.38-rc4
  13. v2.6.38-rc5
  14. v2.6.38-rc6
  15. v2.6.38-rc7
  16. v2.6.38-rc8
  17. v2.6.39-rc1
  18. v2.6.39-rc2
  19. v2.6.39-rc3
  20. v2.6.39-rc4
  21. [root@btg linux-2.6]#
先列出来tag,然后再根据需要,进行patch生成,例如想知道2.6.38到2.6.39-rc2之间的ext2文件系统都做了什么

  1. [root@btg linux-2.6]# git diff v2.6.38 v2.6.38-rc2 fs/ext2/ > diff
  2. [root@btg linux-2.6]# cat diff
  3. diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c
  4. index adb9185..2e1d834 100644
  5. --- a/fs/ext2/namei.c
  6. +++ b/fs/ext2/namei.c
  7. @@ -344,6 +344,7 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry,
  8.          new_de = ext2_find_entry (new_dir, &new_dentry->d_name, &new_page);
  9.          if (!new_de)
  10.              goto out_dir;
  11. +        inode_inc_link_count(old_inode);
  12.          ext2_set_link(new_dir, new_de, new_page, old_inode, 1);
  13.          new_inode->i_ctime = CURRENT_TIME_SEC;
  14.          if (dir_de)
  15. @@ -355,9 +356,12 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry,
  16.              if (new_dir->i_nlink >= EXT2_LINK_MAX)
  17.                  goto out_dir;
  18.          }
  19. +        inode_inc_link_count(old_inode);
  20.          err = ext2_add_link(new_dentry, old_inode);
  21. -        if (err)
  22. +        if (err) {
  23. +            inode_dec_link_count(old_inode);
  24.              goto out_dir;
  25. +        }
  26.          if (dir_de)
  27.              inode_inc_link_count(new_dir);
  28.      }
  29. @@ -365,11 +369,12 @@ static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry,
  30.      /*
  31.       * Like most other Unix systems, set the ctime for inodes on a
  32.        * rename.
  33. +     * inode_dec_link_count() will mark the inode dirty.
  34.       */
  35.      old_inode->i_ctime = CURRENT_TIME_SEC;
  36. -    mark_inode_dirty(old_inode);
  37.  
  38.      ext2_delete_entry (old_de, old_page);
  39. +    inode_dec_link_count(old_inode);
  40.  
  41.      if (dir_de) {
  42.          if (old_dir != new_dir)
  43. [root@btg linux-2.6]#
这样就搞定了,那个diff文件可以重新命个名,比如叫ext2_modify.patch
















阅读(11288) | 评论(5) | 转发(2) |
给主人留下些什么吧!~~

lengyuex2011-07-26 12:43:02

ext4: Fix coding style in fs/ext4/move_extent.c
mainline中有一个啊

lengyuex2011-07-26 12:36:15

T-Bagwell: 那都是浮云,呵呵.....
怎么能叫浮云呢?为开源做贡献为啥是浮云?

T-Bagwell2011-07-26 09:04:04

lengyuex: TB兄贡献过多少patch了.....
那都是浮云,呵呵

lengyuex2011-07-25 15:41:57

TB兄贡献过多少patch了

godbach2011-04-21 16:35:23

仰慕 TB 兄。
学习了。