*
* A hunk header is never considered part of a conflict. It
* thereby can serve as a separator between conflicts.
+ *
+ * We need to ensure there is adequate context for the conflict.
+ * So ensure there are at least 3 newlines in Extraneous or
+ * Unchanged on both sides of a Conflict - but don't go so far
+ * as including a hunk header.
+ * If there are 3, and they are all in 'Unchanged' sections, then
+ * that much context is not really needed - reduce it a bit.
*/
int i, j, k;
int cnt = 0;
*
* Then search forward doing the same thing.
*/
+ int newlines = 0;
cnt++;
m[i].in_conflict = 1;
j = i;
cnt--;
break;
}
+ if (m[j].type == Extraneous) {
+ for (k = m[j].bl; k > 0; k--)
+ if (ends_line(bf.list[m[j].b+k-1]))
+ newlines++;
+ }
if (m[j].type == Unchanged || m[j].type == Changed) {
+ /* If we find enough newlines in this section,
+ * then we only really need 1, but would rather
+ * it wasn't the first one. 'firstk' allows us
+ * to track which newline we actually use
+ */
+ int firstk = m[j].al;
if (words) {
m[j].hi = m[j].al;
break;
* is one, or might be at the start
*/
for (k = m[j].al; k > 0; k--)
- if (ends_line(af.list[m[j].a+k-1]))
- break;
+ if (ends_line(af.list[m[j].a+k-1])) {
+ if (firstk == m[j].al)
+ firstk = k;
+ newlines++;
+ if (newlines >= 3) {
+ k = firstk;
+ break;
+ }
+ }
if (k > 0)
m[j].hi = k;
else if (is_cutpoint(m[j], af,bf,cf))
}
/* now the forward search */
+ newlines = 0;
for (j = i+1; m[j].type != End; j++) {
if (m[j].type == Extraneous &&
bf.list[m[j].b].start[0] == '\0')
/* hunk header - not conflict any more */
break;
m[j].in_conflict = 1;
+ if (m[j].type == Extraneous) {
+ for (k = 0; k < m[j].bl; k++)
+ if (ends_line(bf.list[m[j].b+k]))
+ newlines++;
+ }
if (m[j].type == Unchanged || m[j].type == Changed) {
m[j].hi = m[j].al;
if (words) {
if (is_cutpoint(m[j], af,bf,cf))
m[j].lo = 0;
else {
+ /* If we find enough newlines in this section,
+ * then we only really need 1, but would rather
+ * it wasn't the first one. 'firstk' allows us
+ * to track which newline we actually use
+ */
+ int firstk = 0;
for (k = 0 ; k < m[j].al ; k++)
- if (ends_line(af.list[m[j].a+k]))
- break;
+ if (ends_line(af.list[m[j].a+k])) {
+ if (firstk == 0)
+ firstk = k;
+ newlines++;
+ if (newlines >= 3) {
+ k = firstk;
+ break;
+ }
+ }
if (k < m[j].al)
m[j].lo = k+1;
else
void generic_delete_inode(struct inode *inode)
{
struct super_operations *op = inode->i_sb->s_op;
-
<<<<<<<
+
hlist_del_init(&inode->i_hash);
|||||||
+
list_del_init(&inode->i_hash);
=======
+
>>>>>>>
list_del_init(&inode->i_list);
inode->i_state|=I_FREEING;
MD_EXPORT_SYMBOL(md_wakeup_thread);
MD_EXPORT_SYMBOL(md_print_devices);
MD_EXPORT_SYMBOL(find_rdev_nr);
-MD_EXPORT_SYMBOL(md_interrupt_thread);
<<<<<<<
+MD_EXPORT_SYMBOL(md_interrupt_thread);
MD_EXPORT_SYMBOL(mddev_map);
|||||||
+MD_EXPORT_SYMBOL(md_interrupt_thread);
EXPORT_SYMBOL(mddev_map);
=======
+MD_EXPORT_SYMBOL(md_interrupt_thread);
>>>>>>>
MODULE_LICENSE("GPL");
<<<<<<<
if (conf->start_future > 0) {
MD_BUG();
+ err = -EBUSY;
+ break;
+ }
|||||||
close_sync(conf);
=======
>>>>>>>
- err = -EBUSY;
- break;
- }
sdisk = conf->mirrors + spare_disk;
sdisk->operational = 0;
sdisk->write_only = 0;
<<<<<<<
if (conf->start_future > 0) {
MD_BUG();
+ err = -EBUSY;
+ break;
+ }
|||||||
close_sync(conf);
=======
>>>>>>>
- err = -EBUSY;
- break;
- }
sdisk = conf->mirrors + spare_disk;
fdisk = conf->mirrors + failed_disk;
*** 1144,16 **** 8
<<<<<<<
raid1_conf_t *conf = data;
+ mddev_t *mddev = conf->mddev;
|||||||
conf_t *conf = data;
+ mddev_t *mddev = conf->mddev;
=======
sector_t max_sector, nr_sectors;
->>>>>>>
int disk, partial;
+>>>>>>>
if (sector_nr == 0)
if (init_resync(conf))
raid1_shrink_buffers(conf);
return -ENOMEM;
}
-|||||||
- if (!sector_nr)
- if (init_resync(conf))
- return -ENOMEM;
- /*
-=======
- if (sector_nr >= max_sector) {
- close_sync(conf);
- return 0;
- }
-
- /*
->>>>>>>
static void end_sync_read(struct buffer_head *bh, int uptodate)
{
raid1_free_buf(r1_bh);
sync_request_done(sect, mddev_to_conf(mddev));
md_done_sync(mddev,size>>9, uptodate);
+|||||||
+ if (!sector_nr)
+ if (init_resync(conf))
+ return -ENOMEM;
+ /*
+ * If there is non-resync activity waiting for us then
+ * put in a delay to throttle resync.
+=======
+ if (sector_nr >= max_sector) {
+ close_sync(conf);
+ return 0;
+ }
+
+ /*
+ * If there is non-resync activity waiting for us then
+ * put in a delay to throttle resync.
+>>>>>>>
}
}
}
<<<<<<<
+ if (!start_recovery && !(sb->state & (1 << MD_SB_CLEAN)) &&
(conf->working_disks > 1)) {
const char * name = "raid1syncd";
conf->resync_thread = md_register_thread(raid1syncd, conf,name);
|||||||
+ if (!start_recovery && !(sb->state & (1 << MD_SB_CLEAN)) &&
(conf->working_disks > 1)) {
const char * name = "raid1syncd";
dev->vec.bv_len = STRIPE_SIZE;
dev->vec.bv_offset = 0;
- dev->req.bi_bdev = conf->disks[i].bdev;
<<<<<<<
+ bh->b_dev = conf->disks[i].dev;
|||||||
+ bh->b_dev = conf->disks[i].dev;
/* FIXME - later we will need bdev here */
=======
+ dev->req.bi_bdev = conf->disks[i].bdev;
dev->req.bi_sector = sh->sector;
>>>>>>>
dev->req.bi_private = sh;
bh->b_size = sh->size;
bh->b_list = BUF_LOCKED;
return bh;
+}
|||||||
bh->b_size = sh->size;
return bh;
+}
=======
dev->sector = compute_blocknr(sh, i);
->>>>>>>
}
+>>>>>>>
sk->write_space = svc_write_space;
svsk->sk_reclen = 0;
+<<<<<<<
svsk->sk_tcplen = 0;
-<<<<<<<
/* initialise setting must have enough space to
+ * receive and respond to one request.
+ * svc_tcp_recvfrom will re-adjust if necessary
|||||||
+ svsk->sk_tcplen = 0;
+
/* initialise setting must have enough space to
+ * receive and respond to one request.
+ * svc_tcp_recvfrom will re-adjust if necessary
=======
+ svsk->sk_tcplen = 0;
+
tp->nonagle = 1; /* disable Nagle's algorithm */
/* initialise setting must have enough space to
+ * receive and respond to one request.
+ * svc_tcp_recvfrom will re-adjust if necessary
>>>>>>>
- * receive and respond to one request.
- * svc_tcp_recvfrom will re-adjust if necessary
*/
svc_sock_setbufsize(svsk->sk_sock,
3 * svsk->sk_server->sv_bufsz,
8
9
0
+yes
|||||||
a
b
h
i
j
+yes
=======
A
B
H
I
J
->>>>>>>
yes
+>>>>>>>
+<<<<<<<
this is a file
with the word
-<<<<<<<
two which is
+misspelt
|||||||
+this is a file
+with the word
to which is
+misspelt
=======
+this is a file
+with the word
too which is
->>>>>>>
misspelt
+>>>>>>>
+<<<<<<<
this is a file
with the word
-<<<<<<<
two which is
|||||||
+this is a file
+with the word
to which is
=======
+this is a file
+with the word
too which was
>>>>>>>
misspelt
+<<<<<<<
this is a file
with the word
-<<<<<<<
two which is
+misspelt
|||||||
+this is a file
+with the word
to which is
+misspelt
=======
+this is a file
+with the word
too which was
->>>>>>>
misspelt
+>>>>>>>
current
version
of
-the
<<<<<<<
+the
file.
|||||||
+the
file
=======
+the
file that has changed
>>>>>>>
the
<<<<<<<
file.
+
|||||||
file
+
=======
file that has changed
->>>>>>>
+>>>>>>>
-
<<<<<<<
+
This is one line of the file
+
|||||||
+
This is 1 line of the file
+
=======
+
This is 1 line of the document
+
&&&&&&&
+
This is one line of the document
->>>>>>>
+>>>>>>>
I think this is another line
So is this