quota.c (762f99f4f3cb41a775b5157dd761217beba65873) | quota.c (b846f2d7e2d28ebfa112ac595bde2ef87693d8d9) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 4 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 5 */ 6 7/* 8 * Quota change tags are associated with each transaction that allocates or --- 429 unchanged lines hidden (view full) --- 438 set_bit(QDF_LOCKED, &qd->qd_flags); 439 qd->qd_change_sync = qd->qd_change; 440 slot_hold(qd); 441 return 1; 442} 443 444static int qd_fish(struct gfs2_sbd *sdp, struct gfs2_quota_data **qdp) 445{ | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 4 * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. 5 */ 6 7/* 8 * Quota change tags are associated with each transaction that allocates or --- 429 unchanged lines hidden (view full) --- 438 set_bit(QDF_LOCKED, &qd->qd_flags); 439 qd->qd_change_sync = qd->qd_change; 440 slot_hold(qd); 441 return 1; 442} 443 444static int qd_fish(struct gfs2_sbd *sdp, struct gfs2_quota_data **qdp) 445{ |
446 struct gfs2_quota_data *qd = NULL; | 446 struct gfs2_quota_data *qd = NULL, *iter; |
447 int error; | 447 int error; |
448 int found = 0; | |
449 450 *qdp = NULL; 451 452 if (sb_rdonly(sdp->sd_vfs)) 453 return 0; 454 455 spin_lock(&qd_lock); 456 | 448 449 *qdp = NULL; 450 451 if (sb_rdonly(sdp->sd_vfs)) 452 return 0; 453 454 spin_lock(&qd_lock); 455 |
457 list_for_each_entry(qd, &sdp->sd_quota_list, qd_list) { 458 found = qd_check_sync(sdp, qd, &sdp->sd_quota_sync_gen); 459 if (found) | 456 list_for_each_entry(iter, &sdp->sd_quota_list, qd_list) { 457 if (qd_check_sync(sdp, iter, &sdp->sd_quota_sync_gen)) { 458 qd = iter; |
460 break; | 459 break; |
460 } |
|
461 } 462 | 461 } 462 |
463 if (!found) 464 qd = NULL; 465 | |
466 spin_unlock(&qd_lock); 467 468 if (qd) { 469 gfs2_assert_warn(sdp, qd->qd_change_sync); 470 error = bh_get(qd); 471 if (error) { 472 clear_bit(QDF_LOCKED, &qd->qd_flags); 473 slot_put(qd); --- 1305 unchanged lines hidden --- | 463 spin_unlock(&qd_lock); 464 465 if (qd) { 466 gfs2_assert_warn(sdp, qd->qd_change_sync); 467 error = bh_get(qd); 468 if (error) { 469 clear_bit(QDF_LOCKED, &qd->qd_flags); 470 slot_put(qd); --- 1305 unchanged lines hidden --- |