diff options
| -rw-r--r-- | xlators/cluster/ec/src/ec-dir-read.c | 22 | 
1 files changed, 21 insertions, 1 deletions
diff --git a/xlators/cluster/ec/src/ec-dir-read.c b/xlators/cluster/ec/src/ec-dir-read.c index fc8b38b22a4..ed53a0416e0 100644 --- a/xlators/cluster/ec/src/ec-dir-read.c +++ b/xlators/cluster/ec/src/ec-dir-read.c @@ -138,6 +138,13 @@ int32_t ec_manager_opendir(ec_fop_data_t * fop, int32_t state)              UNLOCK(&fop->fd->lock);              /* Fall through */ + +        case EC_STATE_LOCK: +            ec_lock_prepare_inode(fop, &fop->loc[0], EC_QUERY_INFO); +            ec_lock(fop); + +            return EC_STATE_DISPATCH; +          case EC_STATE_DISPATCH:              ec_dispatch_all(fop); @@ -173,9 +180,10 @@ int32_t ec_manager_opendir(ec_fop_data_t * fop, int32_t state)                                    cbk->op_errno, cbk->fd, cbk->xdata);              } -            return EC_STATE_END; +            return EC_STATE_LOCK_REUSE;          case -EC_STATE_INIT: +        case -EC_STATE_LOCK:          case -EC_STATE_DISPATCH:          case -EC_STATE_PREPARE_ANSWER:          case -EC_STATE_REPORT: @@ -187,6 +195,18 @@ int32_t ec_manager_opendir(ec_fop_data_t * fop, int32_t state)                                    NULL, NULL);              } +            return EC_STATE_LOCK_REUSE; + +        case -EC_STATE_LOCK_REUSE: +        case EC_STATE_LOCK_REUSE: +            ec_lock_reuse(fop); + +            return EC_STATE_UNLOCK; + +        case -EC_STATE_UNLOCK: +        case EC_STATE_UNLOCK: +            ec_unlock(fop); +              return EC_STATE_END;          default:  | 
